summaryrefslogtreecommitdiff
path: root/fs/f2fs/debug.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-08-02 20:56:40 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2016-08-24 20:16:14 +0300
commit3e025740b976c409820a789f8dabc4ec2c50a950 (patch)
treefaf2106cecd92efa0bad1e2c29e99d01303817e1 /fs/f2fs/debug.c
parentbb413d6acd4e1c361daebf8486efc3923f429792 (diff)
downloadlinux-3e025740b976c409820a789f8dabc4ec2c50a950.tar.xz
f2fs: do not use discard_map for hard disks
We don't need to keep discard_map, if disk does not support discard command. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/debug.c')
-rw-r--r--fs/f2fs/debug.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
index badd407bb622..af69d6bcfc3f 100644
--- a/fs/f2fs/debug.c
+++ b/fs/f2fs/debug.c
@@ -154,7 +154,9 @@ static void update_mem_info(struct f2fs_sb_info *sbi)
si->base_mem += sizeof(struct sit_info);
si->base_mem += MAIN_SEGS(sbi) * sizeof(struct seg_entry);
si->base_mem += f2fs_bitmap_size(MAIN_SEGS(sbi));
- si->base_mem += 3 * SIT_VBLOCK_MAP_SIZE * MAIN_SEGS(sbi);
+ si->base_mem += 2 * SIT_VBLOCK_MAP_SIZE * MAIN_SEGS(sbi);
+ if (f2fs_discard_en(sbi))
+ si->base_mem += SIT_VBLOCK_MAP_SIZE * MAIN_SEGS(sbi);
si->base_mem += SIT_VBLOCK_MAP_SIZE;
if (sbi->segs_per_sec > 1)
si->base_mem += MAIN_SECS(sbi) * sizeof(struct sec_entry);