summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorBenny Halevy <bhalevy@panasas.com>2010-05-12 00:12:39 +0300
committerJ. Bruce Fields <bfields@citi.umich.edu>2010-05-11 21:02:01 -0400
commitbe1fdf6c4386f56271d2f690b93ef686b769587c (patch)
tree2c49c5af57912ed20967b6ad35cde915c6b4cc81 /fs
parent9089f1b4782ff52835059779fd37b7ad765a25c7 (diff)
downloadop-kernel-dev-be1fdf6c4386f56271d2f690b93ef686b769587c.zip
op-kernel-dev-be1fdf6c4386f56271d2f690b93ef686b769587c.tar.gz
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>
Diffstat (limited to 'fs')
-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 2313dbf..f8bf619 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -613,15 +613,6 @@ unhash_session(struct nfsd4_session *ses)
list_del(&ses->se_perclnt);
}
-static void
-release_session(struct nfsd4_session *ses)
-{
- spin_lock(&client_lock);
- unhash_session(ses);
- spin_unlock(&client_lock);
- nfsd4_put_session(ses);
-}
-
void
free_session(struct kref *kref)
{
@@ -722,12 +713,15 @@ expire_client(struct nfs4_client *clp)
sop = list_entry(clp->cl_openowners.next, struct nfs4_stateowner, so_perclient);
release_openowner(sop);
}
+ spin_lock(&client_lock);
while (!list_empty(&clp->cl_sessions)) {
struct nfsd4_session *ses;
ses = list_entry(clp->cl_sessions.next, struct nfsd4_session,
se_perclnt);
- release_session(ses);
+ unhash_session(ses);
+ nfsd4_put_session(ses);
}
+ spin_unlock(&client_lock);
nfsd4_set_callback_client(clp, NULL);
if (clp->cl_cb_conn.cb_xprt)
svc_xprt_put(clp->cl_cb_conn.cb_xprt);
OpenPOWER on IntegriCloud