aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2017-03-18 09:26:13 +0800
committerMoyster <oysterized@gmail.com>2017-05-21 18:38:52 +0200
commitdcebd7e78cdf6c5b489ebf87325b2bcbe344ca12 (patch)
tree43809f308d99250a5d0965a02ed27483b4783aee
parent4af9a8b76fc90a4fb46d50c4935b5fd764501cfb (diff)
f2fs: more reasonable mem_size calculating of ino_entry
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/node.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index a9ed906fb..6cee318da 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -73,8 +73,9 @@ 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) *