diff options
author | Kinglong Mee <kinglongmee@gmail.com> | 2017-03-18 04:26:13 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-03-22 05:34:37 +0300 |
commit | 8f73cbb7d4f300eda84a00ffe8bf9f7cf2d3ea06 (patch) | |
tree | 7f53f9b1013d05cc08658146af3beb1d545d4842 /fs/f2fs/node.c | |
parent | 70874fb34fbd8b34b1aa45b30ca7eb216b1376d4 (diff) | |
download | linux-8f73cbb7d4f300eda84a00ffe8bf9f7cf2d3ea06.tar.xz |
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>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r-- | fs/f2fs/node.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 3bfffd744f87..b52c9c0a47ab 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -63,8 +63,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) * |