diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2019-01-14 10:42:11 -0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2019-02-04 08:55:34 -0800 |
commit | 03f2c02d8be76d2080c174cd65d2dfcbbf783708 (patch) | |
tree | c158cbf3adba51bcd4724e7f0e4cef75fb39b365 /fs/f2fs/sysfs.c | |
parent | 2010987365ab3b381df20bb6f175b59551cfe67d (diff) | |
download | linux-stable-03f2c02d8be76d2080c174cd65d2dfcbbf783708.tar.gz linux-stable-03f2c02d8be76d2080c174cd65d2dfcbbf783708.tar.bz2 linux-stable-03f2c02d8be76d2080c174cd65d2dfcbbf783708.zip |
f2fs: run discard jobs when put_super
When we umount f2fs, we need to avoid long delay due to discard commands, which
is actually taking tens of seconds, if storage is very slow on UNMAP. So, this
patch introduces timeout-based work on it.
By default, let me give 5 seconds for discard.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/sysfs.c')
-rw-r--r-- | fs/f2fs/sysfs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 5b83e1d66cb3..18c627e8fc90 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -426,6 +426,8 @@ F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, idle_interval, interval_time[REQ_TIME]); F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, discard_idle_interval, interval_time[DISCARD_TIME]); F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, gc_idle_interval, interval_time[GC_TIME]); +F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, + umount_discard_timeout, interval_time[UMOUNT_DISCARD_TIMEOUT]); F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, iostat_enable, iostat_enable); F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, readdir_ra, readdir_ra); F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, gc_pin_file_thresh, gc_pin_file_threshold); @@ -483,6 +485,7 @@ static struct attribute *f2fs_attrs[] = { ATTR_LIST(idle_interval), ATTR_LIST(discard_idle_interval), ATTR_LIST(gc_idle_interval), + ATTR_LIST(umount_discard_timeout), ATTR_LIST(iostat_enable), ATTR_LIST(readdir_ra), ATTR_LIST(gc_pin_file_thresh), |