All of lore.kernel.org
 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 6/9] NFSD: Move struct readdir_cd
Date: Sun, 12 Jul 2026 16:45:51 -0400	[thread overview]
Message-ID: <20260712204554.125308-7-cel@kernel.org> (raw)
In-Reply-To: <20260712204554.125308-1-cel@kernel.org>

struct readdir_cd is part of the VFS readdir API, but it lives in
nfsd.h, the subsystem's catch-all header, rather than alongside that
API. That forces vfs.h to include nfsd.h solely to declare readdir_cd
for its nfsd_readdir() prototype, a layering inversion since vfs.h is
the lower-level shim.

Relocate readdir_cd to vfs.h, just below the nfsd_filldir_t callback
typedef. vfs.h then defines the struct itself and no longer includes
nfsd.h. The xdr headers that embed readdir_cd by value include vfs.h
to obtain the definition. This prepares the ground for dropping nfsd.h
from more files.

Signed-off-by: Chuck Lever <cel@kernel.org>
---
 fs/nfsd/nfsd.h | 4 ----
 fs/nfsd/vfs.h  | 5 ++++-
 fs/nfsd/xdr.h  | 1 +
 fs/nfsd/xdr3.h | 1 +
 fs/nfsd/xdr4.h | 2 +-
 5 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h
index b35e9a9a112d..0503ee0e1bbe 100644
--- a/fs/nfsd/nfsd.h
+++ b/fs/nfsd/nfsd.h
@@ -47,10 +47,6 @@ enum {
 	NFSSVC_MAXBLKSIZE       = RPCSVC_MAXPAYLOAD,
 };
 
-struct readdir_cd {
-	__be32			err;	/* 0, nfserr, or nfserr_eof */
-};
-
 /* Maximum number of operations per session compound */
 #define NFSD_MAX_OPS_PER_COMPOUND	200
 
diff --git a/fs/nfsd/vfs.h b/fs/nfsd/vfs.h
index e09ea04a51b9..4af2ff9e9dfe 100644
--- a/fs/nfsd/vfs.h
+++ b/fs/nfsd/vfs.h
@@ -9,7 +9,6 @@
 #include <linux/fs.h>
 #include <linux/posix_acl.h>
 #include "nfsfh.h"
-#include "nfsd.h"
 
 /*
  * Flags for nfsd_permission
@@ -45,6 +44,10 @@ struct nfsd_file;
  */
 typedef int (*nfsd_filldir_t)(void *, const char *, int, loff_t, u64, unsigned);
 
+struct readdir_cd {
+	__be32			err;	/* nfs_ok, nfserr, or nfserr_eof */
+};
+
 /* nfsd/vfs.c */
 struct nfsd_attrs {
 	struct iattr		*na_iattr;	/* input */
diff --git a/fs/nfsd/xdr.h b/fs/nfsd/xdr.h
index 852f71580bd0..df540c940cef 100644
--- a/fs/nfsd/xdr.h
+++ b/fs/nfsd/xdr.h
@@ -7,6 +7,7 @@
 #include <linux/vfs.h>
 #include "nfsd.h"
 #include "nfsfh.h"
+#include "vfs.h"
 
 struct nfsd_fhandle {
 	struct svc_fh		fh;
diff --git a/fs/nfsd/xdr3.h b/fs/nfsd/xdr3.h
index a7c9714b0b0e..344203874b4c 100644
--- a/fs/nfsd/xdr3.h
+++ b/fs/nfsd/xdr3.h
@@ -9,6 +9,7 @@
 #define _LINUX_NFSD_XDR3_H
 
 #include "xdr.h"
+#include "vfs.h"
 
 struct nfsd3_sattrargs {
 	struct svc_fh		fh;
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h
index 805c7122eb93..0ec0f43b1a87 100644
--- a/fs/nfsd/xdr4.h
+++ b/fs/nfsd/xdr4.h
@@ -38,7 +38,7 @@
 #define _LINUX_NFSD_XDR4_H
 
 #include "state.h"
-#include "nfsd.h"
+#include "vfs.h"
 
 #define NFSD4_MAX_TAGLEN	128
 #define XDR_LEN(n)                     (((n) + 3) & ~3)
-- 
2.54.0


  parent reply	other threads:[~2026-07-12 20:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-12 20:45 [PATCH 0/9] Start reorganizing fs/nfsd/nfsd.h Chuck Lever
2026-07-12 20:45 ` [PATCH 1/9] NFSD: Make "stats.h" self-contained Chuck Lever
2026-07-12 20:45 ` [PATCH 2/9] NFSD: Explicitly include "stats.h" Chuck Lever
2026-07-12 20:45 ` [PATCH 3/9] NFSD: include "netns.h" Chuck Lever
2026-07-12 20:45 ` [PATCH 4/9] NFSD: Remove '#include "nfsd.h"' from fs/nfsd/cache.h Chuck Lever
2026-07-12 20:45 ` [PATCH 5/9] NFSD: Move the export.h include from nfsd.h to auth.c Chuck Lever
2026-07-12 20:45 ` Chuck Lever [this message]
2026-07-12 20:45 ` [PATCH 7/9] NFSD: Relocate nfsd_user_namespace() Chuck Lever
2026-07-12 20:45 ` [PATCH 8/9] NFSD: Relocate nfsd4_set_netaddr() Chuck Lever
2026-07-12 20:45 ` [PATCH 9/9] NFSD: Relocate NFSv4 "supported attributes" to new header 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=20260712204554.125308-7-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.