Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a39e5365 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

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: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 82902c06
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -1367,12 +1367,12 @@ static void default_options(struct f2fs_sb_info *sbi)
	set_opt(sbi, NOHEAP);
	set_opt(sbi, NOHEAP);
	sbi->sb->s_flags |= SB_LAZYTIME;
	sbi->sb->s_flags |= SB_LAZYTIME;
	set_opt(sbi, FLUSH_MERGE);
	set_opt(sbi, FLUSH_MERGE);
	if (f2fs_sb_has_blkzoned(sbi->sb)) {
	if (blk_queue_discard(bdev_get_queue(sbi->sb->s_bdev)))
		set_opt_mode(sbi, F2FS_MOUNT_LFS);
		set_opt(sbi, DISCARD);
		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);
		set_opt_mode(sbi, F2FS_MOUNT_ADAPTIVE);
	}


#ifdef CONFIG_F2FS_FS_XATTR
#ifdef CONFIG_F2FS_FS_XATTR
	set_opt(sbi, XATTR_USER);
	set_opt(sbi, XATTR_USER);