aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-10-07 12:46:37 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2015-10-12 16:37:54 -0400
commitc912a8298c16ef15aa2b7203022c935f439f488b (patch)
tree728add7743e88aaea7571acbf3e3699b4b8921ee /fs
parent6066d8cdb6dd0fd51ccd96027f6ae8e6b3b5adff (diff)
f2fs: add F2FS_GOING_DOWN_METAFLUSH to test power-failure
This patch introduces F2FS_GOING_DOWN_METAFLUSH which flushes meta pages like SSA blocks and then blocks all the writes. This can be used by power-failure tests. Reviewed-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/f2fs.h1
-rw-r--r--fs/f2fs/file.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index aad4720c516e..f05ae22558e2 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -250,6 +250,7 @@ static inline bool __has_cursum_space(struct f2fs_summary_block *sum, int size,
250#define F2FS_GOING_DOWN_FULLSYNC 0x0 /* going down with full sync */ 250#define F2FS_GOING_DOWN_FULLSYNC 0x0 /* going down with full sync */
251#define F2FS_GOING_DOWN_METASYNC 0x1 /* going down with metadata */ 251#define F2FS_GOING_DOWN_METASYNC 0x1 /* going down with metadata */
252#define F2FS_GOING_DOWN_NOSYNC 0x2 /* going down */ 252#define F2FS_GOING_DOWN_NOSYNC 0x2 /* going down */
253#define F2FS_GOING_DOWN_METAFLUSH 0x3 /* going down with meta flush */
253 254
254#if defined(__KERNEL__) && defined(CONFIG_COMPAT) 255#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
255/* 256/*
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index b3985a680521..6d3cfd55c3e4 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1498,6 +1498,10 @@ static int f2fs_ioc_shutdown(struct file *filp, unsigned long arg)
1498 case F2FS_GOING_DOWN_NOSYNC: 1498 case F2FS_GOING_DOWN_NOSYNC:
1499 f2fs_stop_checkpoint(sbi); 1499 f2fs_stop_checkpoint(sbi);
1500 break; 1500 break;
1501 case F2FS_GOING_DOWN_METAFLUSH:
1502 sync_meta_pages(sbi, META, LONG_MAX);
1503 f2fs_stop_checkpoint(sbi);
1504 break;
1501 default: 1505 default:
1502 return -EINVAL; 1506 return -EINVAL;
1503 } 1507 }