summaryrefslogtreecommitdiff
path: root/fs/f2fs/gc.c
diff options
context:
space:
mode:
authorChangman Lee <cm224.lee@samsung.com>2013-01-29 13:30:07 +0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-02-12 02:15:00 +0400
commitd6212a5f18c8f9f9cc884070a96e11907711217f (patch)
treed1c579ecdeb7c2ffc94bffbe0b51af4d2e3c49f3 /fs/f2fs/gc.c
parenta2617dc6863b21a8109c199ab533b3dbfe178f27 (diff)
downloadlinux-d6212a5f18c8f9f9cc884070a96e11907711217f.tar.xz
f2fs: add un/freeze_fs into super_operations
This patch supports ioctl FIFREEZE and FITHAW to snapshot filesystem. Before calling f2fs_freeze, all writers would be suspended and sync_fs would be completed. So no f2fs has to do something. Just background gc operation should be skipped due to generate dirty nodes and data until unfreeze. Signed-off-by: Changman Lee <cm224.lee@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r--fs/f2fs/gc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index c386910dacc5..9b5d0aad5daf 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -44,6 +44,11 @@ static int gc_thread_func(void *data)
if (kthread_should_stop())
break;
+ if (sbi->sb->s_writers.frozen >= SB_FREEZE_WRITE) {
+ wait_ms = GC_THREAD_MAX_SLEEP_TIME;
+ continue;
+ }
+
f2fs_balance_fs(sbi);
if (!test_opt(sbi, BG_GC))