summaryrefslogtreecommitdiff
path: root/fs/nfsd/fault_inject.c
diff options
context:
space:
mode:
authorBryan Schumaker <bjschuma@netapp.com>2012-11-29 11:40:43 -0500
committerJ. Bruce Fields <bfields@redhat.com>2012-12-03 09:59:00 -0500
commit8ce54e0d82730ece61737c9fd7b61b28ab8c3390 (patch)
tree7a3cc8c0fea766d99cb93539ed3953b232767fc4 /fs/nfsd/fault_inject.c
parent269de30f10604710dde8d544748b5b6c748b7de8 (diff)
NFSD: Fault injection operations take a per-client forget function
The eventual goal is to forget state based on ip address, so it makes sense to call this function in a for-each-client loop until the correct amount of state is forgotten. I also use this patch as an opportunity to rename the forget function from "func()" to "forget()". Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/fault_inject.c')
-rw-r--r--fs/nfsd/fault_inject.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/nfsd/fault_inject.c b/fs/nfsd/fault_inject.c
index 4b385a14cf96..bf6161adf663 100644
--- a/fs/nfsd/fault_inject.c
+++ b/fs/nfsd/fault_inject.c
@@ -13,29 +13,29 @@
struct nfsd_fault_inject_op {
char *file;
- void (*func)(u64);
+ u64 (*forget)(struct nfs4_client *, u64);
};
static struct nfsd_fault_inject_op inject_ops[] = {
{
.file = "forget_clients",
- .func = nfsd_forget_clients,
+ .forget = nfsd_forget_client,
},
{
.file = "forget_locks",
- .func = nfsd_forget_locks,
+ .forget = nfsd_forget_client_locks,
},
{
.file = "forget_openowners",
- .func = nfsd_forget_openowners,
+ .forget = nfsd_forget_client_openowners,
},
{
.file = "forget_delegations",
- .func = nfsd_forget_delegations,
+ .forget = nfsd_forget_client_delegations,
},
{
.file = "recall_delegations",
- .func = nfsd_recall_delegations,
+ .forget = nfsd_recall_client_delegations,
},
};
@@ -44,6 +44,7 @@ static struct dentry *debug_dir;
static int nfsd_inject_set(void *op_ptr, u64 val)
{
+ u64 count = 0;
struct nfsd_fault_inject_op *op = op_ptr;
if (val == 0)
@@ -52,8 +53,9 @@ static int nfsd_inject_set(void *op_ptr, u64 val)
printk(KERN_INFO "NFSD Fault Injection: %s (n = %llu)", op->file, val);
nfs4_lock_state();
- op->func(val);
+ count = nfsd_for_n_state(val, op->forget);
nfs4_unlock_state();
+ printk(KERN_INFO "NFSD: %s: found %llu", op->file, count);
return 0;
}