aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2005-01-04 05:50:16 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-04 05:50:16 -0800
commit7d47a605fbb6f650fd1774afd32c95ada4052eae (patch)
tree9dd8efd3c4b9db71784a1aa9b7e97ce0f12251f7 /fs
parentea7b53a314e865dd420093a5ef62aabc94267afb (diff)
downloadhistory-7d47a605fbb6f650fd1774afd32c95ada4052eae.tar.gz
[PATCH] knfsd: changes to expire_client
... to shutdown the rpc callback client and remove all client associated delegations Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfs4state.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 40060c016eaa0e..dbb470b2bba3f9 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -335,8 +335,29 @@ static void
expire_client(struct nfs4_client *clp)
{
struct nfs4_stateowner *sop;
+ struct nfs4_delegation *dp;
+ struct nfs4_callback *cb = &clp->cl_callback;
+ struct rpc_clnt *clnt = clp->cl_callback.cb_client;
- dprintk("NFSD: expire_client cl_count %d\n",atomic_read(&clp->cl_count));
+ dprintk("NFSD: expire_client cl_count %d\n",
+ atomic_read(&clp->cl_count));
+
+ /* shutdown rpc client, ending any outstanding recall rpcs */
+ if (atomic_read(&cb->cb_set) == 1 && clnt) {
+ rpc_shutdown_client(clnt);
+ clnt = clp->cl_callback.cb_client = NULL;
+ }
+ spin_lock(&recall_lock);
+ while (!list_empty(&clp->cl_del_perclnt)) {
+ dp = list_entry(clp->cl_del_perclnt.next, struct nfs4_delegation, dl_del_perclnt);
+ dprintk("NFSD: expire client. dp %p, dl_state %d, fp %p\n",
+ dp, atomic_read(&dp->dl_state), dp->dl_flock);
+
+ /* force release of delegation. */
+ atomic_set(&dp->dl_state, NFS4_RECALL_COMPLETE);
+ release_delegation(dp);
+ }
+ spin_unlock(&recall_lock);
list_del(&clp->cl_idhash);
list_del(&clp->cl_strhash);
list_del(&clp->cl_lru);