aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorBryan Schumaker <bjschuma@netapp.com>2012-11-29 11:40:46 -0500
committerJ. Bruce Fields <bfields@redhat.com>2012-12-03 09:59:03 -0500
commit6c1e82a4b74ad0c8b45c833a4409f153199d9be4 (patch)
tree10734030e4b308f16680de6f54db3af76ecca8b3 /fs/nfsd/nfs4state.c
parentd7cc431edd0a6c69a88b5ff1e304af50bfb2270e (diff)
NFSD: Forget state for a specific client
Write the client's ip address to any state file and all appropriate state for that client will be forgotten. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 9fb8e52580f3..eff734033437 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4763,6 +4763,21 @@ u64 nfsd_for_n_state(u64 max, u64 (*func)(struct nfs4_client *, u64))
4763 return count; 4763 return count;
4764} 4764}
4765 4765
4766struct nfs4_client *nfsd_find_client(struct sockaddr_storage *addr, size_t addr_size)
4767{
4768 struct nfs4_client *clp;
4769 struct nfsd_net *nn = net_generic(current->nsproxy->net_ns, nfsd_net_id);
4770
4771 if (!nfsd_netns_ready(nn))
4772 return NULL;
4773
4774 list_for_each_entry(clp, &nn->client_lru, cl_lru) {
4775 if (memcmp(&clp->cl_addr, addr, addr_size) == 0)
4776 return clp;
4777 }
4778 return NULL;
4779}
4780
4766#endif /* CONFIG_NFSD_FAULT_INJECTION */ 4781#endif /* CONFIG_NFSD_FAULT_INJECTION */
4767 4782
4768/* initialization to perform at module load time: */ 4783/* initialization to perform at module load time: */