aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenny Halevy <bhalevy@panasas.com>2010-05-11 17:12:39 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2010-05-11 21:02:01 -0400
commitbe1fdf6c4386f56271d2f690b93ef686b769587c (patch)
tree2c49c5af57912ed20967b6ad35cde915c6b4cc81
parent9089f1b4782ff52835059779fd37b7ad765a25c7 (diff)
nfsd4: fold release_session into expire_client
and grab the client lock once for all the client's sessions. Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
-rw-r--r--fs/nfsd/nfs4state.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 2313dbf086bd..f8bf6190a5d3 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -613,15 +613,6 @@ unhash_session(struct nfsd4_session *ses)
613 list_del(&ses->se_perclnt); 613 list_del(&ses->se_perclnt);
614} 614}
615 615
616static void
617release_session(struct nfsd4_session *ses)
618{
619 spin_lock(&client_lock);
620 unhash_session(ses);
621 spin_unlock(&client_lock);
622 nfsd4_put_session(ses);
623}
624
625void 616void
626free_session(struct kref *kref) 617free_session(struct kref *kref)
627{ 618{
@@ -722,12 +713,15 @@ expire_client(struct nfs4_client *clp)
722 sop = list_entry(clp->cl_openowners.next, struct nfs4_stateowner, so_perclient); 713 sop = list_entry(clp->cl_openowners.next, struct nfs4_stateowner, so_perclient);
723 release_openowner(sop); 714 release_openowner(sop);
724 } 715 }
716 spin_lock(&client_lock);
725 while (!list_empty(&clp->cl_sessions)) { 717 while (!list_empty(&clp->cl_sessions)) {
726 struct nfsd4_session *ses; 718 struct nfsd4_session *ses;
727 ses = list_entry(clp->cl_sessions.next, struct nfsd4_session, 719 ses = list_entry(clp->cl_sessions.next, struct nfsd4_session,
728 se_perclnt); 720 se_perclnt);
729 release_session(ses); 721 unhash_session(ses);
722 nfsd4_put_session(ses);
730 } 723 }
724 spin_unlock(&client_lock);
731 nfsd4_set_callback_client(clp, NULL); 725 nfsd4_set_callback_client(clp, NULL);
732 if (clp->cl_cb_conn.cb_xprt) 726 if (clp->cl_cb_conn.cb_xprt)
733 svc_xprt_put(clp->cl_cb_conn.cb_xprt); 727 svc_xprt_put(clp->cl_cb_conn.cb_xprt);