diff options
author | Chao Yu <yuchao0@huawei.com> | 2018-07-05 14:24:11 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-08-01 11:52:36 -0700 |
commit | a39e5365835edcdb12140d423573c2b8ed39ebfb (patch) | |
tree | dacefa29493c05a54e5a3934b0defee0a7a9e585 | |
parent | 82902c06bd17dbf6e8184299842ca5c68880970f (diff) | |
download | linux-a39e5365835edcdb12140d423573c2b8ed39ebfb.tar.bz2 |
f2fs: enable real-time discard by default
f2fs is focused on flash based storage, so let's enable real-time
discard by default, if user don't want to enable it, 'nodiscard'
mount option should be used on mount.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fs/f2fs/super.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 98bfccc1d389..609ea8736dbf 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1367,12 +1367,12 @@ static void default_options(struct f2fs_sb_info *sbi) set_opt(sbi, NOHEAP); sbi->sb->s_flags |= SB_LAZYTIME; set_opt(sbi, FLUSH_MERGE); - if (f2fs_sb_has_blkzoned(sbi->sb)) { - set_opt_mode(sbi, F2FS_MOUNT_LFS); + if (blk_queue_discard(bdev_get_queue(sbi->sb->s_bdev))) set_opt(sbi, DISCARD); - } else { + if (f2fs_sb_has_blkzoned(sbi->sb)) + set_opt_mode(sbi, F2FS_MOUNT_LFS); + else set_opt_mode(sbi, F2FS_MOUNT_ADAPTIVE); - } #ifdef CONFIG_F2FS_FS_XATTR set_opt(sbi, XATTR_USER); |