Linux NFS development
 help / color / mirror / Atom feed
From: Dai Ngo <dai.ngo@oracle.com>
To: chuck.lever@oracle.com, jlayton@kernel.org, neilb@ownmail.net,
	okorniev@redhat.com, tom@talpey.com, hch@lst.de
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 1/3] NFSD: Move clientid_hashval and same_clid to header files
Date: Mon, 15 Dec 2025 10:13:33 -0800	[thread overview]
Message-ID: <20251215181418.2201035-2-dai.ngo@oracle.com> (raw)
In-Reply-To: <20251215181418.2201035-1-dai.ngo@oracle.com>

As preparation for introducing infrastructure to track SCSI fencing events,
relocate the clientid_hashval function from nfs4state.c to nfsd.h and the
same_clid function from nfs4state.c to state.h.

No functional changes are introduced in this commit—only movement of code
to improve accessibility for forthcoming enhancements.

Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
---
 fs/nfsd/nfs4state.c | 15 ---------------
 fs/nfsd/nfsd.h      |  5 +++++
 fs/nfsd/state.h     |  5 +++++
 3 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 35004568d43e..13b4dc89b1e8 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1423,15 +1423,6 @@ static void revoke_delegation(struct nfs4_delegation *dp)
 	destroy_unhashed_deleg(dp);
 }
 
-/*
- * SETCLIENTID state
- */
-
-static unsigned int clientid_hashval(u32 id)
-{
-	return id & CLIENT_HASH_MASK;
-}
-
 static unsigned int clientstr_hashval(struct xdr_netobj name)
 {
 	return opaque_hashval(name.data, 8) & CLIENT_HASH_MASK;
@@ -2621,12 +2612,6 @@ same_verf(nfs4_verifier *v1, nfs4_verifier *v2)
 	return 0 == memcmp(v1->data, v2->data, sizeof(v1->data));
 }
 
-static int
-same_clid(clientid_t *cl1, clientid_t *cl2)
-{
-	return (cl1->cl_boot == cl2->cl_boot) && (cl1->cl_id == cl2->cl_id);
-}
-
 static bool groups_equal(struct group_info *g1, struct group_info *g2)
 {
 	int i;
diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h
index 50be785f1d2c..369efe6ed665 100644
--- a/fs/nfsd/nfsd.h
+++ b/fs/nfsd/nfsd.h
@@ -510,6 +510,11 @@ static inline bool nfsd_attrs_supported(u32 minorversion, const u32 *bmval)
 	return bmval_is_subset(bmval, nfsd_suppattrs[minorversion]);
 }
 
+static inline unsigned int clientid_hashval(u32 id)
+{
+	return id & CLIENT_HASH_MASK;
+}
+
 /* These will return ERR_INVAL if specified in GETATTR or READDIR. */
 #define NFSD_WRITEONLY_ATTRS_WORD1 \
 	(FATTR4_WORD1_TIME_ACCESS_SET   | FATTR4_WORD1_TIME_MODIFY_SET)
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index 1e736f402426..b737e8cfe6d5 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -865,6 +865,11 @@ static inline bool try_to_expire_client(struct nfs4_client *clp)
 	return clp->cl_state == NFSD4_EXPIRABLE;
 }
 
+static inline int same_clid(clientid_t *cl1, clientid_t *cl2)
+{
+	return (cl1->cl_boot == cl2->cl_boot) && (cl1->cl_id == cl2->cl_id);
+}
+
 extern __be32 nfsd4_deleg_getattr_conflict(struct svc_rqst *rqstp,
 		struct dentry *dentry, struct nfs4_delegation **pdp);
 #endif   /* NFSD4_STATE_H */
-- 
2.47.3


  reply	other threads:[~2025-12-15 18:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-15 18:13 [PATCH 0/3] NFSD: Prevent dupplicate SCSI fencing operation Dai Ngo
2025-12-15 18:13 ` Dai Ngo [this message]
2025-12-15 18:58   ` [PATCH 1/3] NFSD: Move clientid_hashval and same_clid to header files Chuck Lever
2025-12-15 20:50     ` Dai Ngo
2025-12-18  9:25     ` Christoph Hellwig
2025-12-18 19:40       ` Dai Ngo
2025-12-15 18:13 ` [PATCH 2/3] NFSD: Add infrastructure for tracking persistent SCSI registration keys Dai Ngo
2025-12-18  9:34   ` Christoph Hellwig
2025-12-18 16:00     ` Chuck Lever
2025-12-18 19:44       ` Dai Ngo
2025-12-19  5:24       ` Christoph Hellwig
2025-12-19 13:40         ` Chuck Lever
2025-12-18 19:40     ` Dai Ngo
2025-12-15 18:13 ` [PATCH 3/3] NFSD: Prevent redundant SCSI fencing operations Dai Ngo
2025-12-18  9:34   ` Christoph Hellwig
2025-12-18 19:41     ` Dai Ngo

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=20251215181418.2201035-2-dai.ngo@oracle.com \
    --to=dai.ngo@oracle.com \
    --cc=chuck.lever@oracle.com \
    --cc=hch@lst.de \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@ownmail.net \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    /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