Skip to contentSkip to conversation

f2fs: more reasonable mem_size calculating of ino_entry

PATCH New Kinglong Mee 1 participant 1 message Mar 18, 2017 F2FS file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: more reasonable mem_size calculating of ino_entry

---
 fs/f2fs/node.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/f2fs/node.c +2 -2
index cc7ef45..2962e23 100644
@@ -63,8 +63,8 @@ bool available_free_memory(struct f2fs_sb_info *sbi, int type)
 		int i;
 
 		for (i = 0; i <= UPDATE_INO; i++)
-			mem_size += (sbi->im[i].ino_num *
-				sizeof(struct ino_entry)) >> PAGE_SHIFT;
+			mem_size += sbi->im[i].ino_num * sizeof(struct ino_entry);
+		mem_size >>= PAGE_SHIFT;
 		res = mem_size < ((avail_ram * nm_i->ram_thresh / 100) >> 1);
 	} else if (type == EXTENT_CACHE) {
 		mem_size = (atomic_read(&sbi->total_ext_tree) *
Signature · 6 lines
2.9.3


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot