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 3/9] NFSD: include "netns.h"
Date: Sun, 12 Jul 2026 16:45:48 -0400 [thread overview]
Message-ID: <20260712204554.125308-4-cel@kernel.org> (raw)
In-Reply-To: <20260712204554.125308-1-cel@kernel.org>
Nothing in fs/nfsd/nfsd.h needs the contents of "netns.h"; the
prototypes there that take a struct nfsd_net pointer need only a
forward declaration of that type. Relocate the existing forward
declaration ahead of the first such prototype, drop the "netns.h"
include from nfsd.h, and include it directly in the translation
units that operate on struct nfsd_net.
"netns.h" had also been the path by which <linux/filelock.h>
reached nfsxdr.c and state.h. Both now include <linux/filelock.h>
themselves.
Signed-off-by: Chuck Lever <cel@kernel.org>
---
fs/nfsd/nfscache.c | 1 +
fs/nfsd/nfsctl.c | 1 +
fs/nfsd/nfsd.h | 6 ++----
fs/nfsd/nfsfh.c | 1 +
fs/nfsd/nfsxdr.c | 2 ++
fs/nfsd/state.h | 3 +++
fs/nfsd/stats.c | 1 +
fs/nfsd/trace.h | 1 +
fs/nfsd/vfs.c | 1 +
9 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index bdf92ec00e7e..07a53a5b3d37 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -19,6 +19,7 @@
#include <net/checksum.h>
#include "nfsd.h"
+#include "netns.h"
#include "stats.h"
#include "cache.h"
#include "trace.h"
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 4de0a8dc7ebe..7e1d5a5d6511 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -23,6 +23,7 @@
#include "idmap.h"
#include "nfsd.h"
+#include "netns.h"
#include "stats.h"
#include "cache.h"
#include "state.h"
diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h
index 0b225eb3ef3f..4583d7d51a88 100644
--- a/fs/nfsd/nfsd.h
+++ b/fs/nfsd/nfsd.h
@@ -40,8 +40,6 @@
#define NFSD_SUPPORTED_MINOR_VERSION 2
bool nfsd_support_version(int vers);
-#include "netns.h"
-
/*
* Default and maximum payload size (NFS READ or WRITE), in bytes.
* The maximum is an implementation limit.
@@ -100,6 +98,8 @@ struct nfsdfs_client {
void (*cl_release)(struct kref *kref);
};
+struct nfsd_net;
+
struct nfsdfs_client *get_nfsdfs_client(struct inode *);
struct dentry *nfsd_client_mkdir(struct nfsd_net *nn,
struct nfsdfs_client *ncl, u32 id,
@@ -125,8 +125,6 @@ extern const struct svc_version nfsd_acl_version3;
extern const struct svc_version localio_version1;
#endif
-struct nfsd_net;
-
enum vers_op {NFSD_SET, NFSD_CLEAR, NFSD_TEST, NFSD_AVAIL };
int nfsd_vers(struct nfsd_net *nn, int vers, enum vers_op change);
int nfsd_minorversion(struct nfsd_net *nn, u32 minorversion, enum vers_op change);
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index c23ae31f60e0..c7c60c35bdfc 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -13,6 +13,7 @@
#include <linux/sunrpc/svcauth_gss.h>
#include <crypto/utils.h>
#include "nfsd.h"
+#include "netns.h"
#include "stats.h"
#include "vfs.h"
#include "auth.h"
diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c
index 86c9dd4b334b..019f0cc971a7 100644
--- a/fs/nfsd/nfsxdr.c
+++ b/fs/nfsd/nfsxdr.c
@@ -5,6 +5,8 @@
* Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
*/
+#include <linux/filelock.h>
+
#include "vfs.h"
#include "xdr.h"
#include "auth.h"
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index bc0181ef1cb6..7255d184b41f 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -36,9 +36,12 @@
#define _NFSD4_STATE_H
#include <crypto/md5.h>
+
+#include <linux/filelock.h>
#include <linux/idr.h>
#include <linux/refcount.h>
#include <linux/sunrpc/svc_xprt.h>
+
#include "nfsfh.h"
#include "nfsd.h"
diff --git a/fs/nfsd/stats.c b/fs/nfsd/stats.c
index d7edbda260f0..9a03e097cfe5 100644
--- a/fs/nfsd/stats.c
+++ b/fs/nfsd/stats.c
@@ -26,6 +26,7 @@
#include <net/net_namespace.h>
#include "nfsd.h"
+#include "netns.h"
#include "stats.h"
static int nfsd_show(struct seq_file *seq, void *v)
diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
index db0a0dc70660..7d7a1483109a 100644
--- a/fs/nfsd/trace.h
+++ b/fs/nfsd/trace.h
@@ -19,6 +19,7 @@
#include "export.h"
#include "nfsfh.h"
#include "xdr4.h"
+#include "netns.h"
#define NFSD_TRACE_PROC_CALL_FIELDS(r) \
__field(unsigned int, netns_ino) \
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 0a1e7bfea3c8..8923a9910a08 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -43,6 +43,7 @@
#endif /* CONFIG_NFSD_V4 */
#include "nfsd.h"
+#include "netns.h"
#include "stats.h"
#include "vfs.h"
#include "filecache.h"
--
2.54.0
next prev parent reply other threads:[~2026-07-12 20:45 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 ` Chuck Lever [this message]
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 ` [PATCH 6/9] NFSD: Move struct readdir_cd Chuck Lever
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-4-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