From: Sheng Yong <shengyong1@huawei.com>
To: jaegeuk@kernel.org, yuchao0@huawei.com
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: [RFC PATCH 2/4] f2fs: introduce f2fs_fault_info for fault injection
Date: Wed, 11 May 2016 17:08:15 +0800 [thread overview]
Message-ID: <1462957697-6900-2-git-send-email-shengyong1@huawei.com> (raw)
In-Reply-To: <1462957697-6900-1-git-send-email-shengyong1@huawei.com>
This patch introduces a new struct f2fs_fault_info and a global f2fs_fault
to save fault injection status.
Signed-off-by: Sheng Yong <shengyong1@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
next prev parent reply other threads:[~2016-05-11 9:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-11 9:08 [RFC PATCH 1/4] f2fs: correct return value type of f2fs_fill_super Sheng Yong
2016-05-11 9:08 ` Sheng Yong [this message]
2016-05-11 9:08 ` [RFC PATCH 3/4] f2fs: add sysfs interfaces for fault injection Sheng Yong
2016-05-11 9:08 ` [RFC PATCH 4/4] f2fs: move fault injection to sysfs Sheng Yong
2016-05-12 3:45 ` [RFC PATCH v2 " Sheng Yong
2016-05-12 20:12 ` Jaegeuk Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1462957697-6900-2-git-send-email-shengyong1@huawei.com \
--to=shengyong1@huawei.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=yuchao0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).