From: cel@kernel.org
To: Neil Brown <neilb@suse.de>, Jeff Layton <jlayton@kernel.org>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: <linux-nfs@vger.kernel.org>, Chuck Lever <chuck.lever@oracle.com>
Subject: [RFC PATCH 1/3] NFSD: Record call's slot index
Date: Fri, 14 Feb 2025 10:57:44 -0500 [thread overview]
Message-ID: <20250214155746.18016-2-cel@kernel.org> (raw)
In-Reply-To: <20250214155746.18016-1-cel@kernel.org>
From: Chuck Lever <chuck.lever@oracle.com>
The slot index number of the current COMPOUND has, until now, not
been needed outside of nfsd4_sequence(). But to record the tuple
that represents the referring call, the slot number will be
needed when processing subsequent operations in the COMPOUND.
I've brute-forced this by adding a field to nfsd4_compound_state,
but there's probably a way to add the index to nfsd4_slot. I'm just
not sure yet whether slot table resizing might change the index that
a struct nfsd4_slot represents.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
fs/nfsd/nfs4proc.c | 1 +
fs/nfsd/nfs4state.c | 1 +
fs/nfsd/xdr4.h | 1 +
3 files changed, 3 insertions(+)
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 23052fa0e8bf..d09a96cbec1e 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -2792,6 +2792,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp)
resp->xdr = &rqstp->rq_res_stream;
resp->statusp = resp->xdr->p;
+ cstate->slot_idx = -1;
/* reserve space for: NFS status code */
xdr_reserve_space(resp->xdr, XDR_UNIT);
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index b7a0cfd05401..c38601c9bf13 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4415,6 +4415,7 @@ nfsd4_sequence(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
else
slot->sl_flags &= ~NFSD4_SLOT_CACHETHIS;
+ cstate->slot_idx = seq->slotid;
cstate->slot = slot;
cstate->session = session;
cstate->clp = clp;
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h
index c26ba86dbdfd..561894ff4b01 100644
--- a/fs/nfsd/xdr4.h
+++ b/fs/nfsd/xdr4.h
@@ -186,6 +186,7 @@ struct nfsd4_compound_state {
/* For sessions DRC */
struct nfsd4_session *session;
struct nfsd4_slot *slot;
+ int slot_idx;
int data_offset;
bool spo_must_allowed;
size_t iovlen;
--
2.47.0
next prev parent reply other threads:[~2025-02-14 15:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-14 15:57 [RFC PATCH 0/3] Implement referring call lists for CB_OFFLOAD cel
2025-02-14 15:57 ` cel [this message]
2025-02-14 18:26 ` [RFC PATCH 1/3] NFSD: Record call's slot index Jeff Layton
2025-02-14 15:57 ` [RFC PATCH 2/3] NFSD: Implement CB_SEQUENCE referring call lists cel
2025-02-14 15:57 ` [RFC PATCH 3/3] NFSD: Use a referring call list for CB_OFFLOAD cel
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=20250214155746.18016-2-cel@kernel.org \
--to=cel@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=dai.ngo@oracle.com \
--cc=jlayton@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--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