Linux NFS development
 help / color / mirror / Atom feed
From: Chuck Lever <cel@kernel.org>
To: NeilBrown <neil@brown.name>, 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>
Subject: [PATCH 0/2] NFSD: Decouple the write path from NFSv3 XDR constants
Date: Thu, 23 Jul 2026 14:20:41 -0400	[thread overview]
Message-ID: <20260723182043.990391-1-cel@kernel.org> (raw)

NFSD's internal write helpers are meant to be NFS-version-agnostic,
yet nfsd_write() has taken an NFSv3 stable_how value lifted straight
off the wire, and the NFSv4 WRITE and COPY paths borrow those same
NFSv3 constants for their own stable values, correct only because
stable_how and stable_how4 happen to share numeric values. That
coincidence is the debt: it binds version-neutral VFS helpers to one
protocol version's XDR and leaves NFSv4 depending on nfs3.h.

To remove the API's dependence on version-specific wire protocol,
change the generic VFS helpers to take IOCB flags instead of a
stable_how value. This removes a dependency on the nfs3.h header
in code that is not related to NFSv3.

Chuck Lever (2):
  NFS: Move definition of enum nfs3_stable_how
  NFSD: Replace nfsd_write()'s "stable" argument with "iocb_flags"

 fs/nfsd/nfs3proc.c       | 17 ++++++++++++++++-
 fs/nfsd/nfs3xdr.c        |  2 ++
 fs/nfsd/nfs4proc.c       | 18 ++++++++++++++++--
 fs/nfsd/nfs4xdr.c        |  2 +-
 fs/nfsd/nfsproc.c        |  2 +-
 fs/nfsd/vfs.c            | 30 ++++++++++--------------------
 fs/nfsd/vfs.h            |  6 ++++--
 fs/nfsd/xdr3.h           |  2 +-
 include/linux/nfs.h      |  9 ---------
 include/linux/nfs3.h     |  8 ++++++++
 include/linux/nfs4.h     |  6 ++++++
 include/trace/misc/nfs.h |  1 +
 12 files changed, 66 insertions(+), 37 deletions(-)

-- 
2.54.0


             reply	other threads:[~2026-07-23 18:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23 18:20 Chuck Lever [this message]
2026-07-23 18:20 ` [PATCH 1/2] NFS: Move definition of enum nfs3_stable_how Chuck Lever
2026-07-23 18:20 ` [PATCH 2/2] NFSD: Replace nfsd_write()'s "stable" argument with "iocb_flags" Chuck Lever

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=20260723182043.990391-1-cel@kernel.org \
    --to=cel@kernel.org \
    --cc=dai.ngo@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --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