This patch introduces a new struct f2fs_fault_info and a global f2fs_fault
to save fault injection status.

Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
 fs/f2fs/f2fs.h  | 12 ++++++++++++
 fs/f2fs/super.c |  1 +
 2 files changed, 13 insertions(+)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 052f5a8..e18390b 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -48,6 +48,18 @@ enum {
        FAULT_MAX,
 };
 
+struct f2fs_fault_info {
+       unsigned int inject_rate;
+       atomic_t inject_ops;
+       unsigned int inject_kmalloc;
+       unsigned int inject_page_alloc;
+       unsigned int inject_nid_alloc;
+       unsigned int inject_orphan;
+       unsigned int inject_block;
+       unsigned int inject_dir_depth;
+};
+
+extern struct f2fs_fault_info f2fs_fault;
 extern u32 f2fs_fault_rate;
 extern atomic_t f2fs_ops;
 extern char *fault_name[FAULT_MAX];
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 0e54e84..069dc44 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -40,6 +40,7 @@ static struct kmem_cache *f2fs_inode_cachep;
 static struct kset *f2fs_kset;
 
 #ifdef CONFIG_F2FS_FAULT_INJECTION
+struct f2fs_fault_info f2fs_fault;
 u32 f2fs_fault_rate = 0;
 atomic_t f2fs_ops;
 
-- 
2.7.1


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to