summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/gc.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2017-05-17 10:36:58 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2017-05-23 21:07:18 -0700
commit1d7be2708277edfef95171d52fb65ee26eaa076b (patch)
tree84cc7366fb88e361cfe381238748744764b349ab /fs/f2fs/gc.c
parentb7b7c4cf1c9ef0272a65f1480457cbfdadcda19d (diff)
downloadop-kernel-dev-1d7be2708277edfef95171d52fb65ee26eaa076b.zip
op-kernel-dev-1d7be2708277edfef95171d52fb65ee26eaa076b.tar.gz
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.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 8139297..5704805 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;
OpenPOWER on IntegriCloud