summaryrefslogtreecommitdiff
path: root/fs/f2fs/sysfs.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2017-08-15 21:27:19 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2017-08-29 10:02:47 -0700
commit5f656541ff6e4f58b4ab5b4ae59badb97a9ff749 (patch)
tree21b52814f7f3b22ae9752b30bed7f28dd6abb455 /fs/f2fs/sysfs.c
parent969d1b180d987c2be02de890d0fff0f66a0e80de (diff)
f2fs: issue discard commands if gc_urgent is set
It's time to issue all the discard commands, if user sets the idle time. 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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index 4bcaa9059026..b9ad9041559f 100644
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -178,8 +178,13 @@ static ssize_t f2fs_sbi_store(struct f2fs_attr *a,
if (!strcmp(a->attr.name, "iostat_enable") && *ui == 0)
f2fs_reset_iostat(sbi);
if (!strcmp(a->attr.name, "gc_urgent") && t == 1 && sbi->gc_thread) {
+ struct discard_cmd_control *dcc = SM_I(sbi)->dcc_info;
+
sbi->gc_thread->gc_wake = 1;
wake_up_interruptible_all(&sbi->gc_thread->gc_wait_queue_head);
+
+ dcc->discard_wake = 1;
+ wake_up_interruptible_all(&dcc->discard_wait_queue);
}
return count;