diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2012-11-29 11:40:44 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-12-03 09:59:01 -0500 |
commit | 184c18471f7d0963ad5752692c4b441a546d88f1 (patch) | |
tree | 92dc8d2d5d7104888055741b6c2c6fca67795b05 /fs/nfsd/fault_inject.c | |
parent | 8ce54e0d82730ece61737c9fd7b61b28ab8c3390 (diff) | |
download | linux-next-184c18471f7d0963ad5752692c4b441a546d88f1.tar.gz |
NFSD: Reading a fault injection file prints a state count
I also log basic information that I can figure out about the type of
state (such as number of locks for each client IP address). This can be
useful for checking that state was actually dropped and later for
checking if the client was able to recover.
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.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/nfsd/fault_inject.c b/fs/nfsd/fault_inject.c index bf6161adf663..545f8e4ed101 100644 --- a/fs/nfsd/fault_inject.c +++ b/fs/nfsd/fault_inject.c @@ -14,28 +14,34 @@ struct nfsd_fault_inject_op { char *file; u64 (*forget)(struct nfs4_client *, u64); + u64 (*print)(struct nfs4_client *, u64); }; static struct nfsd_fault_inject_op inject_ops[] = { { .file = "forget_clients", .forget = nfsd_forget_client, + .print = nfsd_print_client, }, { .file = "forget_locks", .forget = nfsd_forget_client_locks, + .print = nfsd_print_client_locks, }, { .file = "forget_openowners", .forget = nfsd_forget_client_openowners, + .print = nfsd_print_client_openowners, }, { .file = "forget_delegations", .forget = nfsd_forget_client_delegations, + .print = nfsd_print_client_delegations, }, { .file = "recall_delegations", .forget = nfsd_recall_client_delegations, + .print = nfsd_print_client_delegations, }, }; @@ -59,9 +65,12 @@ static int nfsd_inject_set(void *op_ptr, u64 val) return 0; } -static int nfsd_inject_get(void *data, u64 *val) +static int nfsd_inject_get(void *op_ptr, u64 *val) { - *val = 0; + struct nfsd_fault_inject_op *op = op_ptr; + nfs4_lock_state(); + *val = nfsd_for_n_state(0, op->print); + nfs4_unlock_state(); return 0; } |