linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: bfields@fieldses.org
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 06/11] nfsd: break out reclaim record removal into separate function
Date: Mon, 12 Nov 2012 15:00:53 -0500	[thread overview]
Message-ID: <1352750458-16857-7-git-send-email-jlayton@redhat.com> (raw)
In-Reply-To: <1352750458-16857-1-git-send-email-jlayton@redhat.com>

We'll need to be able to call this from nfs4recover.c eventually.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 fs/nfsd/nfs4state.c | 12 +++++++++---
 fs/nfsd/state.h     |  1 +
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 18e5549..24dcda2 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4517,6 +4517,14 @@ nfs4_client_to_reclaim(const char *name)
 }
 
 void
+nfs4_remove_reclaim_record(struct nfs4_client_reclaim *crp)
+{
+	list_del(&crp->cr_strhash);
+	kfree(crp);
+	reclaim_str_hashtbl_size--;
+}
+
+void
 nfs4_release_reclaim(void)
 {
 	struct nfs4_client_reclaim *crp = NULL;
@@ -4526,9 +4534,7 @@ nfs4_release_reclaim(void)
 		while (!list_empty(&reclaim_str_hashtbl[i])) {
 			crp = list_entry(reclaim_str_hashtbl[i].next,
 			                struct nfs4_client_reclaim, cr_strhash);
-			list_del(&crp->cr_strhash);
-			kfree(crp);
-			reclaim_str_hashtbl_size--;
+			nfs4_remove_reclaim_record(crp);
 		}
 	}
 	BUG_ON(reclaim_str_hashtbl_size);
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index c41c280..3528616 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -465,6 +465,7 @@ extern __be32 nfs4_preprocess_stateid_op(struct net *net,
 extern void nfs4_lock_state(void);
 extern void nfs4_unlock_state(void);
 extern int nfs4_in_grace(void);
+void nfs4_remove_reclaim_record(struct nfs4_client_reclaim *);
 extern void nfs4_release_reclaim(void);
 extern struct nfs4_client_reclaim *nfsd4_find_reclaim_client(const char *recdir);
 extern __be32 nfs4_check_open_reclaim(clientid_t *clid, bool sessions);
-- 
1.7.11.7


  parent reply	other threads:[~2012-11-12 20:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-12 20:00 [PATCH 00/11] nfsd: add nfsdcltrack support and limit the use of md5 hashes in nfsdv4 code Jeff Layton
2012-11-12 20:00 ` [PATCH 01/11] nfsd: add a usermodehelper upcall for NFSv4 client ID tracking Jeff Layton
2012-11-12 20:00 ` [PATCH 02/11] nfsd: change heuristic for selecting the client_tracking_ops Jeff Layton
2012-11-12 20:00 ` [PATCH 03/11] nfsd: pass info about the legacy recoverydir in environment variables Jeff Layton
2012-11-12 20:00 ` [PATCH 04/11] nfsd: warn about impending removal of nfsdcld upcall Jeff Layton
2012-11-12 20:00 ` [PATCH 05/11] nfsd: have nfsd4_find_reclaim_client take a char * argument Jeff Layton
2012-11-12 20:00 ` Jeff Layton [this message]
2012-11-12 20:00 ` [PATCH 07/11] nfsd: make nfs4_client_to_reclaim return a pointer to the reclaim record Jeff Layton
2012-11-12 20:00 ` [PATCH 08/11] nfsd: don't search for client by hash on legacy reboot recovery gracedone Jeff Layton
2012-11-12 20:00 ` [PATCH 09/11] nfsd: move the confirmed and unconfirmed hlists to a rbtree Jeff Layton
2012-11-12 20:00 ` [PATCH 10/11] nfsd: get rid of cl_recdir field Jeff Layton
2012-11-12 20:00 ` [PATCH 11/11] nfsd: release the legacy reclaimable clients list in grace_done Jeff Layton
2012-11-12 23:57 ` [PATCH 00/11] nfsd: add nfsdcltrack support and limit the use of md5 hashes in nfsdv4 code J. Bruce Fields

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=1352750458-16857-7-git-send-email-jlayton@redhat.com \
    --to=jlayton@redhat.com \
    --cc=bfields@fieldses.org \
    --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).