diff options
author | Jeff Layton <jlayton@primarydata.com> | 2014-07-30 08:27:18 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-08-05 10:55:04 -0400 |
commit | a0926d15271a0139606d54d0521c527746e2815b (patch) | |
tree | a4f0b952e2433fe3c505f7136c63d63934b396d9 /fs/nfsd/nfs4state.c | |
parent | 7ec0e36f1a35c9c241726f6639178fafda654e09 (diff) | |
download | lwn-a0926d15271a0139606d54d0521c527746e2815b.tar.gz lwn-a0926d15271a0139606d54d0521c527746e2815b.zip |
nfsd: add a forget_client set_clnt routine
...that relies on the client_lock instead of client_mutex.
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 2225e1103742..c4c28f8f48a1 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -5760,6 +5760,34 @@ u64 nfsd_forget_client(struct nfs4_client *clp, u64 max) return 1; } +u64 +nfsd_inject_forget_client(struct nfsd_fault_inject_op *op, + struct sockaddr_storage *addr, size_t addr_size) +{ + u64 count = 0; + struct nfs4_client *clp; + struct nfsd_net *nn = net_generic(current->nsproxy->net_ns, + nfsd_net_id); + + if (!nfsd_netns_ready(nn)) + return count; + + spin_lock(&nn->client_lock); + clp = nfsd_find_client(addr, addr_size); + if (clp) { + if (mark_client_expired_locked(clp) == nfs_ok) + ++count; + else + clp = NULL; + } + spin_unlock(&nn->client_lock); + + if (clp) + expire_client(clp); + + return count; +} + static void nfsd_print_count(struct nfs4_client *clp, unsigned int count, const char *type) { |