diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-08-02 10:56:40 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-08-24 10:16:14 -0700 |
commit | 3e025740b976c409820a789f8dabc4ec2c50a950 (patch) | |
tree | faf2106cecd92efa0bad1e2c29e99d01303817e1 /fs/f2fs/debug.c | |
parent | bb413d6acd4e1c361daebf8486efc3923f429792 (diff) | |
download | talos-obmc-linux-3e025740b976c409820a789f8dabc4ec2c50a950.tar.gz talos-obmc-linux-3e025740b976c409820a789f8dabc4ec2c50a950.zip |
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.c | 4 |
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); |