linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: " J. Bruce Fields" <bfields@citi.umich.edu>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH v2 2/9] nfsd4: fold release_session into expire_client
Date: Wed, 12 May 2010 00:12:39 +0300	[thread overview]
Message-ID: <1273612359-13488-1-git-send-email-bhalevy@panasas.com> (raw)
In-Reply-To: <4BE9C7A2.8030801@panasas.com>

and grab the client lock once for all the client's sessions.

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
 fs/nfsd/nfs4state.c |   14 ++++----------
 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);
-- 
1.6.5.1


  parent reply	other threads:[~2010-05-11 21:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-11 21:09 [PATCH v2 0/9] nfsd4: keep the client from expiring while in use by nfs41 compounds Benny Halevy
2010-05-11 21:12 ` [PATCH v2 1/9] nfsd4: rename sessionid_lock to client_lock Benny Halevy
2010-05-11 21:12 ` Benny Halevy [this message]
2010-05-11 21:12 ` [PATCH v2 3/9] nfsd4: use list_move in move_to_confirmed Benny Halevy
2010-05-11 21:13 ` [PATCH v2 4/9] nfsd4: extend the client_lock to cover cl_lru Benny Halevy
2010-05-11 21:13 ` [PATCH v2 5/9] nfsd4: refactor expire_client Benny Halevy
2010-05-11 21:13 ` [PATCH v2 6/9] nfsd4: introduce nfs4_client.cl_refcount Benny Halevy
2010-05-11 21:13 ` [PATCH v2 7/9] nfsd4: mark_client_expired Benny Halevy
2010-05-11 21:13 ` [PATCH v2 8/9] nfsd4: keep a reference count on client while in use Benny Halevy
2010-05-12  2:40   `  J. Bruce Fields
2010-05-12  4:26     ` Benny Halevy
2010-05-12  6:19       ` Benny Halevy
2010-05-12 12:26         ` J. Bruce Fields
2010-05-12 22:29         ` J. Bruce Fields
2010-05-12 22:34           ` J. Bruce Fields
2010-05-13 14:36           ` Benny Halevy
2010-05-13 16:11             ` J. Bruce Fields
2010-05-12 12:23       ` J. Bruce Fields
2010-05-11 21:14 ` [PATCH v2 9/9] nfsd4: nfsd4_destroy_session must set callback client under the state lock Benny Halevy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1273612359-13488-1-git-send-email-bhalevy@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=bfields@citi.umich.edu \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).