diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-01-29 19:45:33 (GMT) |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-02-12 01:04:41 (GMT) |
commit | 119ee9144534141822462e3e8a5ccc8dc537f712 (patch) | |
tree | d1db8598f68e80459d40343d70883a62606de7d5 /fs/f2fs/super.c | |
parent | 11504a8e7e20e2ff2e68176850e9b83b8bae760e (diff) | |
download | linux-119ee9144534141822462e3e8a5ccc8dc537f712.tar.xz |
f2fs: split UMOUNT and FASTBOOT flags
This patch adds FASTBOOT flag into checkpoint as follows.
- CP_UMOUNT_FLAG is set when system is umounted.
- CP_FASTBOOT_FLAG is set when intermediate checkpoint having node summaries
was done.
So, if you get CP_UMOUNT_FLAG from checkpoint, the system was umounted cleanly.
Instead, if there was sudden-power-off, you can get CP_FASTBOOT_FLAG or nothing.
Reviewed-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r-- | fs/f2fs/super.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 06d903b..bfeab3c 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -500,9 +500,8 @@ int f2fs_sync_fs(struct super_block *sb, int sync) if (sync) { struct cp_control cpc; - cpc.reason = (test_opt(sbi, FASTBOOT) || - is_sbi_flag_set(sbi, SBI_IS_CLOSE)) ? - CP_UMOUNT : CP_SYNC; + cpc.reason = __get_cp_reason(sbi); + mutex_lock(&sbi->gc_mutex); write_checkpoint(sbi, &cpc); mutex_unlock(&sbi->gc_mutex); |