diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-05-17 20:36:58 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-05-24 07:07:18 +0300 |
commit | 1d7be2708277edfef95171d52fb65ee26eaa076b (patch) | |
tree | 84cc7366fb88e361cfe381238748744764b349ab /fs/f2fs/gc.c | |
parent | b7b7c4cf1c9ef0272a65f1480457cbfdadcda19d (diff) | |
download | linux-1d7be2708277edfef95171d52fb65ee26eaa076b.tar.xz |
f2fs: try to freeze in gc and discard threads
This allows to freeze gc and discard threads.
Cc: stable@vger.kernel.org
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r-- | fs/f2fs/gc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 81392970fb2d..570480571d72 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -32,13 +32,14 @@ static int gc_thread_func(void *data) wait_ms = gc_th->min_sleep_time; + set_freezable(); do { + wait_event_interruptible_timeout(*wq, + kthread_should_stop() || freezing(current), + msecs_to_jiffies(wait_ms)); + if (try_to_freeze()) continue; - else - wait_event_interruptible_timeout(*wq, - kthread_should_stop(), - msecs_to_jiffies(wait_ms)); if (kthread_should_stop()) break; |