[PATCH 0/2] NFSD: Decouple the write path from NFSv3 XDR constants
Chuck Lever <[email protected]> Thu, 23 Jul 2026 14:20:41 -0400
| Newsgroups | org.kernel.vger.linux-nfs |
|---|---|
| Message-ID | <[email protected]> |
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