summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/segment.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2017-04-25 00:21:35 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2017-04-25 14:18:45 -0700
commitd618ebaf0aa83d175658aea5291e0c459d471d39 (patch)
tree046e85ec35859068b4b99bd10348ff2c0db64edd /fs/f2fs/segment.c
parent34e159da418be46986456daf21a339932f349b63 (diff)
downloadop-kernel-dev-d618ebaf0aa83d175658aea5291e0c459d471d39.zip
op-kernel-dev-d618ebaf0aa83d175658aea5291e0c459d471d39.tar.gz
f2fs: enable small discard by default
This patch start to enable 4K granularity small discard by default when realtime discard is on, so, in seriously fragmented space, small size discard can be issued in time to avoid useless storage space occupying of invalid filesystem's data, then performance of flash storage can be recovered. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r--fs/f2fs/segment.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index b27ae5f..7ded7da 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1362,7 +1362,7 @@ static int create_discard_cmd_control(struct f2fs_sb_info *sbi)
atomic_set(&dcc->issing_discard, 0);
atomic_set(&dcc->discard_cmd_cnt, 0);
dcc->nr_discards = 0;
- dcc->max_discards = 0;
+ dcc->max_discards = MAIN_SEGS(sbi) << sbi->log_blocks_per_seg;
dcc->undiscard_blks = 0;
dcc->root = RB_ROOT;
OpenPOWER on IntegriCloud