[PATCH 3/9] NFSD: include "netns.h"

Chuck Lever <[email protected]>
Newsgroups gmane.linux.nfs
Message-ID <[email protected]>
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 <[email protected]>
---
 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 <[email protected]>
  */
 
+#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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.