All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET 0-6] nfsd: #includes cleanup
@ 2009-11-23 15:54 ` Boaz Harrosh
  0 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-23 15:54 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, Trond Myklebust, Andrew Morton, pNFS
  Cc: NFS list, linux-fsdevel, Randy Dunlap


Hi Bruce

This time I've based the patchset on the:
	git://linux-nfs.org/~bfields/linux.git for-2.6.33 branch

I was hoping to find that nfsd.h cleanup you sent to the mailing list
the other day. But I don't see it. Should I rebase this work on some
other branch? would you like to submit that patch, which made lots of
sense in my opinion, and I'll wait and base this work on that?
[On the other we might be able to move the complete nfsd.h to fs/nfsd/]

I have gone deeper and wider this time. And it is based on upcoming
main-line, not pnfs tree like before. So it can actually be applied
this time. Please lets decide on some time table because these things
are moving targets.

I've removed the hunk from posix_acl.h that Trond did not like, I'll
take care of that one, another time. (For late comers, posix_acl.h intimately
fiddles with fs.h types but does not #include it)

With these patches Benny will suffer on his next rebase, both in conflicts
and a few miss-compiling files, but it should be trivial to fix, I'll help.

The next step after these patches, is to move lots of files from include/linux/nfsd/*
to fs/nfsd/... I have found that the include/linux/nfsd/xdr?.h, nfsd.h and cache.h
are all essentially only used by fs/nfsd source, except they are *wrongly* included by
some compat.c source files. Once I'll fix that they can move.

[PATCH 1/6] nfsd: Remove nfsfh.h dependency on sunrpc
    Bruce, what about this patch. It is independent of the others. Currently sunrpc
    is loaded/unloaded with nfs or nfsd. exportfs and filesystems don't expect to need
    it. It works because depmod is doing it's job. Do we really need this dprintk?

[PATCH 2/6] sunrpc: Clean never used include files
[PATCH 3/6] nfsd: Fix independence of a few nfsd related headers
    I wish these two patches could go through Bruce's tree as one group.
    Who's ACKs do we need on them? Trond?

[PATCH 4/6] nfsd: Headers Independence and include cleanups
[PATCH 5/6] nfsd: Source files #include cleanups
    Please review these patches to understand the motivation behind all
    this.

[PATCH 6/6] compat.c: Remove dependence on nfsd private headers
    This patch is a beginning of the next step to move the nfsd private
    headers to inside the fs/nfsd subdirectory.

Thanks
Boaz

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCHSET 0-6] nfsd: #includes cleanup
@ 2009-11-23 15:54 ` Boaz Harrosh
  0 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-23 15:54 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, Trond Myklebust, Andrew Morton, pNFS
  Cc: NFS list, linux-fsdevel, Randy Dunlap


Hi Bruce

This time I've based the patchset on the:
	git://linux-nfs.org/~bfields/linux.git for-2.6.33 branch

I was hoping to find that nfsd.h cleanup you sent to the mailing list
the other day. But I don't see it. Should I rebase this work on some
other branch? would you like to submit that patch, which made lots of
sense in my opinion, and I'll wait and base this work on that?
[On the other we might be able to move the complete nfsd.h to fs/nfsd/]

I have gone deeper and wider this time. And it is based on upcoming
main-line, not pnfs tree like before. So it can actually be applied
this time. Please lets decide on some time table because these things
are moving targets.

I've removed the hunk from posix_acl.h that Trond did not like, I'll
take care of that one, another time. (For late comers, posix_acl.h intimately
fiddles with fs.h types but does not #include it)

With these patches Benny will suffer on his next rebase, both in conflicts
and a few miss-compiling files, but it should be trivial to fix, I'll help.

The next step after these patches, is to move lots of files from include/linux/nfsd/*
to fs/nfsd/... I have found that the include/linux/nfsd/xdr?.h, nfsd.h and cache.h
are all essentially only used by fs/nfsd source, except they are *wrongly* included by
some compat.c source files. Once I'll fix that they can move.

[PATCH 1/6] nfsd: Remove nfsfh.h dependency on sunrpc
    Bruce, what about this patch. It is independent of the others. Currently sunrpc
    is loaded/unloaded with nfs or nfsd. exportfs and filesystems don't expect to need
    it. It works because depmod is doing it's job. Do we really need this dprintk?

[PATCH 2/6] sunrpc: Clean never used include files
[PATCH 3/6] nfsd: Fix independence of a few nfsd related headers
    I wish these two patches could go through Bruce's tree as one group.
    Who's ACKs do we need on them? Trond?

[PATCH 4/6] nfsd: Headers Independence and include cleanups
[PATCH 5/6] nfsd: Source files #include cleanups
    Please review these patches to understand the motivation behind all
    this.

[PATCH 6/6] compat.c: Remove dependence on nfsd private headers
    This patch is a beginning of the next step to move the nfsd private
    headers to inside the fs/nfsd subdirectory.

Thanks
Boaz


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 1/6] nfsd: Remove nfsfh.h dependency on sunrpc
  2009-11-23 15:54 ` Boaz Harrosh
@ 2009-11-23 15:58     ` Boaz Harrosh
  -1 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-23 15:58 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, NFS list, pNFS Mailing List,
	Trond Myklebust
  Cc: linux-fsdevel, Al Viro, Randy Dunlap

linux/nfsd/nfsfh.h defines some low level types which
are needed by exportfs and though by filesystems.

In the file, fh_lock() uses the sunrpc dprint facility which
might cause a dependency of exportfs (and filesystems) on
sunrpc which is unwanted / unexpected.

Remove the debug-print from fh_lock() and avoid this dependency.

Signed-off-by: Boaz Harrosh <bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
---
 include/linux/nfsd/nfsfh.h |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index 8f641c9..2973e11 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -20,7 +20,6 @@
 # include <linux/fs.h>
 #endif
 #include <linux/nfsd/const.h>
-#include <linux/nfsd/debug.h>
 
 /*
  * This is the old "dentry style" Linux NFSv2 file handle.
@@ -329,9 +328,6 @@ fh_lock_nested(struct svc_fh *fhp, unsigned int subclass)
 	struct dentry	*dentry = fhp->fh_dentry;
 	struct inode	*inode;
 
-	dfprintk(FILEOP, "nfsd: fh_lock(%s) locked = %d\n",
-			SVCFH_fmt(fhp), fhp->fh_locked);
-
 	BUG_ON(!dentry);
 
 	if (fhp->fh_locked) {
-- 
1.6.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 1/6] nfsd: Remove nfsfh.h dependency on sunrpc
@ 2009-11-23 15:58     ` Boaz Harrosh
  0 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-23 15:58 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, NFS list, pNFS Mailing List,
	Trond Myklebust
  Cc: linux-fsdevel, Al Viro, Randy Dunlap

linux/nfsd/nfsfh.h defines some low level types which
are needed by exportfs and though by filesystems.

In the file, fh_lock() uses the sunrpc dprint facility which
might cause a dependency of exportfs (and filesystems) on
sunrpc which is unwanted / unexpected.

Remove the debug-print from fh_lock() and avoid this dependency.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 include/linux/nfsd/nfsfh.h |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index 8f641c9..2973e11 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -20,7 +20,6 @@
 # include <linux/fs.h>
 #endif
 #include <linux/nfsd/const.h>
-#include <linux/nfsd/debug.h>
 
 /*
  * This is the old "dentry style" Linux NFSv2 file handle.
@@ -329,9 +328,6 @@ fh_lock_nested(struct svc_fh *fhp, unsigned int subclass)
 	struct dentry	*dentry = fhp->fh_dentry;
 	struct inode	*inode;
 
-	dfprintk(FILEOP, "nfsd: fh_lock(%s) locked = %d\n",
-			SVCFH_fmt(fhp), fhp->fh_locked);
-
 	BUG_ON(!dentry);
 
 	if (fhp->fh_locked) {
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 2/6] sunrpc: Clean never used include files
  2009-11-23 15:54 ` Boaz Harrosh
@ 2009-11-23 15:58     ` Boaz Harrosh
  -1 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-23 15:58 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, NFS list, pNFS Mailing List,
	Trond Myklebust
  Cc: linux-fsdevel, Al Viro, Randy Dunlap

Remove include of two headers never used by this file.
Doing so exposed a missing #include <linux/types.h> in
include/linux/sunrpc/rpc_rdma.h.

I did not see any other users dependency but if exist they
should be fixed since these headers are totally irrelevant
to here.

Signed-off-by: Boaz Harrosh <bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
---
 include/linux/sunrpc/debug.h    |    3 ---
 include/linux/sunrpc/rpc_rdma.h |    2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index 10709cb..c2786f2 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -28,9 +28,6 @@
 
 #ifdef __KERNEL__
 
-#include <linux/timer.h>
-#include <linux/workqueue.h>
-
 /*
  * Enable RPC debugging/profiling.
  */
diff --git a/include/linux/sunrpc/rpc_rdma.h b/include/linux/sunrpc/rpc_rdma.h
index 87b895d..b78f16b 100644
--- a/include/linux/sunrpc/rpc_rdma.h
+++ b/include/linux/sunrpc/rpc_rdma.h
@@ -40,6 +40,8 @@
 #ifndef _LINUX_SUNRPC_RPC_RDMA_H
 #define _LINUX_SUNRPC_RPC_RDMA_H
 
+#include <linux/types.h>
+
 struct rpcrdma_segment {
 	__be32 rs_handle;	/* Registered memory handle */
 	__be32 rs_length;	/* Length of the chunk in bytes */
-- 
1.6.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 2/6] sunrpc: Clean never used include files
@ 2009-11-23 15:58     ` Boaz Harrosh
  0 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-23 15:58 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, NFS list, pNFS Mailing List,
	Trond Myklebust
  Cc: linux-fsdevel, Al Viro, Randy Dunlap

Remove include of two headers never used by this file.
Doing so exposed a missing #include <linux/types.h> in
include/linux/sunrpc/rpc_rdma.h.

I did not see any other users dependency but if exist they
should be fixed since these headers are totally irrelevant
to here.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 include/linux/sunrpc/debug.h    |    3 ---
 include/linux/sunrpc/rpc_rdma.h |    2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index 10709cb..c2786f2 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -28,9 +28,6 @@
 
 #ifdef __KERNEL__
 
-#include <linux/timer.h>
-#include <linux/workqueue.h>
-
 /*
  * Enable RPC debugging/profiling.
  */
diff --git a/include/linux/sunrpc/rpc_rdma.h b/include/linux/sunrpc/rpc_rdma.h
index 87b895d..b78f16b 100644
--- a/include/linux/sunrpc/rpc_rdma.h
+++ b/include/linux/sunrpc/rpc_rdma.h
@@ -40,6 +40,8 @@
 #ifndef _LINUX_SUNRPC_RPC_RDMA_H
 #define _LINUX_SUNRPC_RPC_RDMA_H
 
+#include <linux/types.h>
+
 struct rpcrdma_segment {
 	__be32 rs_handle;	/* Registered memory handle */
 	__be32 rs_length;	/* Length of the chunk in bytes */
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 3/6] nfsd: Fix independence of a few nfsd related headers
  2009-11-23 15:54 ` Boaz Harrosh
@ 2009-11-23 15:59     ` Boaz Harrosh
  -1 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-23 15:59 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, NFS list, pNFS Mailing List,
	Trond Myklebust
  Cc: linux-fsdevel, Al Viro, Randy Dunlap

An header should be compilation independent, .i.e pull in
any header who's declarations are directly used by this header.
And not let users re-include all it's dependencies all over
again.

[At the end of the day what's the use of a header if it does
 not have more then one user?]

Signed-off-by: Boaz Harrosh <bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
---
 include/linux/nfs_xdr.h |    1 +
 include/linux/nfsacl.h  |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 62f63fb..00a0c81 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -2,6 +2,7 @@
 #define _LINUX_NFS_XDR_H
 
 #include <linux/nfsacl.h>
+#include <linux/nfs3.h>
 
 /*
  * To change the maximum rsize and wsize supported by the NFS client, adjust
diff --git a/include/linux/nfsacl.h b/include/linux/nfsacl.h
index 43011b6..f321b57 100644
--- a/include/linux/nfsacl.h
+++ b/include/linux/nfsacl.h
@@ -29,6 +29,7 @@
 #ifdef __KERNEL__
 
 #include <linux/posix_acl.h>
+#include <linux/sunrpc/xdr.h>
 
 /* Maximum number of ACL entries over NFS */
 #define NFS_ACL_MAX_ENTRIES	1024
-- 
1.6.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 3/6] nfsd: Fix independence of a few nfsd related headers
@ 2009-11-23 15:59     ` Boaz Harrosh
  0 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-23 15:59 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, NFS list, pNFS Mailing List,
	Trond Myklebust
  Cc: linux-fsdevel, Al Viro, Randy Dunlap

An header should be compilation independent, .i.e pull in
any header who's declarations are directly used by this header.
And not let users re-include all it's dependencies all over
again.

[At the end of the day what's the use of a header if it does
 not have more then one user?]

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 include/linux/nfs_xdr.h |    1 +
 include/linux/nfsacl.h  |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 62f63fb..00a0c81 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -2,6 +2,7 @@
 #define _LINUX_NFS_XDR_H
 
 #include <linux/nfsacl.h>
+#include <linux/nfs3.h>
 
 /*
  * To change the maximum rsize and wsize supported by the NFS client, adjust
diff --git a/include/linux/nfsacl.h b/include/linux/nfsacl.h
index 43011b6..f321b57 100644
--- a/include/linux/nfsacl.h
+++ b/include/linux/nfsacl.h
@@ -29,6 +29,7 @@
 #ifdef __KERNEL__
 
 #include <linux/posix_acl.h>
+#include <linux/sunrpc/xdr.h>
 
 /* Maximum number of ACL entries over NFS */
 #define NFS_ACL_MAX_ENTRIES	1024
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 4/6] nfsd: Headers Independence and include cleanups
  2009-11-23 15:54 ` Boaz Harrosh
@ 2009-11-23 15:59     ` Boaz Harrosh
  -1 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-23 15:59 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, NFS list, pNFS Mailing List,
	Trond Myklebust
  Cc: linux-fsdevel, Al Viro, Randy Dunlap

* Add includes that are directly used by headers
* Remove includes that are not needed

These are the changes made:

[xdr.h]
struct nfsd_readdirres has an embedded struct readdir_cd from nfsd.h
fixing that we can drop other includes

[xdr4.h]
embedded types defined both at state.h and nfsd.h

[syscall.h]
After export.h fix none of these stuff is needed.
fix extra space in # include <> statement

[stats.h]
does not need <linux/nfs4.h> but was export to user-mode
so I don't touch it

[state.h]
embedded types from nfsfh.h like struct knfsd_fh. bringing that
eliminates the need for all other includes

[nfsfh.h]
directly manipulating types from sunrpc/svc.h.
Removed Other unused headers.

[nfsd.h]
removed unused headers include

[export.h]
lots of sunrpc/svc.h types and a single prototype declaration
with pointer from nfsfh.h, but all users of export.h do need
nfsfh.h any way. remove now un-needed include.

[const.h]
Unfixed (not independent)

[cache.h]
could do with a forward declaration of "struct svc_rqst;"
from sunrpc/svc.h but all users absolutely will need
sunrpc/svc.h it is easier overall this way.

Signed-off-by: Boaz Harrosh <bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
---
 include/linux/nfsd/cache.h   |    3 +--
 include/linux/nfsd/export.h  |    2 +-
 include/linux/nfsd/nfsd.h    |    4 ----
 include/linux/nfsd/nfsfh.h   |    3 +--
 include/linux/nfsd/state.h   |    4 +---
 include/linux/nfsd/syscall.h |    8 +-------
 include/linux/nfsd/xdr.h     |    3 +--
 include/linux/nfsd/xdr4.h    |    3 ++-
 8 files changed, 8 insertions(+), 22 deletions(-)

diff --git a/include/linux/nfsd/cache.h b/include/linux/nfsd/cache.h
index 3a3f589..a165425 100644
--- a/include/linux/nfsd/cache.h
+++ b/include/linux/nfsd/cache.h
@@ -10,8 +10,7 @@
 #ifndef NFSCACHE_H
 #define NFSCACHE_H
 
-#include <linux/in.h>
-#include <linux/uio.h>
+#include <linux/sunrpc/svc.h>
 
 /*
  * Representation of a reply cache entry.
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index a6d9ef2..ef3d416 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -12,7 +12,7 @@
 
 # include <linux/types.h>
 #ifdef __KERNEL__
-# include <linux/in.h>
+# include <linux/nfsd/nfsfh.h>
 #endif
 
 /*
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 510ffdd..b6fdc76 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -11,13 +11,9 @@
 #define LINUX_NFSD_NFSD_H
 
 #include <linux/types.h>
-#include <linux/unistd.h>
-#include <linux/fs.h>
-#include <linux/posix_acl.h>
 #include <linux/mount.h>
 
 #include <linux/nfsd/debug.h>
-#include <linux/nfsd/nfsfh.h>
 #include <linux/nfsd/export.h>
 #include <linux/nfsd/stats.h>
 /*
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index 2973e11..49523ed 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -16,8 +16,7 @@
 
 # include <linux/types.h>
 #ifdef __KERNEL__
-# include <linux/string.h>
-# include <linux/fs.h>
+# include <linux/sunrpc/svc.h>
 #endif
 #include <linux/nfsd/const.h>
 
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index 5aadf8a..2af7568 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -37,9 +37,7 @@
 #ifndef _NFSD4_STATE_H
 #define _NFSD4_STATE_H
 
-#include <linux/list.h>
-#include <linux/kref.h>
-#include <linux/sunrpc/clnt.h>
+#include <linux/nfsd/nfsfh.h>
 
 typedef struct {
 	u32             cl_boot;
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h
index 7a3b565..812bc1e 100644
--- a/include/linux/nfsd/syscall.h
+++ b/include/linux/nfsd/syscall.h
@@ -9,14 +9,8 @@
 #ifndef NFSD_SYSCALL_H
 #define NFSD_SYSCALL_H
 
-# include <linux/types.h>
-#ifdef __KERNEL__
-# include <linux/in.h>
-#endif 
-#include <linux/posix_types.h>
-#include <linux/nfsd/const.h>
+#include <linux/types.h>
 #include <linux/nfsd/export.h>
-#include <linux/nfsd/nfsfh.h>
 
 /*
  * Version of the syscall interface
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h
index a0132ef..58f824d 100644
--- a/include/linux/nfsd/xdr.h
+++ b/include/linux/nfsd/xdr.h
@@ -7,9 +7,8 @@
 #ifndef LINUX_NFSD_H
 #define LINUX_NFSD_H
 
-#include <linux/fs.h>
 #include <linux/vfs.h>
-#include <linux/nfs.h>
+#include <linux/nfsd/nfsd.h>
 
 struct nfsd_fhandle {
 	struct svc_fh		fh;
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index 73164c2..1bf2662 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -39,7 +39,8 @@
 #ifndef _LINUX_NFSD_XDR4_H
 #define _LINUX_NFSD_XDR4_H
 
-#include <linux/nfs4.h>
+#include <linux/nfsd/state.h>
+#include <linux/nfsd/nfsd.h>
 
 #define NFSD4_MAX_TAGLEN	128
 #define XDR_LEN(n)                     (((n) + 3) & ~3)
-- 
1.6.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 4/6] nfsd: Headers Independence and include cleanups
@ 2009-11-23 15:59     ` Boaz Harrosh
  0 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-23 15:59 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, NFS list, pNFS Mailing List,
	Trond Myklebust
  Cc: linux-fsdevel, Al Viro, Randy Dunlap

* Add includes that are directly used by headers
* Remove includes that are not needed

These are the changes made:

[xdr.h]
struct nfsd_readdirres has an embedded struct readdir_cd from nfsd.h
fixing that we can drop other includes

[xdr4.h]
embedded types defined both at state.h and nfsd.h

[syscall.h]
After export.h fix none of these stuff is needed.
fix extra space in # include <> statement

[stats.h]
does not need <linux/nfs4.h> but was export to user-mode
so I don't touch it

[state.h]
embedded types from nfsfh.h like struct knfsd_fh. bringing that
eliminates the need for all other includes

[nfsfh.h]
directly manipulating types from sunrpc/svc.h.
Removed Other unused headers.

[nfsd.h]
removed unused headers include

[export.h]
lots of sunrpc/svc.h types and a single prototype declaration
with pointer from nfsfh.h, but all users of export.h do need
nfsfh.h any way. remove now un-needed include.

[const.h]
Unfixed (not independent)

[cache.h]
could do with a forward declaration of "struct svc_rqst;"
from sunrpc/svc.h but all users absolutely will need
sunrpc/svc.h it is easier overall this way.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 include/linux/nfsd/cache.h   |    3 +--
 include/linux/nfsd/export.h  |    2 +-
 include/linux/nfsd/nfsd.h    |    4 ----
 include/linux/nfsd/nfsfh.h   |    3 +--
 include/linux/nfsd/state.h   |    4 +---
 include/linux/nfsd/syscall.h |    8 +-------
 include/linux/nfsd/xdr.h     |    3 +--
 include/linux/nfsd/xdr4.h    |    3 ++-
 8 files changed, 8 insertions(+), 22 deletions(-)

diff --git a/include/linux/nfsd/cache.h b/include/linux/nfsd/cache.h
index 3a3f589..a165425 100644
--- a/include/linux/nfsd/cache.h
+++ b/include/linux/nfsd/cache.h
@@ -10,8 +10,7 @@
 #ifndef NFSCACHE_H
 #define NFSCACHE_H
 
-#include <linux/in.h>
-#include <linux/uio.h>
+#include <linux/sunrpc/svc.h>
 
 /*
  * Representation of a reply cache entry.
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index a6d9ef2..ef3d416 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -12,7 +12,7 @@
 
 # include <linux/types.h>
 #ifdef __KERNEL__
-# include <linux/in.h>
+# include <linux/nfsd/nfsfh.h>
 #endif
 
 /*
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 510ffdd..b6fdc76 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -11,13 +11,9 @@
 #define LINUX_NFSD_NFSD_H
 
 #include <linux/types.h>
-#include <linux/unistd.h>
-#include <linux/fs.h>
-#include <linux/posix_acl.h>
 #include <linux/mount.h>
 
 #include <linux/nfsd/debug.h>
-#include <linux/nfsd/nfsfh.h>
 #include <linux/nfsd/export.h>
 #include <linux/nfsd/stats.h>
 /*
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index 2973e11..49523ed 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -16,8 +16,7 @@
 
 # include <linux/types.h>
 #ifdef __KERNEL__
-# include <linux/string.h>
-# include <linux/fs.h>
+# include <linux/sunrpc/svc.h>
 #endif
 #include <linux/nfsd/const.h>
 
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index 5aadf8a..2af7568 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -37,9 +37,7 @@
 #ifndef _NFSD4_STATE_H
 #define _NFSD4_STATE_H
 
-#include <linux/list.h>
-#include <linux/kref.h>
-#include <linux/sunrpc/clnt.h>
+#include <linux/nfsd/nfsfh.h>
 
 typedef struct {
 	u32             cl_boot;
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h
index 7a3b565..812bc1e 100644
--- a/include/linux/nfsd/syscall.h
+++ b/include/linux/nfsd/syscall.h
@@ -9,14 +9,8 @@
 #ifndef NFSD_SYSCALL_H
 #define NFSD_SYSCALL_H
 
-# include <linux/types.h>
-#ifdef __KERNEL__
-# include <linux/in.h>
-#endif 
-#include <linux/posix_types.h>
-#include <linux/nfsd/const.h>
+#include <linux/types.h>
 #include <linux/nfsd/export.h>
-#include <linux/nfsd/nfsfh.h>
 
 /*
  * Version of the syscall interface
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h
index a0132ef..58f824d 100644
--- a/include/linux/nfsd/xdr.h
+++ b/include/linux/nfsd/xdr.h
@@ -7,9 +7,8 @@
 #ifndef LINUX_NFSD_H
 #define LINUX_NFSD_H
 
-#include <linux/fs.h>
 #include <linux/vfs.h>
-#include <linux/nfs.h>
+#include <linux/nfsd/nfsd.h>
 
 struct nfsd_fhandle {
 	struct svc_fh		fh;
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index 73164c2..1bf2662 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -39,7 +39,8 @@
 #ifndef _LINUX_NFSD_XDR4_H
 #define _LINUX_NFSD_XDR4_H
 
-#include <linux/nfs4.h>
+#include <linux/nfsd/state.h>
+#include <linux/nfsd/nfsd.h>
 
 #define NFSD4_MAX_TAGLEN	128
 #define XDR_LEN(n)                     (((n) + 3) & ~3)
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 5/6] nfsd: Source files #include cleanups
  2009-11-23 15:54 ` Boaz Harrosh
  (?)
  (?)
@ 2009-11-23 15:59 ` Boaz Harrosh
  2009-11-24  8:17   ` [PATCH 5/6 version2] " Boaz Harrosh
       [not found]   ` <1258991991-25446-1-git-send-email-bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
  -1 siblings, 2 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-23 15:59 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, NFS list, pNFS Mailing List,
	Trond Myklebust
  Cc: linux-fsdevel, Al Viro, Randy Dunlap

Now that the headers are fixed and carry their own wait, all fs/nfsd/
source files can include a minimal set of headers. and still compile just
fine.

This patch should improve the compilation speed of the nfsd module.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 fs/nfsd/auth.c         |    4 ----
 fs/nfsd/export.c       |   15 ---------------
 fs/nfsd/lockd.c        |    5 -----
 fs/nfsd/nfs2acl.c      |    4 ----
 fs/nfsd/nfs3acl.c      |    3 ---
 fs/nfsd/nfs3proc.c     |   13 -------------
 fs/nfsd/nfs3xdr.c      |   11 -----------
 fs/nfsd/nfs4acl.c      |    8 --------
 fs/nfsd/nfs4callback.c |   13 -------------
 fs/nfsd/nfs4idmap.c    |   15 +--------------
 fs/nfsd/nfs4proc.c     |   10 ----------
 fs/nfsd/nfs4recover.c  |    8 --------
 fs/nfsd/nfs4state.c    |   15 ---------------
 fs/nfsd/nfs4xdr.c      |   12 +-----------
 fs/nfsd/nfscache.c     |    8 --------
 fs/nfsd/nfsctl.c       |   25 -------------------------
 fs/nfsd/nfsfh.c        |    9 ---------
 fs/nfsd/nfsproc.c      |   13 -------------
 fs/nfsd/nfssvc.c       |   15 ---------------
 fs/nfsd/nfsxdr.c       |    8 --------
 fs/nfsd/stats.c        |    5 -----
 fs/nfsd/vfs.c          |   21 ---------------------
 22 files changed, 2 insertions(+), 238 deletions(-)

diff --git a/fs/nfsd/auth.c b/fs/nfsd/auth.c
index 36fcabb..ad354d2 100644
--- a/fs/nfsd/auth.c
+++ b/fs/nfsd/auth.c
@@ -4,12 +4,8 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/types.h>
 #include <linux/sched.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/sunrpc/svcauth.h>
 #include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/export.h>
 #include "auth.h"
 
 int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp)
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index b73baba..68e63f4 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -14,27 +14,12 @@
  * Copyright (C) 1995, 1996 Olaf Kirch, <okir@monad.swb.de>
  */
 
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/stat.h>
-#include <linux/in.h>
-#include <linux/seq_file.h>
-#include <linux/syscalls.h>
-#include <linux/rwsem.h>
-#include <linux/dcache.h>
 #include <linux/namei.h>
-#include <linux/mount.h>
-#include <linux/hash.h>
 #include <linux/module.h>
 #include <linux/exportfs.h>
 
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/nfsfh.h>
 #include <linux/nfsd/syscall.h>
-#include <linux/lockd/bind.h>
-#include <linux/sunrpc/msg_prot.h>
-#include <linux/sunrpc/gss_api.h>
 #include <net/ipv6.h>
 
 #define NFSDDBG_FACILITY	NFSDDBG_EXPORT
diff --git a/fs/nfsd/lockd.c b/fs/nfsd/lockd.c
index b2786a5..19a16e1 100644
--- a/fs/nfsd/lockd.c
+++ b/fs/nfsd/lockd.c
@@ -8,12 +8,7 @@
  * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/types.h>
-#include <linux/fs.h>
 #include <linux/file.h>
-#include <linux/mount.h>
-#include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/lockd/bind.h>
 
diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c
index e2a17f0..64c368b 100644
--- a/fs/nfsd/nfs2acl.c
+++ b/fs/nfsd/nfs2acl.c
@@ -6,13 +6,9 @@
  * Copyright (C) 2002-2003 Andreas Gruenbacher <agruen@suse.de>
  */
 
-#include <linux/sunrpc/svc.h>
-#include <linux/nfs.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
-#include <linux/nfsd/xdr.h>
 #include <linux/nfsd/xdr3.h>
-#include <linux/posix_acl.h>
 #include <linux/nfsacl.h>
 
 #define NFSDDBG_FACILITY		NFSDDBG_PROC
diff --git a/fs/nfsd/nfs3acl.c b/fs/nfsd/nfs3acl.c
index ff73596..8e44949 100644
--- a/fs/nfsd/nfs3acl.c
+++ b/fs/nfsd/nfs3acl.c
@@ -6,12 +6,9 @@
  * Copyright (C) 2002-2003 Andreas Gruenbacher <agruen@suse.de>
  */
 
-#include <linux/sunrpc/svc.h>
-#include <linux/nfs3.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
 #include <linux/nfsd/xdr3.h>
-#include <linux/posix_acl.h>
 #include <linux/nfsacl.h>
 
 #define RETURN_STATUS(st)	{ resp->status = (st); return (st); }
diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
index a713c41..ed6112e 100644
--- a/fs/nfsd/nfs3proc.c
+++ b/fs/nfsd/nfs3proc.c
@@ -6,25 +6,12 @@
  * Copyright (C) 1996, 1997, 1998 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/linkage.h>
-#include <linux/time.h>
-#include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/ext2_fs.h>
-#include <linux/stat.h>
-#include <linux/fcntl.h>
-#include <linux/net.h>
-#include <linux/in.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/major.h>
 #include <linux/magic.h>
 
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
 #include <linux/nfsd/xdr3.h>
-#include <linux/nfs3.h>
 
 #define NFSDDBG_FACILITY		NFSDDBG_PROC
 
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index edf926e..97b3619 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -8,18 +8,7 @@
  * 2003-08-09 Jamie Lokier: Use htonl() for nanoseconds, not htons()!
  */
 
-#include <linux/types.h>
-#include <linux/time.h>
-#include <linux/nfs3.h>
-#include <linux/list.h>
-#include <linux/spinlock.h>
-#include <linux/dcache.h>
 #include <linux/namei.h>
-#include <linux/mm.h>
-#include <linux/vfs.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/xdr3.h>
 #include "auth.h"
 
diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
index 6d9c6aa..d6f0cea 100644
--- a/fs/nfsd/nfs4acl.c
+++ b/fs/nfsd/nfs4acl.c
@@ -36,15 +36,7 @@
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <linux/string.h>
-#include <linux/slab.h>
-#include <linux/list.h>
-#include <linux/types.h>
-#include <linux/fs.h>
-#include <linux/module.h>
 #include <linux/nfs_fs.h>
-#include <linux/posix_acl.h>
-#include <linux/nfs4.h>
 #include <linux/nfs4_acl.h>
 
 
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 24e8d78..4fe3960 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -33,22 +33,9 @@
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <linux/module.h>
-#include <linux/list.h>
-#include <linux/inet.h>
-#include <linux/errno.h>
-#include <linux/delay.h>
-#include <linux/sched.h>
-#include <linux/kthread.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/svcsock.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/state.h>
-#include <linux/sunrpc/sched.h>
-#include <linux/nfs4.h>
-#include <linux/sunrpc/xprtsock.h>
 
 #define NFSDDBG_FACILITY                NFSDDBG_PROC
 
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index ba2c199..8e518cd 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -35,22 +35,9 @@
  */
 
 #include <linux/module.h>
-#include <linux/init.h>
-
-#include <linux/mm.h>
-#include <linux/errno.h>
-#include <linux/string.h>
-#include <linux/sunrpc/clnt.h>
-#include <linux/nfs.h>
-#include <linux/nfs4.h>
-#include <linux/nfs_fs.h>
-#include <linux/nfs_page.h>
-#include <linux/sunrpc/cache.h>
 #include <linux/nfsd_idmap.h>
-#include <linux/list.h>
-#include <linux/time.h>
 #include <linux/seq_file.h>
-#include <linux/sunrpc/svcauth.h>
+#include <linux/sched.h>
 
 /*
  * Cache entry
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index bebc0c2..e3c1e6d 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -34,20 +34,10 @@
  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-
-#include <linux/param.h>
-#include <linux/major.h>
-#include <linux/slab.h>
 #include <linux/file.h>
 
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
-#include <linux/nfs4.h>
-#include <linux/nfsd/state.h>
 #include <linux/nfsd/xdr4.h>
-#include <linux/nfs4_acl.h>
-#include <linux/sunrpc/gss_api.h>
 
 #define NFSDDBG_FACILITY		NFSDDBG_PROC
 
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index b534840..be9e712 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -33,20 +33,12 @@
 *
 */
 
-#include <linux/err.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
-#include <linux/nfs4.h>
 #include <linux/nfsd/state.h>
-#include <linux/nfsd/xdr4.h>
-#include <linux/param.h>
 #include <linux/file.h>
 #include <linux/namei.h>
-#include <asm/uaccess.h>
-#include <linux/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/sched.h>
-#include <linux/mount.h>
 
 #define NFSDDBG_FACILITY                NFSDDBG_PROC
 
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index c8b621a..93f801c 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -34,26 +34,11 @@
 *
 */
 
-#include <linux/param.h>
-#include <linux/major.h>
-#include <linux/slab.h>
-
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/cache.h>
 #include <linux/file.h>
-#include <linux/mount.h>
-#include <linux/workqueue.h>
 #include <linux/smp_lock.h>
-#include <linux/kthread.h>
-#include <linux/nfs4.h>
-#include <linux/nfsd/state.h>
 #include <linux/nfsd/xdr4.h>
 #include <linux/namei.h>
 #include <linux/swap.h>
-#include <linux/mutex.h>
-#include <linux/lockd/bind.h>
-#include <linux/module.h>
 #include <linux/sunrpc/svcauth_gss.h>
 #include <linux/sunrpc/clnt.h>
 
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 0fbd50c..444eeca 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -40,22 +40,12 @@
  * at the end of nfs4svc_decode_compoundargs.
  */
 
-#include <linux/param.h>
-#include <linux/smp.h>
-#include <linux/fs.h>
 #include <linux/namei.h>
-#include <linux/vfs.h>
+#include <linux/statfs.h>
 #include <linux/utsname.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/sunrpc/clnt.h>
-#include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/state.h>
 #include <linux/nfsd/xdr4.h>
 #include <linux/nfsd_idmap.h>
-#include <linux/nfs4.h>
 #include <linux/nfs4_acl.h>
-#include <linux/sunrpc/gss_api.h>
 #include <linux/sunrpc/svcauth_gss.h>
 
 #define NFSDDBG_FACILITY		NFSDDBG_XDR
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index 4638635..96694b8 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -10,14 +10,6 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/kernel.h>
-#include <linux/time.h>
-#include <linux/slab.h>
-#include <linux/string.h>
-#include <linux/spinlock.h>
-#include <linux/list.h>
-
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
 
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 5c01fc1..e4f49fd 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -6,42 +6,17 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/module.h>
-
-#include <linux/linkage.h>
-#include <linux/time.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
 #include <linux/namei.h>
-#include <linux/fcntl.h>
-#include <linux/net.h>
-#include <linux/in.h>
-#include <linux/syscalls.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/proc_fs.h>
-#include <linux/seq_file.h>
-#include <linux/pagemap.h>
-#include <linux/init.h>
-#include <linux/inet.h>
-#include <linux/string.h>
 #include <linux/ctype.h>
 
-#include <linux/nfs.h>
 #include <linux/nfsd_idmap.h>
-#include <linux/lockd/bind.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/svcsock.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
-#include <linux/nfsd/xdr.h>
 #include <linux/nfsd/syscall.h>
 #include <linux/lockd/lockd.h>
 #include <linux/sunrpc/clnt.h>
 
-#include <asm/uaccess.h>
-#include <net/ipv6.h>
-
 /*
  *	We have a single directory with 9 nodes in it.
  */
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index 01965b2..01f142f 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -9,17 +9,8 @@
  * ... and again Southern-Winter 2001 to support export_operations
  */
 
-#include <linux/slab.h>
-#include <linux/fs.h>
-#include <linux/unistd.h>
-#include <linux/string.h>
-#include <linux/stat.h>
-#include <linux/dcache.h>
 #include <linux/exportfs.h>
-#include <linux/mount.h>
 
-#include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/svcauth_gss.h>
 #include <linux/nfsd/nfsd.h>
 #include "auth.h"
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index c5393d1..2307693 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -7,21 +7,8 @@
  * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/linkage.h>
-#include <linux/time.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/stat.h>
-#include <linux/fcntl.h>
-#include <linux/net.h>
-#include <linux/in.h>
 #include <linux/namei.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
 
-#include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
 #include <linux/nfsd/xdr.h>
 
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 67ea83e..ab4b321 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -8,30 +8,15 @@
  * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/module.h>
 #include <linux/sched.h>
-#include <linux/time.h>
-#include <linux/errno.h>
-#include <linux/nfs.h>
-#include <linux/in.h>
-#include <linux/uio.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/smp.h>
 #include <linux/freezer.h>
 #include <linux/fs_struct.h>
-#include <linux/kthread.h>
 #include <linux/swap.h>
 
-#include <linux/sunrpc/types.h>
 #include <linux/sunrpc/stats.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/svcsock.h>
-#include <linux/sunrpc/cache.h>
 #include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/stats.h>
 #include <linux/nfsd/cache.h>
-#include <linux/nfsd/syscall.h>
 #include <linux/lockd/bind.h>
 #include <linux/nfsacl.h>
 #include <linux/seq_file.h>
diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c
index afd08e2..5e0603d 100644
--- a/fs/nfsd/nfsxdr.c
+++ b/fs/nfsd/nfsxdr.c
@@ -6,15 +6,7 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/types.h>
-#include <linux/time.h>
-#include <linux/nfs.h>
-#include <linux/vfs.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/xdr.h>
-#include <linux/mm.h>
 #include "auth.h"
 
 #define NFSDDBG_FACILITY		NFSDDBG_XDR
diff --git a/fs/nfsd/stats.c b/fs/nfsd/stats.c
index 71944cd..e3e411e 100644
--- a/fs/nfsd/stats.c
+++ b/fs/nfsd/stats.c
@@ -23,14 +23,9 @@
  * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/kernel.h>
-#include <linux/time.h>
-#include <linux/proc_fs.h>
 #include <linux/seq_file.h>
-#include <linux/stat.h>
 #include <linux/module.h>
 
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/stats.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/stats.h>
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 6385739..a899429 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -16,43 +16,22 @@
  * Zerocpy NFS support (C) 2002 Hirokazu Takahashi <taka@valinux.co.jp>
  */
 
-#include <linux/string.h>
-#include <linux/time.h>
-#include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/file.h>
-#include <linux/mount.h>
-#include <linux/major.h>
 #include <linux/splice.h>
-#include <linux/proc_fs.h>
-#include <linux/stat.h>
 #include <linux/fcntl.h>
-#include <linux/net.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/pagemap.h>
-#include <linux/in.h>
-#include <linux/module.h>
 #include <linux/namei.h>
-#include <linux/vfs.h>
-#include <linux/delay.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
 #ifdef CONFIG_NFSD_V3
-#include <linux/nfs3.h>
 #include <linux/nfsd/xdr3.h>
 #endif /* CONFIG_NFSD_V3 */
-#include <linux/nfsd/nfsfh.h>
 #include <linux/quotaops.h>
 #include <linux/fsnotify.h>
-#include <linux/posix_acl.h>
 #include <linux/posix_acl_xattr.h>
 #include <linux/xattr.h>
 #ifdef CONFIG_NFSD_V4
-#include <linux/nfs4.h>
 #include <linux/nfs4_acl.h>
 #include <linux/nfsd_idmap.h>
-#include <linux/security.h>
 #endif /* CONFIG_NFSD_V4 */
 #include <linux/jhash.h>
 #include <linux/ima.h>
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 6/6] compat.c: Remove dependence on nfsd private headers
  2009-11-23 15:54 ` Boaz Harrosh
@ 2009-11-23 16:00     ` Boaz Harrosh
  -1 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-23 16:00 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, NFS list, pNFS Mailing List,
	Trond Myklebust
  Cc: linux-fsdevel, Al Viro, Randy Dunlap

Two nfsd related headers where included but never actually
used. The linux/nfsd/nfsd.h file will eventually be moved
to fs/nfsd directory as it is only needed by nfsd itself.

There are 3 more compat.c files in the Kernel at other ARCHs
that wrongly #include nfsd headers. Once these are fixed the
headers can be moved.

Signed-off-by: Boaz Harrosh <bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
---
 fs/compat.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/fs/compat.c b/fs/compat.c
index d576b55..514b623 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -38,8 +38,6 @@
 #include <linux/dirent.h>
 #include <linux/fsnotify.h>
 #include <linux/highuid.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/syscall.h>
 #include <linux/personality.h>
 #include <linux/rwsem.h>
-- 
1.6.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 6/6] compat.c: Remove dependence on nfsd private headers
@ 2009-11-23 16:00     ` Boaz Harrosh
  0 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-23 16:00 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, NFS list, pNFS Mailing List,
	Trond Myklebust
  Cc: linux-fsdevel, Al Viro, Randy Dunlap

Two nfsd related headers where included but never actually
used. The linux/nfsd/nfsd.h file will eventually be moved
to fs/nfsd directory as it is only needed by nfsd itself.

There are 3 more compat.c files in the Kernel at other ARCHs
that wrongly #include nfsd headers. Once these are fixed the
headers can be moved.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 fs/compat.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/fs/compat.c b/fs/compat.c
index d576b55..514b623 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -38,8 +38,6 @@
 #include <linux/dirent.h>
 #include <linux/fsnotify.h>
 #include <linux/highuid.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/syscall.h>
 #include <linux/personality.h>
 #include <linux/rwsem.h>
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [pnfs] [PATCH 5/6] nfsd: Source files #include cleanups
  2009-11-23 15:59 ` [PATCH 5/6] nfsd: Source files #include cleanups Boaz Harrosh
@ 2009-11-23 17:26       ` Boaz Harrosh
       [not found]   ` <1258991991-25446-1-git-send-email-bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
  1 sibling, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-23 17:26 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, NFS list, pNFS Mailing List,
	Trond Myklebust
  Cc: linux-fsdevel, Randy Dunlap, Al Viro

On 11/23/2009 05:59 PM, Boaz Harrosh wrote:
> Now that the headers are fixed and carry their own wait, all fs/nfsd/
> source files can include a minimal set of headers. and still compile just
> fine.
> 
> This patch should improve the compilation speed of the nfsd module.
> 
> Signed-off-by: Boaz Harrosh <bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
> ---
>  fs/nfsd/auth.c         |    4 ----
>  fs/nfsd/export.c       |   15 ---------------
>  fs/nfsd/lockd.c        |    5 -----
>  fs/nfsd/nfs2acl.c      |    4 ----
>  fs/nfsd/nfs3acl.c      |    3 ---
>  fs/nfsd/nfs3proc.c     |   13 -------------
>  fs/nfsd/nfs3xdr.c      |   11 -----------
>  fs/nfsd/nfs4acl.c      |    8 --------
>  fs/nfsd/nfs4callback.c |   13 -------------
>  fs/nfsd/nfs4idmap.c    |   15 +--------------
>  fs/nfsd/nfs4proc.c     |   10 ----------
>  fs/nfsd/nfs4recover.c  |    8 --------
>  fs/nfsd/nfs4state.c    |   15 ---------------
>  fs/nfsd/nfs4xdr.c      |   12 +-----------
>  fs/nfsd/nfscache.c     |    8 --------
>  fs/nfsd/nfsctl.c       |   25 -------------------------
>  fs/nfsd/nfsfh.c        |    9 ---------
>  fs/nfsd/nfsproc.c      |   13 -------------
>  fs/nfsd/nfssvc.c       |   15 ---------------
>  fs/nfsd/nfsxdr.c       |    8 --------
>  fs/nfsd/stats.c        |    5 -----
>  fs/nfsd/vfs.c          |   21 ---------------------
>  22 files changed, 2 insertions(+), 238 deletions(-)
> 
> diff --git a/fs/nfsd/auth.c b/fs/nfsd/auth.c
> index 36fcabb..ad354d2 100644
> --- a/fs/nfsd/auth.c
> +++ b/fs/nfsd/auth.c
> @@ -4,12 +4,8 @@
>   * Copyright (C) 1995, 1996 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/types.h>
>  #include <linux/sched.h>
> -#include <linux/sunrpc/svc.h>
> -#include <linux/sunrpc/svcauth.h>
>  #include <linux/nfsd/nfsd.h>
> -#include <linux/nfsd/export.h>
>  #include "auth.h"
>  
>  int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp)
> diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> index b73baba..68e63f4 100644
> --- a/fs/nfsd/export.c
> +++ b/fs/nfsd/export.c
> @@ -14,27 +14,12 @@
>   * Copyright (C) 1995, 1996 Olaf Kirch, <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/unistd.h>
> -#include <linux/slab.h>
> -#include <linux/stat.h>
> -#include <linux/in.h>
> -#include <linux/seq_file.h>
> -#include <linux/syscalls.h>
> -#include <linux/rwsem.h>
> -#include <linux/dcache.h>
>  #include <linux/namei.h>
> -#include <linux/mount.h>
> -#include <linux/hash.h>
>  #include <linux/module.h>
>  #include <linux/exportfs.h>
>  
> -#include <linux/sunrpc/svc.h>
>  #include <linux/nfsd/nfsd.h>
> -#include <linux/nfsd/nfsfh.h>
>  #include <linux/nfsd/syscall.h>
> -#include <linux/lockd/bind.h>
> -#include <linux/sunrpc/msg_prot.h>
> -#include <linux/sunrpc/gss_api.h>
>  #include <net/ipv6.h>
>  
>  #define NFSDDBG_FACILITY	NFSDDBG_EXPORT
> diff --git a/fs/nfsd/lockd.c b/fs/nfsd/lockd.c
> index b2786a5..19a16e1 100644
> --- a/fs/nfsd/lockd.c
> +++ b/fs/nfsd/lockd.c
> @@ -8,12 +8,7 @@
>   * Copyright (C) 1996, Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/types.h>
> -#include <linux/fs.h>
>  #include <linux/file.h>
> -#include <linux/mount.h>
> -#include <linux/sunrpc/clnt.h>
> -#include <linux/sunrpc/svc.h>
>  #include <linux/nfsd/nfsd.h>
>  #include <linux/lockd/bind.h>
>  
> diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c
> index e2a17f0..64c368b 100644
> --- a/fs/nfsd/nfs2acl.c
> +++ b/fs/nfsd/nfs2acl.c
> @@ -6,13 +6,9 @@
>   * Copyright (C) 2002-2003 Andreas Gruenbacher <agruen-l3A5Bk7waGM@public.gmane.org>
>   */
>  
> -#include <linux/sunrpc/svc.h>
> -#include <linux/nfs.h>
>  #include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/cache.h>
> -#include <linux/nfsd/xdr.h>
>  #include <linux/nfsd/xdr3.h>
> -#include <linux/posix_acl.h>
>  #include <linux/nfsacl.h>
>  
>  #define NFSDDBG_FACILITY		NFSDDBG_PROC
> diff --git a/fs/nfsd/nfs3acl.c b/fs/nfsd/nfs3acl.c
> index ff73596..8e44949 100644
> --- a/fs/nfsd/nfs3acl.c
> +++ b/fs/nfsd/nfs3acl.c
> @@ -6,12 +6,9 @@
>   * Copyright (C) 2002-2003 Andreas Gruenbacher <agruen-l3A5Bk7waGM@public.gmane.org>
>   */
>  
> -#include <linux/sunrpc/svc.h>
> -#include <linux/nfs3.h>
>  #include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/cache.h>
>  #include <linux/nfsd/xdr3.h>
> -#include <linux/posix_acl.h>
>  #include <linux/nfsacl.h>
>  
>  #define RETURN_STATUS(st)	{ resp->status = (st); return (st); }
> diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
> index a713c41..ed6112e 100644
> --- a/fs/nfsd/nfs3proc.c
> +++ b/fs/nfsd/nfs3proc.c
> @@ -6,25 +6,12 @@
>   * Copyright (C) 1996, 1997, 1998 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/linkage.h>
> -#include <linux/time.h>
> -#include <linux/errno.h>
>  #include <linux/fs.h>
>  #include <linux/ext2_fs.h>
> -#include <linux/stat.h>
> -#include <linux/fcntl.h>
> -#include <linux/net.h>
> -#include <linux/in.h>
> -#include <linux/unistd.h>
> -#include <linux/slab.h>
> -#include <linux/major.h>
>  #include <linux/magic.h>
>  
> -#include <linux/sunrpc/svc.h>
> -#include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/cache.h>
>  #include <linux/nfsd/xdr3.h>
> -#include <linux/nfs3.h>
>  
>  #define NFSDDBG_FACILITY		NFSDDBG_PROC
>  
> diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
> index edf926e..97b3619 100644
> --- a/fs/nfsd/nfs3xdr.c
> +++ b/fs/nfsd/nfs3xdr.c
> @@ -8,18 +8,7 @@
>   * 2003-08-09 Jamie Lokier: Use htonl() for nanoseconds, not htons()!
>   */
>  
> -#include <linux/types.h>
> -#include <linux/time.h>
> -#include <linux/nfs3.h>
> -#include <linux/list.h>
> -#include <linux/spinlock.h>
> -#include <linux/dcache.h>
>  #include <linux/namei.h>
> -#include <linux/mm.h>
> -#include <linux/vfs.h>
> -#include <linux/sunrpc/xdr.h>
> -#include <linux/sunrpc/svc.h>
> -#include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/xdr3.h>
>  #include "auth.h"
>  
> diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
> index 6d9c6aa..d6f0cea 100644
> --- a/fs/nfsd/nfs4acl.c
> +++ b/fs/nfsd/nfs4acl.c
> @@ -36,15 +36,7 @@
>   *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>   */
>  
> -#include <linux/string.h>
> -#include <linux/slab.h>
> -#include <linux/list.h>
> -#include <linux/types.h>
> -#include <linux/fs.h>
> -#include <linux/module.h>
>  #include <linux/nfs_fs.h>
> -#include <linux/posix_acl.h>
> -#include <linux/nfs4.h>
>  #include <linux/nfs4_acl.h>
>  
>  
> diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
> index 24e8d78..4fe3960 100644
> --- a/fs/nfsd/nfs4callback.c
> +++ b/fs/nfsd/nfs4callback.c
> @@ -33,22 +33,9 @@
>   *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>   */
>  
> -#include <linux/module.h>
> -#include <linux/list.h>
> -#include <linux/inet.h>
> -#include <linux/errno.h>
> -#include <linux/delay.h>
> -#include <linux/sched.h>
> -#include <linux/kthread.h>
> -#include <linux/sunrpc/xdr.h>
> -#include <linux/sunrpc/svc.h>
>  #include <linux/sunrpc/clnt.h>
> -#include <linux/sunrpc/svcsock.h>
>  #include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/state.h>
> -#include <linux/sunrpc/sched.h>
> -#include <linux/nfs4.h>
> -#include <linux/sunrpc/xprtsock.h>
>  
>  #define NFSDDBG_FACILITY                NFSDDBG_PROC
>  
> diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
> index ba2c199..8e518cd 100644
> --- a/fs/nfsd/nfs4idmap.c
> +++ b/fs/nfsd/nfs4idmap.c
> @@ -35,22 +35,9 @@
>   */
>  
>  #include <linux/module.h>
> -#include <linux/init.h>
> -
> -#include <linux/mm.h>
> -#include <linux/errno.h>
> -#include <linux/string.h>
> -#include <linux/sunrpc/clnt.h>
> -#include <linux/nfs.h>
> -#include <linux/nfs4.h>
> -#include <linux/nfs_fs.h>
> -#include <linux/nfs_page.h>
> -#include <linux/sunrpc/cache.h>
>  #include <linux/nfsd_idmap.h>
> -#include <linux/list.h>
> -#include <linux/time.h>
>  #include <linux/seq_file.h>
> -#include <linux/sunrpc/svcauth.h>
> +#include <linux/sched.h>
>  
>  /*
>   * Cache entry
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index bebc0c2..e3c1e6d 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -34,20 +34,10 @@
>   *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
>   *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>   */
> -
> -#include <linux/param.h>
> -#include <linux/major.h>
> -#include <linux/slab.h>
>  #include <linux/file.h>
>  
> -#include <linux/sunrpc/svc.h>
> -#include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/cache.h>
> -#include <linux/nfs4.h>
> -#include <linux/nfsd/state.h>
>  #include <linux/nfsd/xdr4.h>
> -#include <linux/nfs4_acl.h>
> -#include <linux/sunrpc/gss_api.h>
>  
>  #define NFSDDBG_FACILITY		NFSDDBG_PROC
>  
> diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
> index b534840..be9e712 100644
> --- a/fs/nfsd/nfs4recover.c
> +++ b/fs/nfsd/nfs4recover.c
> @@ -33,20 +33,12 @@
>  *
>  */
>  
> -#include <linux/err.h>
> -#include <linux/sunrpc/svc.h>
>  #include <linux/nfsd/nfsd.h>
> -#include <linux/nfs4.h>
>  #include <linux/nfsd/state.h>
> -#include <linux/nfsd/xdr4.h>
> -#include <linux/param.h>
>  #include <linux/file.h>
>  #include <linux/namei.h>
> -#include <asm/uaccess.h>
> -#include <linux/scatterlist.h>
>  #include <linux/crypto.h>
>  #include <linux/sched.h>
> -#include <linux/mount.h>
>  
>  #define NFSDDBG_FACILITY                NFSDDBG_PROC
>  
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index c8b621a..93f801c 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -34,26 +34,11 @@
>  *
>  */
>  
> -#include <linux/param.h>
> -#include <linux/major.h>
> -#include <linux/slab.h>
> -
> -#include <linux/sunrpc/svc.h>
> -#include <linux/nfsd/nfsd.h>
> -#include <linux/nfsd/cache.h>
>  #include <linux/file.h>
> -#include <linux/mount.h>
> -#include <linux/workqueue.h>
>  #include <linux/smp_lock.h>
> -#include <linux/kthread.h>
> -#include <linux/nfs4.h>
> -#include <linux/nfsd/state.h>
>  #include <linux/nfsd/xdr4.h>
>  #include <linux/namei.h>
>  #include <linux/swap.h>
> -#include <linux/mutex.h>
> -#include <linux/lockd/bind.h>
> -#include <linux/module.h>
>  #include <linux/sunrpc/svcauth_gss.h>
>  #include <linux/sunrpc/clnt.h>
>  
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index 0fbd50c..444eeca 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -40,22 +40,12 @@
>   * at the end of nfs4svc_decode_compoundargs.
>   */
>  
> -#include <linux/param.h>
> -#include <linux/smp.h>
> -#include <linux/fs.h>
>  #include <linux/namei.h>
> -#include <linux/vfs.h>
> +#include <linux/statfs.h>
>  #include <linux/utsname.h>
> -#include <linux/sunrpc/xdr.h>
> -#include <linux/sunrpc/svc.h>
> -#include <linux/sunrpc/clnt.h>
> -#include <linux/nfsd/nfsd.h>
> -#include <linux/nfsd/state.h>
>  #include <linux/nfsd/xdr4.h>
>  #include <linux/nfsd_idmap.h>
> -#include <linux/nfs4.h>
>  #include <linux/nfs4_acl.h>
> -#include <linux/sunrpc/gss_api.h>
>  #include <linux/sunrpc/svcauth_gss.h>
>  
>  #define NFSDDBG_FACILITY		NFSDDBG_XDR
> diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
> index 4638635..96694b8 100644
> --- a/fs/nfsd/nfscache.c
> +++ b/fs/nfsd/nfscache.c
> @@ -10,14 +10,6 @@
>   * Copyright (C) 1995, 1996 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/kernel.h>
> -#include <linux/time.h>
> -#include <linux/slab.h>
> -#include <linux/string.h>
> -#include <linux/spinlock.h>
> -#include <linux/list.h>
> -
> -#include <linux/sunrpc/svc.h>
>  #include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/cache.h>
>  
> diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
> index 5c01fc1..e4f49fd 100644
> --- a/fs/nfsd/nfsctl.c
> +++ b/fs/nfsd/nfsctl.c
> @@ -6,42 +6,17 @@
>   * Copyright (C) 1995, 1996 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/module.h>
> -
> -#include <linux/linkage.h>
> -#include <linux/time.h>
> -#include <linux/errno.h>
> -#include <linux/fs.h>
>  #include <linux/namei.h>
> -#include <linux/fcntl.h>
> -#include <linux/net.h>
> -#include <linux/in.h>
> -#include <linux/syscalls.h>
> -#include <linux/unistd.h>
> -#include <linux/slab.h>
> -#include <linux/proc_fs.h>
> -#include <linux/seq_file.h>
> -#include <linux/pagemap.h>
> -#include <linux/init.h>
> -#include <linux/inet.h>
> -#include <linux/string.h>
>  #include <linux/ctype.h>
>  
> -#include <linux/nfs.h>
>  #include <linux/nfsd_idmap.h>
> -#include <linux/lockd/bind.h>
> -#include <linux/sunrpc/svc.h>
>  #include <linux/sunrpc/svcsock.h>
>  #include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/cache.h>
> -#include <linux/nfsd/xdr.h>
>  #include <linux/nfsd/syscall.h>
>  #include <linux/lockd/lockd.h>
>  #include <linux/sunrpc/clnt.h>
>  
> -#include <asm/uaccess.h>
> -#include <net/ipv6.h>
> -
>  /*
>   *	We have a single directory with 9 nodes in it.
>   */
> diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
> index 01965b2..01f142f 100644
> --- a/fs/nfsd/nfsfh.c
> +++ b/fs/nfsd/nfsfh.c
> @@ -9,17 +9,8 @@
>   * ... and again Southern-Winter 2001 to support export_operations
>   */
>  
> -#include <linux/slab.h>
> -#include <linux/fs.h>
> -#include <linux/unistd.h>
> -#include <linux/string.h>
> -#include <linux/stat.h>
> -#include <linux/dcache.h>
>  #include <linux/exportfs.h>
> -#include <linux/mount.h>
>  
> -#include <linux/sunrpc/clnt.h>
> -#include <linux/sunrpc/svc.h>
>  #include <linux/sunrpc/svcauth_gss.h>
>  #include <linux/nfsd/nfsd.h>
>  #include "auth.h"
> diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
> index c5393d1..2307693 100644
> --- a/fs/nfsd/nfsproc.c
> +++ b/fs/nfsd/nfsproc.c
> @@ -7,21 +7,8 @@
>   * Copyright (C) 1995-1997 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/linkage.h>
> -#include <linux/time.h>
> -#include <linux/errno.h>
> -#include <linux/fs.h>
> -#include <linux/stat.h>
> -#include <linux/fcntl.h>
> -#include <linux/net.h>
> -#include <linux/in.h>
>  #include <linux/namei.h>
> -#include <linux/unistd.h>
> -#include <linux/slab.h>
>  
> -#include <linux/sunrpc/clnt.h>
> -#include <linux/sunrpc/svc.h>
> -#include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/cache.h>
>  #include <linux/nfsd/xdr.h>
>  
> diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
> index 67ea83e..ab4b321 100644
> --- a/fs/nfsd/nfssvc.c
> +++ b/fs/nfsd/nfssvc.c
> @@ -8,30 +8,15 @@
>   * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/module.h>
>  #include <linux/sched.h>
> -#include <linux/time.h>
> -#include <linux/errno.h>
> -#include <linux/nfs.h>
> -#include <linux/in.h>
> -#include <linux/uio.h>
> -#include <linux/unistd.h>
> -#include <linux/slab.h>
> -#include <linux/smp.h>
>  #include <linux/freezer.h>
>  #include <linux/fs_struct.h>
> -#include <linux/kthread.h>
>  #include <linux/swap.h>
>  
> -#include <linux/sunrpc/types.h>
>  #include <linux/sunrpc/stats.h>
> -#include <linux/sunrpc/svc.h>
>  #include <linux/sunrpc/svcsock.h>
> -#include <linux/sunrpc/cache.h>
>  #include <linux/nfsd/nfsd.h>
> -#include <linux/nfsd/stats.h>
>  #include <linux/nfsd/cache.h>
> -#include <linux/nfsd/syscall.h>
>  #include <linux/lockd/bind.h>
>  #include <linux/nfsacl.h>
>  #include <linux/seq_file.h>
> diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c
> index afd08e2..5e0603d 100644
> --- a/fs/nfsd/nfsxdr.c
> +++ b/fs/nfsd/nfsxdr.c
> @@ -6,15 +6,7 @@
>   * Copyright (C) 1995, 1996 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/types.h>
> -#include <linux/time.h>
> -#include <linux/nfs.h>
> -#include <linux/vfs.h>
> -#include <linux/sunrpc/xdr.h>
> -#include <linux/sunrpc/svc.h>
> -#include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/xdr.h>
> -#include <linux/mm.h>
>  #include "auth.h"
>  
>  #define NFSDDBG_FACILITY		NFSDDBG_XDR
> diff --git a/fs/nfsd/stats.c b/fs/nfsd/stats.c
> index 71944cd..e3e411e 100644
> --- a/fs/nfsd/stats.c
> +++ b/fs/nfsd/stats.c
> @@ -23,14 +23,9 @@
>   * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/kernel.h>
> -#include <linux/time.h>
> -#include <linux/proc_fs.h>
>  #include <linux/seq_file.h>
> -#include <linux/stat.h>
>  #include <linux/module.h>
>  
> -#include <linux/sunrpc/svc.h>
>  #include <linux/sunrpc/stats.h>
>  #include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/stats.h>
> diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
> index 6385739..a899429 100644
> --- a/fs/nfsd/vfs.c
> +++ b/fs/nfsd/vfs.c
> @@ -16,43 +16,22 @@
>   * Zerocpy NFS support (C) 2002 Hirokazu Takahashi <taka-jCdQPDEk3idL9jVzuh4AOg@public.gmane.org>
>   */
>  
> -#include <linux/string.h>
> -#include <linux/time.h>
> -#include <linux/errno.h>
>  #include <linux/fs.h>
>  #include <linux/file.h>
> -#include <linux/mount.h>
> -#include <linux/major.h>
>  #include <linux/splice.h>
> -#include <linux/proc_fs.h>
> -#include <linux/stat.h>
>  #include <linux/fcntl.h>
> -#include <linux/net.h>
> -#include <linux/unistd.h>
> -#include <linux/slab.h>
> -#include <linux/pagemap.h>
> -#include <linux/in.h>
> -#include <linux/module.h>
>  #include <linux/namei.h>
> -#include <linux/vfs.h>
> -#include <linux/delay.h>

This one is needed on some arches. This patch will have
to sit in linux-next for a while and collect some breakage. I'll monitor it's progress.

I'm sending a ver 2 patch.

Boaz

> -#include <linux/sunrpc/svc.h>
>  #include <linux/nfsd/nfsd.h>
>  #ifdef CONFIG_NFSD_V3
> -#include <linux/nfs3.h>
>  #include <linux/nfsd/xdr3.h>
>  #endif /* CONFIG_NFSD_V3 */
> -#include <linux/nfsd/nfsfh.h>
>  #include <linux/quotaops.h>
>  #include <linux/fsnotify.h>
> -#include <linux/posix_acl.h>
>  #include <linux/posix_acl_xattr.h>
>  #include <linux/xattr.h>
>  #ifdef CONFIG_NFSD_V4
> -#include <linux/nfs4.h>
>  #include <linux/nfs4_acl.h>
>  #include <linux/nfsd_idmap.h>
> -#include <linux/security.h>
>  #endif /* CONFIG_NFSD_V4 */
>  #include <linux/jhash.h>
>  #include <linux/ima.h>

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [pnfs] [PATCH 5/6] nfsd: Source files #include cleanups
@ 2009-11-23 17:26       ` Boaz Harrosh
  0 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-23 17:26 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, NFS list, pNFS Mailing List,
	Trond Myklebust
  Cc: linux-fsdevel, Randy Dunlap, Al Viro

On 11/23/2009 05:59 PM, Boaz Harrosh wrote:
> Now that the headers are fixed and carry their own wait, all fs/nfsd/
> source files can include a minimal set of headers. and still compile just
> fine.
> 
> This patch should improve the compilation speed of the nfsd module.
> 
> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> ---
>  fs/nfsd/auth.c         |    4 ----
>  fs/nfsd/export.c       |   15 ---------------
>  fs/nfsd/lockd.c        |    5 -----
>  fs/nfsd/nfs2acl.c      |    4 ----
>  fs/nfsd/nfs3acl.c      |    3 ---
>  fs/nfsd/nfs3proc.c     |   13 -------------
>  fs/nfsd/nfs3xdr.c      |   11 -----------
>  fs/nfsd/nfs4acl.c      |    8 --------
>  fs/nfsd/nfs4callback.c |   13 -------------
>  fs/nfsd/nfs4idmap.c    |   15 +--------------
>  fs/nfsd/nfs4proc.c     |   10 ----------
>  fs/nfsd/nfs4recover.c  |    8 --------
>  fs/nfsd/nfs4state.c    |   15 ---------------
>  fs/nfsd/nfs4xdr.c      |   12 +-----------
>  fs/nfsd/nfscache.c     |    8 --------
>  fs/nfsd/nfsctl.c       |   25 -------------------------
>  fs/nfsd/nfsfh.c        |    9 ---------
>  fs/nfsd/nfsproc.c      |   13 -------------
>  fs/nfsd/nfssvc.c       |   15 ---------------
>  fs/nfsd/nfsxdr.c       |    8 --------
>  fs/nfsd/stats.c        |    5 -----
>  fs/nfsd/vfs.c          |   21 ---------------------
>  22 files changed, 2 insertions(+), 238 deletions(-)
> 
> diff --git a/fs/nfsd/auth.c b/fs/nfsd/auth.c
> index 36fcabb..ad354d2 100644
> --- a/fs/nfsd/auth.c
> +++ b/fs/nfsd/auth.c
> @@ -4,12 +4,8 @@
>   * Copyright (C) 1995, 1996 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/types.h>
>  #include <linux/sched.h>
> -#include <linux/sunrpc/svc.h>
> -#include <linux/sunrpc/svcauth.h>
>  #include <linux/nfsd/nfsd.h>
> -#include <linux/nfsd/export.h>
>  #include "auth.h"
>  
>  int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp)
> diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> index b73baba..68e63f4 100644
> --- a/fs/nfsd/export.c
> +++ b/fs/nfsd/export.c
> @@ -14,27 +14,12 @@
>   * Copyright (C) 1995, 1996 Olaf Kirch, <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/unistd.h>
> -#include <linux/slab.h>
> -#include <linux/stat.h>
> -#include <linux/in.h>
> -#include <linux/seq_file.h>
> -#include <linux/syscalls.h>
> -#include <linux/rwsem.h>
> -#include <linux/dcache.h>
>  #include <linux/namei.h>
> -#include <linux/mount.h>
> -#include <linux/hash.h>
>  #include <linux/module.h>
>  #include <linux/exportfs.h>
>  
> -#include <linux/sunrpc/svc.h>
>  #include <linux/nfsd/nfsd.h>
> -#include <linux/nfsd/nfsfh.h>
>  #include <linux/nfsd/syscall.h>
> -#include <linux/lockd/bind.h>
> -#include <linux/sunrpc/msg_prot.h>
> -#include <linux/sunrpc/gss_api.h>
>  #include <net/ipv6.h>
>  
>  #define NFSDDBG_FACILITY	NFSDDBG_EXPORT
> diff --git a/fs/nfsd/lockd.c b/fs/nfsd/lockd.c
> index b2786a5..19a16e1 100644
> --- a/fs/nfsd/lockd.c
> +++ b/fs/nfsd/lockd.c
> @@ -8,12 +8,7 @@
>   * Copyright (C) 1996, Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/types.h>
> -#include <linux/fs.h>
>  #include <linux/file.h>
> -#include <linux/mount.h>
> -#include <linux/sunrpc/clnt.h>
> -#include <linux/sunrpc/svc.h>
>  #include <linux/nfsd/nfsd.h>
>  #include <linux/lockd/bind.h>
>  
> diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c
> index e2a17f0..64c368b 100644
> --- a/fs/nfsd/nfs2acl.c
> +++ b/fs/nfsd/nfs2acl.c
> @@ -6,13 +6,9 @@
>   * Copyright (C) 2002-2003 Andreas Gruenbacher <agruen@suse.de>
>   */
>  
> -#include <linux/sunrpc/svc.h>
> -#include <linux/nfs.h>
>  #include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/cache.h>
> -#include <linux/nfsd/xdr.h>
>  #include <linux/nfsd/xdr3.h>
> -#include <linux/posix_acl.h>
>  #include <linux/nfsacl.h>
>  
>  #define NFSDDBG_FACILITY		NFSDDBG_PROC
> diff --git a/fs/nfsd/nfs3acl.c b/fs/nfsd/nfs3acl.c
> index ff73596..8e44949 100644
> --- a/fs/nfsd/nfs3acl.c
> +++ b/fs/nfsd/nfs3acl.c
> @@ -6,12 +6,9 @@
>   * Copyright (C) 2002-2003 Andreas Gruenbacher <agruen@suse.de>
>   */
>  
> -#include <linux/sunrpc/svc.h>
> -#include <linux/nfs3.h>
>  #include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/cache.h>
>  #include <linux/nfsd/xdr3.h>
> -#include <linux/posix_acl.h>
>  #include <linux/nfsacl.h>
>  
>  #define RETURN_STATUS(st)	{ resp->status = (st); return (st); }
> diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
> index a713c41..ed6112e 100644
> --- a/fs/nfsd/nfs3proc.c
> +++ b/fs/nfsd/nfs3proc.c
> @@ -6,25 +6,12 @@
>   * Copyright (C) 1996, 1997, 1998 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/linkage.h>
> -#include <linux/time.h>
> -#include <linux/errno.h>
>  #include <linux/fs.h>
>  #include <linux/ext2_fs.h>
> -#include <linux/stat.h>
> -#include <linux/fcntl.h>
> -#include <linux/net.h>
> -#include <linux/in.h>
> -#include <linux/unistd.h>
> -#include <linux/slab.h>
> -#include <linux/major.h>
>  #include <linux/magic.h>
>  
> -#include <linux/sunrpc/svc.h>
> -#include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/cache.h>
>  #include <linux/nfsd/xdr3.h>
> -#include <linux/nfs3.h>
>  
>  #define NFSDDBG_FACILITY		NFSDDBG_PROC
>  
> diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
> index edf926e..97b3619 100644
> --- a/fs/nfsd/nfs3xdr.c
> +++ b/fs/nfsd/nfs3xdr.c
> @@ -8,18 +8,7 @@
>   * 2003-08-09 Jamie Lokier: Use htonl() for nanoseconds, not htons()!
>   */
>  
> -#include <linux/types.h>
> -#include <linux/time.h>
> -#include <linux/nfs3.h>
> -#include <linux/list.h>
> -#include <linux/spinlock.h>
> -#include <linux/dcache.h>
>  #include <linux/namei.h>
> -#include <linux/mm.h>
> -#include <linux/vfs.h>
> -#include <linux/sunrpc/xdr.h>
> -#include <linux/sunrpc/svc.h>
> -#include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/xdr3.h>
>  #include "auth.h"
>  
> diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
> index 6d9c6aa..d6f0cea 100644
> --- a/fs/nfsd/nfs4acl.c
> +++ b/fs/nfsd/nfs4acl.c
> @@ -36,15 +36,7 @@
>   *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>   */
>  
> -#include <linux/string.h>
> -#include <linux/slab.h>
> -#include <linux/list.h>
> -#include <linux/types.h>
> -#include <linux/fs.h>
> -#include <linux/module.h>
>  #include <linux/nfs_fs.h>
> -#include <linux/posix_acl.h>
> -#include <linux/nfs4.h>
>  #include <linux/nfs4_acl.h>
>  
>  
> diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
> index 24e8d78..4fe3960 100644
> --- a/fs/nfsd/nfs4callback.c
> +++ b/fs/nfsd/nfs4callback.c
> @@ -33,22 +33,9 @@
>   *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>   */
>  
> -#include <linux/module.h>
> -#include <linux/list.h>
> -#include <linux/inet.h>
> -#include <linux/errno.h>
> -#include <linux/delay.h>
> -#include <linux/sched.h>
> -#include <linux/kthread.h>
> -#include <linux/sunrpc/xdr.h>
> -#include <linux/sunrpc/svc.h>
>  #include <linux/sunrpc/clnt.h>
> -#include <linux/sunrpc/svcsock.h>
>  #include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/state.h>
> -#include <linux/sunrpc/sched.h>
> -#include <linux/nfs4.h>
> -#include <linux/sunrpc/xprtsock.h>
>  
>  #define NFSDDBG_FACILITY                NFSDDBG_PROC
>  
> diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
> index ba2c199..8e518cd 100644
> --- a/fs/nfsd/nfs4idmap.c
> +++ b/fs/nfsd/nfs4idmap.c
> @@ -35,22 +35,9 @@
>   */
>  
>  #include <linux/module.h>
> -#include <linux/init.h>
> -
> -#include <linux/mm.h>
> -#include <linux/errno.h>
> -#include <linux/string.h>
> -#include <linux/sunrpc/clnt.h>
> -#include <linux/nfs.h>
> -#include <linux/nfs4.h>
> -#include <linux/nfs_fs.h>
> -#include <linux/nfs_page.h>
> -#include <linux/sunrpc/cache.h>
>  #include <linux/nfsd_idmap.h>
> -#include <linux/list.h>
> -#include <linux/time.h>
>  #include <linux/seq_file.h>
> -#include <linux/sunrpc/svcauth.h>
> +#include <linux/sched.h>
>  
>  /*
>   * Cache entry
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index bebc0c2..e3c1e6d 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -34,20 +34,10 @@
>   *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
>   *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>   */
> -
> -#include <linux/param.h>
> -#include <linux/major.h>
> -#include <linux/slab.h>
>  #include <linux/file.h>
>  
> -#include <linux/sunrpc/svc.h>
> -#include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/cache.h>
> -#include <linux/nfs4.h>
> -#include <linux/nfsd/state.h>
>  #include <linux/nfsd/xdr4.h>
> -#include <linux/nfs4_acl.h>
> -#include <linux/sunrpc/gss_api.h>
>  
>  #define NFSDDBG_FACILITY		NFSDDBG_PROC
>  
> diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
> index b534840..be9e712 100644
> --- a/fs/nfsd/nfs4recover.c
> +++ b/fs/nfsd/nfs4recover.c
> @@ -33,20 +33,12 @@
>  *
>  */
>  
> -#include <linux/err.h>
> -#include <linux/sunrpc/svc.h>
>  #include <linux/nfsd/nfsd.h>
> -#include <linux/nfs4.h>
>  #include <linux/nfsd/state.h>
> -#include <linux/nfsd/xdr4.h>
> -#include <linux/param.h>
>  #include <linux/file.h>
>  #include <linux/namei.h>
> -#include <asm/uaccess.h>
> -#include <linux/scatterlist.h>
>  #include <linux/crypto.h>
>  #include <linux/sched.h>
> -#include <linux/mount.h>
>  
>  #define NFSDDBG_FACILITY                NFSDDBG_PROC
>  
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index c8b621a..93f801c 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -34,26 +34,11 @@
>  *
>  */
>  
> -#include <linux/param.h>
> -#include <linux/major.h>
> -#include <linux/slab.h>
> -
> -#include <linux/sunrpc/svc.h>
> -#include <linux/nfsd/nfsd.h>
> -#include <linux/nfsd/cache.h>
>  #include <linux/file.h>
> -#include <linux/mount.h>
> -#include <linux/workqueue.h>
>  #include <linux/smp_lock.h>
> -#include <linux/kthread.h>
> -#include <linux/nfs4.h>
> -#include <linux/nfsd/state.h>
>  #include <linux/nfsd/xdr4.h>
>  #include <linux/namei.h>
>  #include <linux/swap.h>
> -#include <linux/mutex.h>
> -#include <linux/lockd/bind.h>
> -#include <linux/module.h>
>  #include <linux/sunrpc/svcauth_gss.h>
>  #include <linux/sunrpc/clnt.h>
>  
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index 0fbd50c..444eeca 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -40,22 +40,12 @@
>   * at the end of nfs4svc_decode_compoundargs.
>   */
>  
> -#include <linux/param.h>
> -#include <linux/smp.h>
> -#include <linux/fs.h>
>  #include <linux/namei.h>
> -#include <linux/vfs.h>
> +#include <linux/statfs.h>
>  #include <linux/utsname.h>
> -#include <linux/sunrpc/xdr.h>
> -#include <linux/sunrpc/svc.h>
> -#include <linux/sunrpc/clnt.h>
> -#include <linux/nfsd/nfsd.h>
> -#include <linux/nfsd/state.h>
>  #include <linux/nfsd/xdr4.h>
>  #include <linux/nfsd_idmap.h>
> -#include <linux/nfs4.h>
>  #include <linux/nfs4_acl.h>
> -#include <linux/sunrpc/gss_api.h>
>  #include <linux/sunrpc/svcauth_gss.h>
>  
>  #define NFSDDBG_FACILITY		NFSDDBG_XDR
> diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
> index 4638635..96694b8 100644
> --- a/fs/nfsd/nfscache.c
> +++ b/fs/nfsd/nfscache.c
> @@ -10,14 +10,6 @@
>   * Copyright (C) 1995, 1996 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/kernel.h>
> -#include <linux/time.h>
> -#include <linux/slab.h>
> -#include <linux/string.h>
> -#include <linux/spinlock.h>
> -#include <linux/list.h>
> -
> -#include <linux/sunrpc/svc.h>
>  #include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/cache.h>
>  
> diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
> index 5c01fc1..e4f49fd 100644
> --- a/fs/nfsd/nfsctl.c
> +++ b/fs/nfsd/nfsctl.c
> @@ -6,42 +6,17 @@
>   * Copyright (C) 1995, 1996 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/module.h>
> -
> -#include <linux/linkage.h>
> -#include <linux/time.h>
> -#include <linux/errno.h>
> -#include <linux/fs.h>
>  #include <linux/namei.h>
> -#include <linux/fcntl.h>
> -#include <linux/net.h>
> -#include <linux/in.h>
> -#include <linux/syscalls.h>
> -#include <linux/unistd.h>
> -#include <linux/slab.h>
> -#include <linux/proc_fs.h>
> -#include <linux/seq_file.h>
> -#include <linux/pagemap.h>
> -#include <linux/init.h>
> -#include <linux/inet.h>
> -#include <linux/string.h>
>  #include <linux/ctype.h>
>  
> -#include <linux/nfs.h>
>  #include <linux/nfsd_idmap.h>
> -#include <linux/lockd/bind.h>
> -#include <linux/sunrpc/svc.h>
>  #include <linux/sunrpc/svcsock.h>
>  #include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/cache.h>
> -#include <linux/nfsd/xdr.h>
>  #include <linux/nfsd/syscall.h>
>  #include <linux/lockd/lockd.h>
>  #include <linux/sunrpc/clnt.h>
>  
> -#include <asm/uaccess.h>
> -#include <net/ipv6.h>
> -
>  /*
>   *	We have a single directory with 9 nodes in it.
>   */
> diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
> index 01965b2..01f142f 100644
> --- a/fs/nfsd/nfsfh.c
> +++ b/fs/nfsd/nfsfh.c
> @@ -9,17 +9,8 @@
>   * ... and again Southern-Winter 2001 to support export_operations
>   */
>  
> -#include <linux/slab.h>
> -#include <linux/fs.h>
> -#include <linux/unistd.h>
> -#include <linux/string.h>
> -#include <linux/stat.h>
> -#include <linux/dcache.h>
>  #include <linux/exportfs.h>
> -#include <linux/mount.h>
>  
> -#include <linux/sunrpc/clnt.h>
> -#include <linux/sunrpc/svc.h>
>  #include <linux/sunrpc/svcauth_gss.h>
>  #include <linux/nfsd/nfsd.h>
>  #include "auth.h"
> diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
> index c5393d1..2307693 100644
> --- a/fs/nfsd/nfsproc.c
> +++ b/fs/nfsd/nfsproc.c
> @@ -7,21 +7,8 @@
>   * Copyright (C) 1995-1997 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/linkage.h>
> -#include <linux/time.h>
> -#include <linux/errno.h>
> -#include <linux/fs.h>
> -#include <linux/stat.h>
> -#include <linux/fcntl.h>
> -#include <linux/net.h>
> -#include <linux/in.h>
>  #include <linux/namei.h>
> -#include <linux/unistd.h>
> -#include <linux/slab.h>
>  
> -#include <linux/sunrpc/clnt.h>
> -#include <linux/sunrpc/svc.h>
> -#include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/cache.h>
>  #include <linux/nfsd/xdr.h>
>  
> diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
> index 67ea83e..ab4b321 100644
> --- a/fs/nfsd/nfssvc.c
> +++ b/fs/nfsd/nfssvc.c
> @@ -8,30 +8,15 @@
>   * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/module.h>
>  #include <linux/sched.h>
> -#include <linux/time.h>
> -#include <linux/errno.h>
> -#include <linux/nfs.h>
> -#include <linux/in.h>
> -#include <linux/uio.h>
> -#include <linux/unistd.h>
> -#include <linux/slab.h>
> -#include <linux/smp.h>
>  #include <linux/freezer.h>
>  #include <linux/fs_struct.h>
> -#include <linux/kthread.h>
>  #include <linux/swap.h>
>  
> -#include <linux/sunrpc/types.h>
>  #include <linux/sunrpc/stats.h>
> -#include <linux/sunrpc/svc.h>
>  #include <linux/sunrpc/svcsock.h>
> -#include <linux/sunrpc/cache.h>
>  #include <linux/nfsd/nfsd.h>
> -#include <linux/nfsd/stats.h>
>  #include <linux/nfsd/cache.h>
> -#include <linux/nfsd/syscall.h>
>  #include <linux/lockd/bind.h>
>  #include <linux/nfsacl.h>
>  #include <linux/seq_file.h>
> diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c
> index afd08e2..5e0603d 100644
> --- a/fs/nfsd/nfsxdr.c
> +++ b/fs/nfsd/nfsxdr.c
> @@ -6,15 +6,7 @@
>   * Copyright (C) 1995, 1996 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/types.h>
> -#include <linux/time.h>
> -#include <linux/nfs.h>
> -#include <linux/vfs.h>
> -#include <linux/sunrpc/xdr.h>
> -#include <linux/sunrpc/svc.h>
> -#include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/xdr.h>
> -#include <linux/mm.h>
>  #include "auth.h"
>  
>  #define NFSDDBG_FACILITY		NFSDDBG_XDR
> diff --git a/fs/nfsd/stats.c b/fs/nfsd/stats.c
> index 71944cd..e3e411e 100644
> --- a/fs/nfsd/stats.c
> +++ b/fs/nfsd/stats.c
> @@ -23,14 +23,9 @@
>   * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
>   */
>  
> -#include <linux/kernel.h>
> -#include <linux/time.h>
> -#include <linux/proc_fs.h>
>  #include <linux/seq_file.h>
> -#include <linux/stat.h>
>  #include <linux/module.h>
>  
> -#include <linux/sunrpc/svc.h>
>  #include <linux/sunrpc/stats.h>
>  #include <linux/nfsd/nfsd.h>
>  #include <linux/nfsd/stats.h>
> diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
> index 6385739..a899429 100644
> --- a/fs/nfsd/vfs.c
> +++ b/fs/nfsd/vfs.c
> @@ -16,43 +16,22 @@
>   * Zerocpy NFS support (C) 2002 Hirokazu Takahashi <taka-jCdQPDEk3idL9jVzuh4AOg@public.gmane.org>
>   */
>  
> -#include <linux/string.h>
> -#include <linux/time.h>
> -#include <linux/errno.h>
>  #include <linux/fs.h>
>  #include <linux/file.h>
> -#include <linux/mount.h>
> -#include <linux/major.h>
>  #include <linux/splice.h>
> -#include <linux/proc_fs.h>
> -#include <linux/stat.h>
>  #include <linux/fcntl.h>
> -#include <linux/net.h>
> -#include <linux/unistd.h>
> -#include <linux/slab.h>
> -#include <linux/pagemap.h>
> -#include <linux/in.h>
> -#include <linux/module.h>
>  #include <linux/namei.h>
> -#include <linux/vfs.h>
> -#include <linux/delay.h>

This one is needed on some arches. This patch will have
to sit in linux-next for a while and collect some breakage. I'll monitor it's progress.

I'm sending a ver 2 patch.

Boaz

> -#include <linux/sunrpc/svc.h>
>  #include <linux/nfsd/nfsd.h>
>  #ifdef CONFIG_NFSD_V3
> -#include <linux/nfs3.h>
>  #include <linux/nfsd/xdr3.h>
>  #endif /* CONFIG_NFSD_V3 */
> -#include <linux/nfsd/nfsfh.h>
>  #include <linux/quotaops.h>
>  #include <linux/fsnotify.h>
> -#include <linux/posix_acl.h>
>  #include <linux/posix_acl_xattr.h>
>  #include <linux/xattr.h>
>  #ifdef CONFIG_NFSD_V4
> -#include <linux/nfs4.h>
>  #include <linux/nfs4_acl.h>
>  #include <linux/nfsd_idmap.h>
> -#include <linux/security.h>
>  #endif /* CONFIG_NFSD_V4 */
>  #include <linux/jhash.h>
>  #include <linux/ima.h>


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCHSET 0-6] nfsd: #includes cleanup
  2009-11-23 15:54 ` Boaz Harrosh
                   ` (2 preceding siblings ...)
  (?)
@ 2009-11-23 22:14 ` J. Bruce Fields
       [not found]   ` <20091123221415.GE8534-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
  -1 siblings, 1 reply; 26+ messages in thread
From: J. Bruce Fields @ 2009-11-23 22:14 UTC (permalink / raw)
  To: Boaz Harrosh
  Cc: Benny Halevy, Trond Myklebust, Andrew Morton, pNFS Mailing List,
	Al Viro, NFS list, linux-fsdevel, Randy Dunlap

On Mon, Nov 23, 2009 at 05:54:33PM +0200, Boaz Harrosh wrote:
> 
> Hi Bruce
> 
> This time I've based the patchset on the:
> 	git://linux-nfs.org/~bfields/linux.git for-2.6.33 branch
> 
> I was hoping to find that nfsd.h cleanup you sent to the mailing list
> the other day. But I don't see it. Should I rebase this work on some
> other branch?

Apologies, I applied it but hadn't pushed it out; done now.  Could you
rebase onto that?

--b.

> would you like to submit that patch, which made lots of
> sense in my opinion, and I'll wait and base this work on that?
> [On the other we might be able to move the complete nfsd.h to fs/nfsd/]
> 
> I have gone deeper and wider this time. And it is based on upcoming
> main-line, not pnfs tree like before. So it can actually be applied
> this time. Please lets decide on some time table because these things
> are moving targets.
> 
> I've removed the hunk from posix_acl.h that Trond did not like, I'll
> take care of that one, another time. (For late comers, posix_acl.h intimately
> fiddles with fs.h types but does not #include it)
> 
> With these patches Benny will suffer on his next rebase, both in conflicts
> and a few miss-compiling files, but it should be trivial to fix, I'll help.
> 
> The next step after these patches, is to move lots of files from include/linux/nfsd/*
> to fs/nfsd/... I have found that the include/linux/nfsd/xdr?.h, nfsd.h and cache.h
> are all essentially only used by fs/nfsd source, except they are *wrongly* included by
> some compat.c source files. Once I'll fix that they can move.
> 
> [PATCH 1/6] nfsd: Remove nfsfh.h dependency on sunrpc
>     Bruce, what about this patch. It is independent of the others. Currently sunrpc
>     is loaded/unloaded with nfs or nfsd. exportfs and filesystems don't expect to need
>     it. It works because depmod is doing it's job. Do we really need this dprintk?
> 
> [PATCH 2/6] sunrpc: Clean never used include files
> [PATCH 3/6] nfsd: Fix independence of a few nfsd related headers
>     I wish these two patches could go through Bruce's tree as one group.
>     Who's ACKs do we need on them? Trond?
> 
> [PATCH 4/6] nfsd: Headers Independence and include cleanups
> [PATCH 5/6] nfsd: Source files #include cleanups
>     Please review these patches to understand the motivation behind all
>     this.
> 
> [PATCH 6/6] compat.c: Remove dependence on nfsd private headers
>     This patch is a beginning of the next step to move the nfsd private
>     headers to inside the fs/nfsd subdirectory.
> 
> Thanks
> Boaz
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/6] nfsd: Remove nfsfh.h dependency on sunrpc
  2009-11-23 15:58     ` Boaz Harrosh
@ 2009-11-23 22:17         ` J. Bruce Fields
  -1 siblings, 0 replies; 26+ messages in thread
From: J. Bruce Fields @ 2009-11-23 22:17 UTC (permalink / raw)
  To: Boaz Harrosh
  Cc: Benny Halevy, NFS list, pNFS Mailing List, Trond Myklebust,
	Andrew Morton, linux-fsdevel, Al Viro, Randy Dunlap

On Mon, Nov 23, 2009 at 05:58:30PM +0200, Boaz Harrosh wrote:
> linux/nfsd/nfsfh.h defines some low level types which
> are needed by exportfs and though by filesystems.
> 
> In the file, fh_lock() uses the sunrpc dprint facility which
> might cause a dependency of exportfs (and filesystems) on

"might cause"?

Does mere inclusion of this .h (without referencing fh_lock_nested() or
its callers) actually create a dependency?

--b.

> sunrpc which is unwanted / unexpected.
> 
> Remove the debug-print from fh_lock() and avoid this dependency.
> 
> Signed-off-by: Boaz Harrosh <bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
> ---
>  include/linux/nfsd/nfsfh.h |    4 ----
>  1 files changed, 0 insertions(+), 4 deletions(-)
> 
> diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
> index 8f641c9..2973e11 100644
> --- a/include/linux/nfsd/nfsfh.h
> +++ b/include/linux/nfsd/nfsfh.h
> @@ -20,7 +20,6 @@
>  # include <linux/fs.h>
>  #endif
>  #include <linux/nfsd/const.h>
> -#include <linux/nfsd/debug.h>
>  
>  /*
>   * This is the old "dentry style" Linux NFSv2 file handle.
> @@ -329,9 +328,6 @@ fh_lock_nested(struct svc_fh *fhp, unsigned int subclass)
>  	struct dentry	*dentry = fhp->fh_dentry;
>  	struct inode	*inode;
>  
> -	dfprintk(FILEOP, "nfsd: fh_lock(%s) locked = %d\n",
> -			SVCFH_fmt(fhp), fhp->fh_locked);
> -
>  	BUG_ON(!dentry);
>  
>  	if (fhp->fh_locked) {
> -- 
> 1.6.5.2
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/6] nfsd: Remove nfsfh.h dependency on sunrpc
@ 2009-11-23 22:17         ` J. Bruce Fields
  0 siblings, 0 replies; 26+ messages in thread
From: J. Bruce Fields @ 2009-11-23 22:17 UTC (permalink / raw)
  To: Boaz Harrosh
  Cc: Benny Halevy, NFS list, pNFS Mailing List, Trond Myklebust,
	Andrew Morton, linux-fsdevel, Al Viro, Randy Dunlap

On Mon, Nov 23, 2009 at 05:58:30PM +0200, Boaz Harrosh wrote:
> linux/nfsd/nfsfh.h defines some low level types which
> are needed by exportfs and though by filesystems.
> 
> In the file, fh_lock() uses the sunrpc dprint facility which
> might cause a dependency of exportfs (and filesystems) on

"might cause"?

Does mere inclusion of this .h (without referencing fh_lock_nested() or
its callers) actually create a dependency?

--b.

> sunrpc which is unwanted / unexpected.
> 
> Remove the debug-print from fh_lock() and avoid this dependency.
> 
> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> ---
>  include/linux/nfsd/nfsfh.h |    4 ----
>  1 files changed, 0 insertions(+), 4 deletions(-)
> 
> diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
> index 8f641c9..2973e11 100644
> --- a/include/linux/nfsd/nfsfh.h
> +++ b/include/linux/nfsd/nfsfh.h
> @@ -20,7 +20,6 @@
>  # include <linux/fs.h>
>  #endif
>  #include <linux/nfsd/const.h>
> -#include <linux/nfsd/debug.h>
>  
>  /*
>   * This is the old "dentry style" Linux NFSv2 file handle.
> @@ -329,9 +328,6 @@ fh_lock_nested(struct svc_fh *fhp, unsigned int subclass)
>  	struct dentry	*dentry = fhp->fh_dentry;
>  	struct inode	*inode;
>  
> -	dfprintk(FILEOP, "nfsd: fh_lock(%s) locked = %d\n",
> -			SVCFH_fmt(fhp), fhp->fh_locked);
> -
>  	BUG_ON(!dentry);
>  
>  	if (fhp->fh_locked) {
> -- 
> 1.6.5.2
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 5/6 version2] nfsd: Source files #include cleanups
  2009-11-23 15:59 ` [PATCH 5/6] nfsd: Source files #include cleanups Boaz Harrosh
@ 2009-11-24  8:17   ` Boaz Harrosh
       [not found]   ` <1258991991-25446-1-git-send-email-bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
  1 sibling, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-24  8:17 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, NFS list, pNFS Mailing List,
	Trond Myklebust
  Cc: linux-fsdevel, Randy Dunlap, Al Viro


Now that the headers are fixed and carry their own wait, all fs/nfsd/
source files can include a minimal set of headers. and still compile just
fine.

This patch should improve the compilation speed of the nfsd module.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 fs/nfsd/auth.c         |    4 ----
 fs/nfsd/export.c       |   15 ---------------
 fs/nfsd/lockd.c        |    5 -----
 fs/nfsd/nfs2acl.c      |    4 ----
 fs/nfsd/nfs3acl.c      |    3 ---
 fs/nfsd/nfs3proc.c     |   13 -------------
 fs/nfsd/nfs3xdr.c      |   11 -----------
 fs/nfsd/nfs4acl.c      |    8 --------
 fs/nfsd/nfs4callback.c |   13 -------------
 fs/nfsd/nfs4idmap.c    |   15 +--------------
 fs/nfsd/nfs4proc.c     |   10 ----------
 fs/nfsd/nfs4recover.c  |    8 --------
 fs/nfsd/nfs4state.c    |   15 ---------------
 fs/nfsd/nfs4xdr.c      |   12 +-----------
 fs/nfsd/nfscache.c     |    8 --------
 fs/nfsd/nfsctl.c       |   25 -------------------------
 fs/nfsd/nfsfh.c        |    9 ---------
 fs/nfsd/nfsproc.c      |   13 -------------
 fs/nfsd/nfssvc.c       |   15 ---------------
 fs/nfsd/nfsxdr.c       |    8 --------
 fs/nfsd/stats.c        |    5 -----
 fs/nfsd/vfs.c          |   20 --------------------
 22 files changed, 2 insertions(+), 237 deletions(-)

diff --git a/fs/nfsd/auth.c b/fs/nfsd/auth.c
index 36fcabb..ad354d2 100644
--- a/fs/nfsd/auth.c
+++ b/fs/nfsd/auth.c
@@ -4,12 +4,8 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/types.h>
 #include <linux/sched.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/sunrpc/svcauth.h>
 #include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/export.h>
 #include "auth.h"
 
 int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp)
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index b73baba..68e63f4 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -14,27 +14,12 @@
  * Copyright (C) 1995, 1996 Olaf Kirch, <okir@monad.swb.de>
  */
 
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/stat.h>
-#include <linux/in.h>
-#include <linux/seq_file.h>
-#include <linux/syscalls.h>
-#include <linux/rwsem.h>
-#include <linux/dcache.h>
 #include <linux/namei.h>
-#include <linux/mount.h>
-#include <linux/hash.h>
 #include <linux/module.h>
 #include <linux/exportfs.h>
 
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/nfsfh.h>
 #include <linux/nfsd/syscall.h>
-#include <linux/lockd/bind.h>
-#include <linux/sunrpc/msg_prot.h>
-#include <linux/sunrpc/gss_api.h>
 #include <net/ipv6.h>
 
 #define NFSDDBG_FACILITY	NFSDDBG_EXPORT
diff --git a/fs/nfsd/lockd.c b/fs/nfsd/lockd.c
index b2786a5..19a16e1 100644
--- a/fs/nfsd/lockd.c
+++ b/fs/nfsd/lockd.c
@@ -8,12 +8,7 @@
  * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/types.h>
-#include <linux/fs.h>
 #include <linux/file.h>
-#include <linux/mount.h>
-#include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/lockd/bind.h>
 
diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c
index e2a17f0..64c368b 100644
--- a/fs/nfsd/nfs2acl.c
+++ b/fs/nfsd/nfs2acl.c
@@ -6,13 +6,9 @@
  * Copyright (C) 2002-2003 Andreas Gruenbacher <agruen@suse.de>
  */
 
-#include <linux/sunrpc/svc.h>
-#include <linux/nfs.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
-#include <linux/nfsd/xdr.h>
 #include <linux/nfsd/xdr3.h>
-#include <linux/posix_acl.h>
 #include <linux/nfsacl.h>
 
 #define NFSDDBG_FACILITY		NFSDDBG_PROC
diff --git a/fs/nfsd/nfs3acl.c b/fs/nfsd/nfs3acl.c
index ff73596..8e44949 100644
--- a/fs/nfsd/nfs3acl.c
+++ b/fs/nfsd/nfs3acl.c
@@ -6,12 +6,9 @@
  * Copyright (C) 2002-2003 Andreas Gruenbacher <agruen@suse.de>
  */
 
-#include <linux/sunrpc/svc.h>
-#include <linux/nfs3.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
 #include <linux/nfsd/xdr3.h>
-#include <linux/posix_acl.h>
 #include <linux/nfsacl.h>
 
 #define RETURN_STATUS(st)	{ resp->status = (st); return (st); }
diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
index a713c41..ed6112e 100644
--- a/fs/nfsd/nfs3proc.c
+++ b/fs/nfsd/nfs3proc.c
@@ -6,25 +6,12 @@
  * Copyright (C) 1996, 1997, 1998 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/linkage.h>
-#include <linux/time.h>
-#include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/ext2_fs.h>
-#include <linux/stat.h>
-#include <linux/fcntl.h>
-#include <linux/net.h>
-#include <linux/in.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/major.h>
 #include <linux/magic.h>
 
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
 #include <linux/nfsd/xdr3.h>
-#include <linux/nfs3.h>
 
 #define NFSDDBG_FACILITY		NFSDDBG_PROC
 
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index edf926e..97b3619 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -8,18 +8,7 @@
  * 2003-08-09 Jamie Lokier: Use htonl() for nanoseconds, not htons()!
  */
 
-#include <linux/types.h>
-#include <linux/time.h>
-#include <linux/nfs3.h>
-#include <linux/list.h>
-#include <linux/spinlock.h>
-#include <linux/dcache.h>
 #include <linux/namei.h>
-#include <linux/mm.h>
-#include <linux/vfs.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/xdr3.h>
 #include "auth.h"
 
diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
index 6d9c6aa..d6f0cea 100644
--- a/fs/nfsd/nfs4acl.c
+++ b/fs/nfsd/nfs4acl.c
@@ -36,15 +36,7 @@
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <linux/string.h>
-#include <linux/slab.h>
-#include <linux/list.h>
-#include <linux/types.h>
-#include <linux/fs.h>
-#include <linux/module.h>
 #include <linux/nfs_fs.h>
-#include <linux/posix_acl.h>
-#include <linux/nfs4.h>
 #include <linux/nfs4_acl.h>
 
 
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 24e8d78..4fe3960 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -33,22 +33,9 @@
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <linux/module.h>
-#include <linux/list.h>
-#include <linux/inet.h>
-#include <linux/errno.h>
-#include <linux/delay.h>
-#include <linux/sched.h>
-#include <linux/kthread.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/svcsock.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/state.h>
-#include <linux/sunrpc/sched.h>
-#include <linux/nfs4.h>
-#include <linux/sunrpc/xprtsock.h>
 
 #define NFSDDBG_FACILITY                NFSDDBG_PROC
 
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index ba2c199..8e518cd 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -35,22 +35,9 @@
  */
 
 #include <linux/module.h>
-#include <linux/init.h>
-
-#include <linux/mm.h>
-#include <linux/errno.h>
-#include <linux/string.h>
-#include <linux/sunrpc/clnt.h>
-#include <linux/nfs.h>
-#include <linux/nfs4.h>
-#include <linux/nfs_fs.h>
-#include <linux/nfs_page.h>
-#include <linux/sunrpc/cache.h>
 #include <linux/nfsd_idmap.h>
-#include <linux/list.h>
-#include <linux/time.h>
 #include <linux/seq_file.h>
-#include <linux/sunrpc/svcauth.h>
+#include <linux/sched.h>
 
 /*
  * Cache entry
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index bebc0c2..e3c1e6d 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -34,20 +34,10 @@
  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-
-#include <linux/param.h>
-#include <linux/major.h>
-#include <linux/slab.h>
 #include <linux/file.h>
 
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
-#include <linux/nfs4.h>
-#include <linux/nfsd/state.h>
 #include <linux/nfsd/xdr4.h>
-#include <linux/nfs4_acl.h>
-#include <linux/sunrpc/gss_api.h>
 
 #define NFSDDBG_FACILITY		NFSDDBG_PROC
 
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index b534840..be9e712 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -33,20 +33,12 @@
 *
 */
 
-#include <linux/err.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
-#include <linux/nfs4.h>
 #include <linux/nfsd/state.h>
-#include <linux/nfsd/xdr4.h>
-#include <linux/param.h>
 #include <linux/file.h>
 #include <linux/namei.h>
-#include <asm/uaccess.h>
-#include <linux/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/sched.h>
-#include <linux/mount.h>
 
 #define NFSDDBG_FACILITY                NFSDDBG_PROC
 
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index c8b621a..93f801c 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -34,26 +34,11 @@
 *
 */
 
-#include <linux/param.h>
-#include <linux/major.h>
-#include <linux/slab.h>
-
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/cache.h>
 #include <linux/file.h>
-#include <linux/mount.h>
-#include <linux/workqueue.h>
 #include <linux/smp_lock.h>
-#include <linux/kthread.h>
-#include <linux/nfs4.h>
-#include <linux/nfsd/state.h>
 #include <linux/nfsd/xdr4.h>
 #include <linux/namei.h>
 #include <linux/swap.h>
-#include <linux/mutex.h>
-#include <linux/lockd/bind.h>
-#include <linux/module.h>
 #include <linux/sunrpc/svcauth_gss.h>
 #include <linux/sunrpc/clnt.h>
 
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 0fbd50c..444eeca 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -40,22 +40,12 @@
  * at the end of nfs4svc_decode_compoundargs.
  */
 
-#include <linux/param.h>
-#include <linux/smp.h>
-#include <linux/fs.h>
 #include <linux/namei.h>
-#include <linux/vfs.h>
+#include <linux/statfs.h>
 #include <linux/utsname.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/sunrpc/clnt.h>
-#include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/state.h>
 #include <linux/nfsd/xdr4.h>
 #include <linux/nfsd_idmap.h>
-#include <linux/nfs4.h>
 #include <linux/nfs4_acl.h>
-#include <linux/sunrpc/gss_api.h>
 #include <linux/sunrpc/svcauth_gss.h>
 
 #define NFSDDBG_FACILITY		NFSDDBG_XDR
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index 4638635..96694b8 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -10,14 +10,6 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/kernel.h>
-#include <linux/time.h>
-#include <linux/slab.h>
-#include <linux/string.h>
-#include <linux/spinlock.h>
-#include <linux/list.h>
-
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
 
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 5c01fc1..e4f49fd 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -6,42 +6,17 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/module.h>
-
-#include <linux/linkage.h>
-#include <linux/time.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
 #include <linux/namei.h>
-#include <linux/fcntl.h>
-#include <linux/net.h>
-#include <linux/in.h>
-#include <linux/syscalls.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/proc_fs.h>
-#include <linux/seq_file.h>
-#include <linux/pagemap.h>
-#include <linux/init.h>
-#include <linux/inet.h>
-#include <linux/string.h>
 #include <linux/ctype.h>
 
-#include <linux/nfs.h>
 #include <linux/nfsd_idmap.h>
-#include <linux/lockd/bind.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/svcsock.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
-#include <linux/nfsd/xdr.h>
 #include <linux/nfsd/syscall.h>
 #include <linux/lockd/lockd.h>
 #include <linux/sunrpc/clnt.h>
 
-#include <asm/uaccess.h>
-#include <net/ipv6.h>
-
 /*
  *	We have a single directory with 9 nodes in it.
  */
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index 01965b2..01f142f 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -9,17 +9,8 @@
  * ... and again Southern-Winter 2001 to support export_operations
  */
 
-#include <linux/slab.h>
-#include <linux/fs.h>
-#include <linux/unistd.h>
-#include <linux/string.h>
-#include <linux/stat.h>
-#include <linux/dcache.h>
 #include <linux/exportfs.h>
-#include <linux/mount.h>
 
-#include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/svcauth_gss.h>
 #include <linux/nfsd/nfsd.h>
 #include "auth.h"
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index c5393d1..2307693 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -7,21 +7,8 @@
  * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/linkage.h>
-#include <linux/time.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/stat.h>
-#include <linux/fcntl.h>
-#include <linux/net.h>
-#include <linux/in.h>
 #include <linux/namei.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
 
-#include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
 #include <linux/nfsd/xdr.h>
 
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 67ea83e..ab4b321 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -8,30 +8,15 @@
  * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/module.h>
 #include <linux/sched.h>
-#include <linux/time.h>
-#include <linux/errno.h>
-#include <linux/nfs.h>
-#include <linux/in.h>
-#include <linux/uio.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/smp.h>
 #include <linux/freezer.h>
 #include <linux/fs_struct.h>
-#include <linux/kthread.h>
 #include <linux/swap.h>
 
-#include <linux/sunrpc/types.h>
 #include <linux/sunrpc/stats.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/svcsock.h>
-#include <linux/sunrpc/cache.h>
 #include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/stats.h>
 #include <linux/nfsd/cache.h>
-#include <linux/nfsd/syscall.h>
 #include <linux/lockd/bind.h>
 #include <linux/nfsacl.h>
 #include <linux/seq_file.h>
diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c
index afd08e2..5e0603d 100644
--- a/fs/nfsd/nfsxdr.c
+++ b/fs/nfsd/nfsxdr.c
@@ -6,15 +6,7 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/types.h>
-#include <linux/time.h>
-#include <linux/nfs.h>
-#include <linux/vfs.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/xdr.h>
-#include <linux/mm.h>
 #include "auth.h"
 
 #define NFSDDBG_FACILITY		NFSDDBG_XDR
diff --git a/fs/nfsd/stats.c b/fs/nfsd/stats.c
index 71944cd..e3e411e 100644
--- a/fs/nfsd/stats.c
+++ b/fs/nfsd/stats.c
@@ -23,14 +23,9 @@
  * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/kernel.h>
-#include <linux/time.h>
-#include <linux/proc_fs.h>
 #include <linux/seq_file.h>
-#include <linux/stat.h>
 #include <linux/module.h>
 
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/stats.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/stats.h>
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 6385739..eada691 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -16,43 +16,23 @@
  * Zerocpy NFS support (C) 2002 Hirokazu Takahashi <taka@valinux.co.jp>
  */
 
-#include <linux/string.h>
-#include <linux/time.h>
-#include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/file.h>
-#include <linux/mount.h>
-#include <linux/major.h>
 #include <linux/splice.h>
-#include <linux/proc_fs.h>
-#include <linux/stat.h>
 #include <linux/fcntl.h>
-#include <linux/net.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/pagemap.h>
-#include <linux/in.h>
-#include <linux/module.h>
 #include <linux/namei.h>
-#include <linux/vfs.h>
 #include <linux/delay.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
 #ifdef CONFIG_NFSD_V3
-#include <linux/nfs3.h>
 #include <linux/nfsd/xdr3.h>
 #endif /* CONFIG_NFSD_V3 */
-#include <linux/nfsd/nfsfh.h>
 #include <linux/quotaops.h>
 #include <linux/fsnotify.h>
-#include <linux/posix_acl.h>
 #include <linux/posix_acl_xattr.h>
 #include <linux/xattr.h>
 #ifdef CONFIG_NFSD_V4
-#include <linux/nfs4.h>
 #include <linux/nfs4_acl.h>
 #include <linux/nfsd_idmap.h>
-#include <linux/security.h>
 #endif /* CONFIG_NFSD_V4 */
 #include <linux/jhash.h>
 #include <linux/ima.h>
-- 
1.6.5.2



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/6] nfsd: Remove nfsfh.h dependency on sunrpc
  2009-11-23 22:17         ` J. Bruce Fields
@ 2009-11-24  8:28             ` Boaz Harrosh
  -1 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-24  8:28 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Benny Halevy, NFS list, pNFS Mailing List, Trond Myklebust,
	Andrew Morton, linux-fsdevel, Al Viro, Randy Dunlap

On 11/24/2009 12:17 AM, J. Bruce Fields wrote:
> On Mon, Nov 23, 2009 at 05:58:30PM +0200, Boaz Harrosh wrote:
>> linux/nfsd/nfsfh.h defines some low level types which
>> are needed by exportfs and though by filesystems.
>>
>> In the file, fh_lock() uses the sunrpc dprint facility which
>> might cause a dependency of exportfs (and filesystems) on
> 
> "might cause"?
> 
> Does mere inclusion of this .h (without referencing fh_lock_nested() or
> its callers) actually create a dependency?
> 
> --b.
> 

No, only if code actually uses fh_lock_nested it will cause a dependency.
Which is only used in fs/nfsd/...

But I would like to discourage nfsd/debug.h at this level.

Should I move fh_lock_nested() and it's siblings to the new private vfs.h header
you made, and get rid of it this way?

Boaz

>> sunrpc which is unwanted / unexpected.
>>
>> Remove the debug-print from fh_lock() and avoid this dependency.
>>
>> Signed-off-by: Boaz Harrosh <bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
>> ---
>>  include/linux/nfsd/nfsfh.h |    4 ----
>>  1 files changed, 0 insertions(+), 4 deletions(-)
>>
>> diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
>> index 8f641c9..2973e11 100644
>> --- a/include/linux/nfsd/nfsfh.h
>> +++ b/include/linux/nfsd/nfsfh.h
>> @@ -20,7 +20,6 @@
>>  # include <linux/fs.h>
>>  #endif
>>  #include <linux/nfsd/const.h>
>> -#include <linux/nfsd/debug.h>
>>  
>>  /*
>>   * This is the old "dentry style" Linux NFSv2 file handle.
>> @@ -329,9 +328,6 @@ fh_lock_nested(struct svc_fh *fhp, unsigned int subclass)
>>  	struct dentry	*dentry = fhp->fh_dentry;
>>  	struct inode	*inode;
>>  
>> -	dfprintk(FILEOP, "nfsd: fh_lock(%s) locked = %d\n",
>> -			SVCFH_fmt(fhp), fhp->fh_locked);
>> -
>>  	BUG_ON(!dentry);
>>  
>>  	if (fhp->fh_locked) {
>> -- 
>> 1.6.5.2
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/6] nfsd: Remove nfsfh.h dependency on sunrpc
@ 2009-11-24  8:28             ` Boaz Harrosh
  0 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-24  8:28 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Benny Halevy, NFS list, pNFS Mailing List, Trond Myklebust,
	Andrew Morton, linux-fsdevel, Al Viro, Randy Dunlap

On 11/24/2009 12:17 AM, J. Bruce Fields wrote:
> On Mon, Nov 23, 2009 at 05:58:30PM +0200, Boaz Harrosh wrote:
>> linux/nfsd/nfsfh.h defines some low level types which
>> are needed by exportfs and though by filesystems.
>>
>> In the file, fh_lock() uses the sunrpc dprint facility which
>> might cause a dependency of exportfs (and filesystems) on
> 
> "might cause"?
> 
> Does mere inclusion of this .h (without referencing fh_lock_nested() or
> its callers) actually create a dependency?
> 
> --b.
> 

No, only if code actually uses fh_lock_nested it will cause a dependency.
Which is only used in fs/nfsd/...

But I would like to discourage nfsd/debug.h at this level.

Should I move fh_lock_nested() and it's siblings to the new private vfs.h header
you made, and get rid of it this way?

Boaz

>> sunrpc which is unwanted / unexpected.
>>
>> Remove the debug-print from fh_lock() and avoid this dependency.
>>
>> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
>> ---
>>  include/linux/nfsd/nfsfh.h |    4 ----
>>  1 files changed, 0 insertions(+), 4 deletions(-)
>>
>> diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
>> index 8f641c9..2973e11 100644
>> --- a/include/linux/nfsd/nfsfh.h
>> +++ b/include/linux/nfsd/nfsfh.h
>> @@ -20,7 +20,6 @@
>>  # include <linux/fs.h>
>>  #endif
>>  #include <linux/nfsd/const.h>
>> -#include <linux/nfsd/debug.h>
>>  
>>  /*
>>   * This is the old "dentry style" Linux NFSv2 file handle.
>> @@ -329,9 +328,6 @@ fh_lock_nested(struct svc_fh *fhp, unsigned int subclass)
>>  	struct dentry	*dentry = fhp->fh_dentry;
>>  	struct inode	*inode;
>>  
>> -	dfprintk(FILEOP, "nfsd: fh_lock(%s) locked = %d\n",
>> -			SVCFH_fmt(fhp), fhp->fh_locked);
>> -
>>  	BUG_ON(!dentry);
>>  
>>  	if (fhp->fh_locked) {
>> -- 
>> 1.6.5.2
>>


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCHSET 0-6] nfsd: #includes cleanup
  2009-11-23 22:14 ` [PATCHSET 0-6] nfsd: #includes cleanup J. Bruce Fields
@ 2009-11-24 12:42       ` Boaz Harrosh
  0 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-24 12:42 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Benny Halevy, Trond Myklebust, Andrew Morton, pNFS Mailing List,
	Al Viro, NFS list, linux-fsdevel, Randy Dunlap

On 11/24/2009 12:14 AM, J. Bruce Fields wrote:
> On Mon, Nov 23, 2009 at 05:54:33PM +0200, Boaz Harrosh wrote:
>>
>> Hi Bruce
>>
>> This time I've based the patchset on the:
>> 	git://linux-nfs.org/~bfields/linux.git for-2.6.33 branch
>>
>> I was hoping to find that nfsd.h cleanup you sent to the mailing list
>> the other day. But I don't see it. Should I rebase this work on some
>> other branch?
> 
> Apologies, I applied it but hadn't pushed it out; done now.  Could you
> rebase onto that?
> 
> --b.
> 

OK that wasn't so bad. I'm just re-posting that one patch which changed:
	[PATCH 5/6 version3] nfsd: Source files #include cleanups

Note the version3.

Thanks
Boaz
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCHSET 0-6] nfsd: #includes cleanup
@ 2009-11-24 12:42       ` Boaz Harrosh
  0 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-24 12:42 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Benny Halevy, Trond Myklebust, Andrew Morton, pNFS Mailing List,
	Al Viro, NFS list, linux-fsdevel, Randy Dunlap

On 11/24/2009 12:14 AM, J. Bruce Fields wrote:
> On Mon, Nov 23, 2009 at 05:54:33PM +0200, Boaz Harrosh wrote:
>>
>> Hi Bruce
>>
>> This time I've based the patchset on the:
>> 	git://linux-nfs.org/~bfields/linux.git for-2.6.33 branch
>>
>> I was hoping to find that nfsd.h cleanup you sent to the mailing list
>> the other day. But I don't see it. Should I rebase this work on some
>> other branch?
> 
> Apologies, I applied it but hadn't pushed it out; done now.  Could you
> rebase onto that?
> 
> --b.
> 

OK that wasn't so bad. I'm just re-posting that one patch which changed:
	[PATCH 5/6 version3] nfsd: Source files #include cleanups

Note the version3.

Thanks
Boaz

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [pnfs] [PATCH 5/6 version3] nfsd: Source files #include cleanups
  2009-11-23 15:59 ` [PATCH 5/6] nfsd: Source files #include cleanups Boaz Harrosh
@ 2009-11-24 12:43       ` Boaz Harrosh
       [not found]   ` <1258991991-25446-1-git-send-email-bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
  1 sibling, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-24 12:43 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, NFS list, pNFS Mailing List,
	Trond Myklebust
  Cc: linux-fsdevel, Randy Dunlap, Al Viro


Now that the headers are fixed and carry their own wait, all fs/nfsd/
source files can include a minimal set of headers. and still compile just
fine.

This patch should improve the compilation speed of the nfsd module.

Signed-off-by: Boaz Harrosh <bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
---
 fs/nfsd/auth.c         |    4 ----
 fs/nfsd/export.c       |   15 ---------------
 fs/nfsd/lockd.c        |    5 -----
 fs/nfsd/nfs2acl.c      |    4 ----
 fs/nfsd/nfs3acl.c      |    3 ---
 fs/nfsd/nfs3proc.c     |   13 -------------
 fs/nfsd/nfs3xdr.c      |   11 -----------
 fs/nfsd/nfs4acl.c      |    8 --------
 fs/nfsd/nfs4callback.c |   13 -------------
 fs/nfsd/nfs4idmap.c    |   15 +--------------
 fs/nfsd/nfs4proc.c     |   10 ----------
 fs/nfsd/nfs4recover.c  |    8 --------
 fs/nfsd/nfs4state.c    |   15 ---------------
 fs/nfsd/nfs4xdr.c      |   12 +-----------
 fs/nfsd/nfscache.c     |    8 --------
 fs/nfsd/nfsctl.c       |   25 -------------------------
 fs/nfsd/nfsfh.c        |    9 ---------
 fs/nfsd/nfsproc.c      |   13 -------------
 fs/nfsd/nfssvc.c       |   15 ---------------
 fs/nfsd/nfsxdr.c       |    8 --------
 fs/nfsd/stats.c        |    5 -----
 fs/nfsd/vfs.c          |   20 --------------------
 22 files changed, 2 insertions(+), 237 deletions(-)

diff --git a/fs/nfsd/auth.c b/fs/nfsd/auth.c
index 36fcabb..ad354d2 100644
--- a/fs/nfsd/auth.c
+++ b/fs/nfsd/auth.c
@@ -4,12 +4,8 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/types.h>
 #include <linux/sched.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/sunrpc/svcauth.h>
 #include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/export.h>
 #include "auth.h"
 
 int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp)
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index b73baba..68e63f4 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -14,27 +14,12 @@
  * Copyright (C) 1995, 1996 Olaf Kirch, <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/stat.h>
-#include <linux/in.h>
-#include <linux/seq_file.h>
-#include <linux/syscalls.h>
-#include <linux/rwsem.h>
-#include <linux/dcache.h>
 #include <linux/namei.h>
-#include <linux/mount.h>
-#include <linux/hash.h>
 #include <linux/module.h>
 #include <linux/exportfs.h>
 
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/nfsfh.h>
 #include <linux/nfsd/syscall.h>
-#include <linux/lockd/bind.h>
-#include <linux/sunrpc/msg_prot.h>
-#include <linux/sunrpc/gss_api.h>
 #include <net/ipv6.h>
 
 #define NFSDDBG_FACILITY	NFSDDBG_EXPORT
diff --git a/fs/nfsd/lockd.c b/fs/nfsd/lockd.c
index 812bc64..801ef71 100644
--- a/fs/nfsd/lockd.c
+++ b/fs/nfsd/lockd.c
@@ -8,12 +8,7 @@
  * Copyright (C) 1996, Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/types.h>
-#include <linux/fs.h>
 #include <linux/file.h>
-#include <linux/mount.h>
-#include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/lockd/bind.h>
 #include "vfs.h"
diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c
index 38c883d..a54628d 100644
--- a/fs/nfsd/nfs2acl.c
+++ b/fs/nfsd/nfs2acl.c
@@ -6,13 +6,9 @@
  * Copyright (C) 2002-2003 Andreas Gruenbacher <agruen-l3A5Bk7waGM@public.gmane.org>
  */
 
-#include <linux/sunrpc/svc.h>
-#include <linux/nfs.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
-#include <linux/nfsd/xdr.h>
 #include <linux/nfsd/xdr3.h>
-#include <linux/posix_acl.h>
 #include <linux/nfsacl.h>
 #include "vfs.h"
 
diff --git a/fs/nfsd/nfs3acl.c b/fs/nfsd/nfs3acl.c
index 526d85a..2f5c61b 100644
--- a/fs/nfsd/nfs3acl.c
+++ b/fs/nfsd/nfs3acl.c
@@ -6,12 +6,9 @@
  * Copyright (C) 2002-2003 Andreas Gruenbacher <agruen-l3A5Bk7waGM@public.gmane.org>
  */
 
-#include <linux/sunrpc/svc.h>
-#include <linux/nfs3.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
 #include <linux/nfsd/xdr3.h>
-#include <linux/posix_acl.h>
 #include <linux/nfsacl.h>
 #include "vfs.h"
 
diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
index 1a259d3..b694b43 100644
--- a/fs/nfsd/nfs3proc.c
+++ b/fs/nfsd/nfs3proc.c
@@ -6,25 +6,12 @@
  * Copyright (C) 1996, 1997, 1998 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/linkage.h>
-#include <linux/time.h>
-#include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/ext2_fs.h>
-#include <linux/stat.h>
-#include <linux/fcntl.h>
-#include <linux/net.h>
-#include <linux/in.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/major.h>
 #include <linux/magic.h>
 
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
 #include <linux/nfsd/xdr3.h>
-#include <linux/nfs3.h>
 #include "vfs.h"
 
 #define NFSDDBG_FACILITY		NFSDDBG_PROC
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index d0a2ce1..623e13a 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -8,18 +8,7 @@
  * 2003-08-09 Jamie Lokier: Use htonl() for nanoseconds, not htons()!
  */
 
-#include <linux/types.h>
-#include <linux/time.h>
-#include <linux/nfs3.h>
-#include <linux/list.h>
-#include <linux/spinlock.h>
-#include <linux/dcache.h>
 #include <linux/namei.h>
-#include <linux/mm.h>
-#include <linux/vfs.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/xdr3.h>
 #include "auth.h"
 
diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
index 6d9c6aa..d6f0cea 100644
--- a/fs/nfsd/nfs4acl.c
+++ b/fs/nfsd/nfs4acl.c
@@ -36,15 +36,7 @@
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <linux/string.h>
-#include <linux/slab.h>
-#include <linux/list.h>
-#include <linux/types.h>
-#include <linux/fs.h>
-#include <linux/module.h>
 #include <linux/nfs_fs.h>
-#include <linux/posix_acl.h>
-#include <linux/nfs4.h>
 #include <linux/nfs4_acl.h>
 
 
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 24e8d78..4fe3960 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -33,22 +33,9 @@
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <linux/module.h>
-#include <linux/list.h>
-#include <linux/inet.h>
-#include <linux/errno.h>
-#include <linux/delay.h>
-#include <linux/sched.h>
-#include <linux/kthread.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/svcsock.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/state.h>
-#include <linux/sunrpc/sched.h>
-#include <linux/nfs4.h>
-#include <linux/sunrpc/xprtsock.h>
 
 #define NFSDDBG_FACILITY                NFSDDBG_PROC
 
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index ba2c199..8e518cd 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -35,22 +35,9 @@
  */
 
 #include <linux/module.h>
-#include <linux/init.h>
-
-#include <linux/mm.h>
-#include <linux/errno.h>
-#include <linux/string.h>
-#include <linux/sunrpc/clnt.h>
-#include <linux/nfs.h>
-#include <linux/nfs4.h>
-#include <linux/nfs_fs.h>
-#include <linux/nfs_page.h>
-#include <linux/sunrpc/cache.h>
 #include <linux/nfsd_idmap.h>
-#include <linux/list.h>
-#include <linux/time.h>
 #include <linux/seq_file.h>
-#include <linux/sunrpc/svcauth.h>
+#include <linux/sched.h>
 
 /*
  * Cache entry
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 60a93cd..d0e04cb 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -34,20 +34,10 @@
  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-
-#include <linux/param.h>
-#include <linux/major.h>
-#include <linux/slab.h>
 #include <linux/file.h>
 
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
-#include <linux/nfs4.h>
-#include <linux/nfsd/state.h>
 #include <linux/nfsd/xdr4.h>
-#include <linux/nfs4_acl.h>
-#include <linux/sunrpc/gss_api.h>
 #include "vfs.h"
 
 #define NFSDDBG_FACILITY		NFSDDBG_PROC
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index c7a6b24..48742f2 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -33,20 +33,12 @@
 *
 */
 
-#include <linux/err.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
-#include <linux/nfs4.h>
 #include <linux/nfsd/state.h>
-#include <linux/nfsd/xdr4.h>
-#include <linux/param.h>
 #include <linux/file.h>
 #include <linux/namei.h>
-#include <asm/uaccess.h>
-#include <linux/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/sched.h>
-#include <linux/mount.h>
 #include "vfs.h"
 
 #define NFSDDBG_FACILITY                NFSDDBG_PROC
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 850960e..1fe6e29 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -34,26 +34,11 @@
 *
 */
 
-#include <linux/param.h>
-#include <linux/major.h>
-#include <linux/slab.h>
-
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/cache.h>
 #include <linux/file.h>
-#include <linux/mount.h>
-#include <linux/workqueue.h>
 #include <linux/smp_lock.h>
-#include <linux/kthread.h>
-#include <linux/nfs4.h>
-#include <linux/nfsd/state.h>
 #include <linux/nfsd/xdr4.h>
 #include <linux/namei.h>
 #include <linux/swap.h>
-#include <linux/mutex.h>
-#include <linux/lockd/bind.h>
-#include <linux/module.h>
 #include <linux/sunrpc/svcauth_gss.h>
 #include <linux/sunrpc/clnt.h>
 #include "vfs.h"
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index db0fc55..2fa9682 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -40,22 +40,12 @@
  * at the end of nfs4svc_decode_compoundargs.
  */
 
-#include <linux/param.h>
-#include <linux/smp.h>
-#include <linux/fs.h>
 #include <linux/namei.h>
-#include <linux/vfs.h>
+#include <linux/statfs.h>
 #include <linux/utsname.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/sunrpc/clnt.h>
-#include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/state.h>
 #include <linux/nfsd/xdr4.h>
 #include <linux/nfsd_idmap.h>
-#include <linux/nfs4.h>
 #include <linux/nfs4_acl.h>
-#include <linux/sunrpc/gss_api.h>
 #include <linux/sunrpc/svcauth_gss.h>
 #include "vfs.h"
 
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index 4638635..96694b8 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -10,14 +10,6 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/kernel.h>
-#include <linux/time.h>
-#include <linux/slab.h>
-#include <linux/string.h>
-#include <linux/spinlock.h>
-#include <linux/list.h>
-
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
 
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 5c01fc1..e4f49fd 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -6,42 +6,17 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/module.h>
-
-#include <linux/linkage.h>
-#include <linux/time.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
 #include <linux/namei.h>
-#include <linux/fcntl.h>
-#include <linux/net.h>
-#include <linux/in.h>
-#include <linux/syscalls.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/proc_fs.h>
-#include <linux/seq_file.h>
-#include <linux/pagemap.h>
-#include <linux/init.h>
-#include <linux/inet.h>
-#include <linux/string.h>
 #include <linux/ctype.h>
 
-#include <linux/nfs.h>
 #include <linux/nfsd_idmap.h>
-#include <linux/lockd/bind.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/svcsock.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
-#include <linux/nfsd/xdr.h>
 #include <linux/nfsd/syscall.h>
 #include <linux/lockd/lockd.h>
 #include <linux/sunrpc/clnt.h>
 
-#include <asm/uaccess.h>
-#include <net/ipv6.h>
-
 /*
  *	We have a single directory with 9 nodes in it.
  */
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index d0d8a21..4ef4601 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -9,17 +9,8 @@
  * ... and again Southern-Winter 2001 to support export_operations
  */
 
-#include <linux/slab.h>
-#include <linux/fs.h>
-#include <linux/unistd.h>
-#include <linux/string.h>
-#include <linux/stat.h>
-#include <linux/dcache.h>
 #include <linux/exportfs.h>
-#include <linux/mount.h>
 
-#include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/svcauth_gss.h>
 #include <linux/nfsd/nfsd.h>
 #include "vfs.h"
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index 6c967e1..b6bd9e0 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -7,21 +7,8 @@
  * Copyright (C) 1995-1997 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/linkage.h>
-#include <linux/time.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/stat.h>
-#include <linux/fcntl.h>
-#include <linux/net.h>
-#include <linux/in.h>
 #include <linux/namei.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
 
-#include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
 #include <linux/nfsd/xdr.h>
 #include "vfs.h"
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 2944b31..b2d7ffa 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -8,30 +8,15 @@
  * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/module.h>
 #include <linux/sched.h>
-#include <linux/time.h>
-#include <linux/errno.h>
-#include <linux/nfs.h>
-#include <linux/in.h>
-#include <linux/uio.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/smp.h>
 #include <linux/freezer.h>
 #include <linux/fs_struct.h>
-#include <linux/kthread.h>
 #include <linux/swap.h>
 
-#include <linux/sunrpc/types.h>
 #include <linux/sunrpc/stats.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/svcsock.h>
-#include <linux/sunrpc/cache.h>
 #include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/stats.h>
 #include <linux/nfsd/cache.h>
-#include <linux/nfsd/syscall.h>
 #include <linux/lockd/bind.h>
 #include <linux/nfsacl.h>
 #include <linux/seq_file.h>
diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c
index afd08e2..5e0603d 100644
--- a/fs/nfsd/nfsxdr.c
+++ b/fs/nfsd/nfsxdr.c
@@ -6,15 +6,7 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/types.h>
-#include <linux/time.h>
-#include <linux/nfs.h>
-#include <linux/vfs.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/xdr.h>
-#include <linux/mm.h>
 #include "auth.h"
 
 #define NFSDDBG_FACILITY		NFSDDBG_XDR
diff --git a/fs/nfsd/stats.c b/fs/nfsd/stats.c
index 71944cd..e3e411e 100644
--- a/fs/nfsd/stats.c
+++ b/fs/nfsd/stats.c
@@ -23,14 +23,9 @@
  * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/kernel.h>
-#include <linux/time.h>
-#include <linux/proc_fs.h>
 #include <linux/seq_file.h>
-#include <linux/stat.h>
 #include <linux/module.h>
 
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/stats.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/stats.h>
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index a7038ed..81ce108 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -16,43 +16,23 @@
  * Zerocpy NFS support (C) 2002 Hirokazu Takahashi <taka-jCdQPDEk3idL9jVzuh4AOg@public.gmane.org>
  */
 
-#include <linux/string.h>
-#include <linux/time.h>
-#include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/file.h>
-#include <linux/mount.h>
-#include <linux/major.h>
 #include <linux/splice.h>
-#include <linux/proc_fs.h>
-#include <linux/stat.h>
 #include <linux/fcntl.h>
-#include <linux/net.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/pagemap.h>
-#include <linux/in.h>
-#include <linux/module.h>
 #include <linux/namei.h>
-#include <linux/vfs.h>
 #include <linux/delay.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
 #ifdef CONFIG_NFSD_V3
-#include <linux/nfs3.h>
 #include <linux/nfsd/xdr3.h>
 #endif /* CONFIG_NFSD_V3 */
-#include <linux/nfsd/nfsfh.h>
 #include <linux/quotaops.h>
 #include <linux/fsnotify.h>
-#include <linux/posix_acl.h>
 #include <linux/posix_acl_xattr.h>
 #include <linux/xattr.h>
 #ifdef CONFIG_NFSD_V4
-#include <linux/nfs4.h>
 #include <linux/nfs4_acl.h>
 #include <linux/nfsd_idmap.h>
-#include <linux/security.h>
 #endif /* CONFIG_NFSD_V4 */
 #include <linux/jhash.h>
 #include <linux/ima.h>
-- 
1.6.5.2


--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [pnfs] [PATCH 5/6 version3] nfsd: Source files #include cleanups
@ 2009-11-24 12:43       ` Boaz Harrosh
  0 siblings, 0 replies; 26+ messages in thread
From: Boaz Harrosh @ 2009-11-24 12:43 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, NFS list, pNFS Mailing List,
	Trond Myklebust
  Cc: linux-fsdevel, Randy Dunlap, Al Viro


Now that the headers are fixed and carry their own wait, all fs/nfsd/
source files can include a minimal set of headers. and still compile just
fine.

This patch should improve the compilation speed of the nfsd module.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 fs/nfsd/auth.c         |    4 ----
 fs/nfsd/export.c       |   15 ---------------
 fs/nfsd/lockd.c        |    5 -----
 fs/nfsd/nfs2acl.c      |    4 ----
 fs/nfsd/nfs3acl.c      |    3 ---
 fs/nfsd/nfs3proc.c     |   13 -------------
 fs/nfsd/nfs3xdr.c      |   11 -----------
 fs/nfsd/nfs4acl.c      |    8 --------
 fs/nfsd/nfs4callback.c |   13 -------------
 fs/nfsd/nfs4idmap.c    |   15 +--------------
 fs/nfsd/nfs4proc.c     |   10 ----------
 fs/nfsd/nfs4recover.c  |    8 --------
 fs/nfsd/nfs4state.c    |   15 ---------------
 fs/nfsd/nfs4xdr.c      |   12 +-----------
 fs/nfsd/nfscache.c     |    8 --------
 fs/nfsd/nfsctl.c       |   25 -------------------------
 fs/nfsd/nfsfh.c        |    9 ---------
 fs/nfsd/nfsproc.c      |   13 -------------
 fs/nfsd/nfssvc.c       |   15 ---------------
 fs/nfsd/nfsxdr.c       |    8 --------
 fs/nfsd/stats.c        |    5 -----
 fs/nfsd/vfs.c          |   20 --------------------
 22 files changed, 2 insertions(+), 237 deletions(-)

diff --git a/fs/nfsd/auth.c b/fs/nfsd/auth.c
index 36fcabb..ad354d2 100644
--- a/fs/nfsd/auth.c
+++ b/fs/nfsd/auth.c
@@ -4,12 +4,8 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/types.h>
 #include <linux/sched.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/sunrpc/svcauth.h>
 #include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/export.h>
 #include "auth.h"
 
 int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp)
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index b73baba..68e63f4 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -14,27 +14,12 @@
  * Copyright (C) 1995, 1996 Olaf Kirch, <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/stat.h>
-#include <linux/in.h>
-#include <linux/seq_file.h>
-#include <linux/syscalls.h>
-#include <linux/rwsem.h>
-#include <linux/dcache.h>
 #include <linux/namei.h>
-#include <linux/mount.h>
-#include <linux/hash.h>
 #include <linux/module.h>
 #include <linux/exportfs.h>
 
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/nfsfh.h>
 #include <linux/nfsd/syscall.h>
-#include <linux/lockd/bind.h>
-#include <linux/sunrpc/msg_prot.h>
-#include <linux/sunrpc/gss_api.h>
 #include <net/ipv6.h>
 
 #define NFSDDBG_FACILITY	NFSDDBG_EXPORT
diff --git a/fs/nfsd/lockd.c b/fs/nfsd/lockd.c
index 812bc64..801ef71 100644
--- a/fs/nfsd/lockd.c
+++ b/fs/nfsd/lockd.c
@@ -8,12 +8,7 @@
  * Copyright (C) 1996, Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/types.h>
-#include <linux/fs.h>
 #include <linux/file.h>
-#include <linux/mount.h>
-#include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/lockd/bind.h>
 #include "vfs.h"
diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c
index 38c883d..a54628d 100644
--- a/fs/nfsd/nfs2acl.c
+++ b/fs/nfsd/nfs2acl.c
@@ -6,13 +6,9 @@
  * Copyright (C) 2002-2003 Andreas Gruenbacher <agruen@suse.de>
  */
 
-#include <linux/sunrpc/svc.h>
-#include <linux/nfs.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
-#include <linux/nfsd/xdr.h>
 #include <linux/nfsd/xdr3.h>
-#include <linux/posix_acl.h>
 #include <linux/nfsacl.h>
 #include "vfs.h"
 
diff --git a/fs/nfsd/nfs3acl.c b/fs/nfsd/nfs3acl.c
index 526d85a..2f5c61b 100644
--- a/fs/nfsd/nfs3acl.c
+++ b/fs/nfsd/nfs3acl.c
@@ -6,12 +6,9 @@
  * Copyright (C) 2002-2003 Andreas Gruenbacher <agruen@suse.de>
  */
 
-#include <linux/sunrpc/svc.h>
-#include <linux/nfs3.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
 #include <linux/nfsd/xdr3.h>
-#include <linux/posix_acl.h>
 #include <linux/nfsacl.h>
 #include "vfs.h"
 
diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
index 1a259d3..b694b43 100644
--- a/fs/nfsd/nfs3proc.c
+++ b/fs/nfsd/nfs3proc.c
@@ -6,25 +6,12 @@
  * Copyright (C) 1996, 1997, 1998 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/linkage.h>
-#include <linux/time.h>
-#include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/ext2_fs.h>
-#include <linux/stat.h>
-#include <linux/fcntl.h>
-#include <linux/net.h>
-#include <linux/in.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/major.h>
 #include <linux/magic.h>
 
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
 #include <linux/nfsd/xdr3.h>
-#include <linux/nfs3.h>
 #include "vfs.h"
 
 #define NFSDDBG_FACILITY		NFSDDBG_PROC
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index d0a2ce1..623e13a 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -8,18 +8,7 @@
  * 2003-08-09 Jamie Lokier: Use htonl() for nanoseconds, not htons()!
  */
 
-#include <linux/types.h>
-#include <linux/time.h>
-#include <linux/nfs3.h>
-#include <linux/list.h>
-#include <linux/spinlock.h>
-#include <linux/dcache.h>
 #include <linux/namei.h>
-#include <linux/mm.h>
-#include <linux/vfs.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/xdr3.h>
 #include "auth.h"
 
diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
index 6d9c6aa..d6f0cea 100644
--- a/fs/nfsd/nfs4acl.c
+++ b/fs/nfsd/nfs4acl.c
@@ -36,15 +36,7 @@
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <linux/string.h>
-#include <linux/slab.h>
-#include <linux/list.h>
-#include <linux/types.h>
-#include <linux/fs.h>
-#include <linux/module.h>
 #include <linux/nfs_fs.h>
-#include <linux/posix_acl.h>
-#include <linux/nfs4.h>
 #include <linux/nfs4_acl.h>
 
 
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 24e8d78..4fe3960 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -33,22 +33,9 @@
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <linux/module.h>
-#include <linux/list.h>
-#include <linux/inet.h>
-#include <linux/errno.h>
-#include <linux/delay.h>
-#include <linux/sched.h>
-#include <linux/kthread.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/svcsock.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/state.h>
-#include <linux/sunrpc/sched.h>
-#include <linux/nfs4.h>
-#include <linux/sunrpc/xprtsock.h>
 
 #define NFSDDBG_FACILITY                NFSDDBG_PROC
 
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index ba2c199..8e518cd 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -35,22 +35,9 @@
  */
 
 #include <linux/module.h>
-#include <linux/init.h>
-
-#include <linux/mm.h>
-#include <linux/errno.h>
-#include <linux/string.h>
-#include <linux/sunrpc/clnt.h>
-#include <linux/nfs.h>
-#include <linux/nfs4.h>
-#include <linux/nfs_fs.h>
-#include <linux/nfs_page.h>
-#include <linux/sunrpc/cache.h>
 #include <linux/nfsd_idmap.h>
-#include <linux/list.h>
-#include <linux/time.h>
 #include <linux/seq_file.h>
-#include <linux/sunrpc/svcauth.h>
+#include <linux/sched.h>
 
 /*
  * Cache entry
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 60a93cd..d0e04cb 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -34,20 +34,10 @@
  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-
-#include <linux/param.h>
-#include <linux/major.h>
-#include <linux/slab.h>
 #include <linux/file.h>
 
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
-#include <linux/nfs4.h>
-#include <linux/nfsd/state.h>
 #include <linux/nfsd/xdr4.h>
-#include <linux/nfs4_acl.h>
-#include <linux/sunrpc/gss_api.h>
 #include "vfs.h"
 
 #define NFSDDBG_FACILITY		NFSDDBG_PROC
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index c7a6b24..48742f2 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -33,20 +33,12 @@
 *
 */
 
-#include <linux/err.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
-#include <linux/nfs4.h>
 #include <linux/nfsd/state.h>
-#include <linux/nfsd/xdr4.h>
-#include <linux/param.h>
 #include <linux/file.h>
 #include <linux/namei.h>
-#include <asm/uaccess.h>
-#include <linux/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/sched.h>
-#include <linux/mount.h>
 #include "vfs.h"
 
 #define NFSDDBG_FACILITY                NFSDDBG_PROC
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 850960e..1fe6e29 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -34,26 +34,11 @@
 *
 */
 
-#include <linux/param.h>
-#include <linux/major.h>
-#include <linux/slab.h>
-
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/cache.h>
 #include <linux/file.h>
-#include <linux/mount.h>
-#include <linux/workqueue.h>
 #include <linux/smp_lock.h>
-#include <linux/kthread.h>
-#include <linux/nfs4.h>
-#include <linux/nfsd/state.h>
 #include <linux/nfsd/xdr4.h>
 #include <linux/namei.h>
 #include <linux/swap.h>
-#include <linux/mutex.h>
-#include <linux/lockd/bind.h>
-#include <linux/module.h>
 #include <linux/sunrpc/svcauth_gss.h>
 #include <linux/sunrpc/clnt.h>
 #include "vfs.h"
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index db0fc55..2fa9682 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -40,22 +40,12 @@
  * at the end of nfs4svc_decode_compoundargs.
  */
 
-#include <linux/param.h>
-#include <linux/smp.h>
-#include <linux/fs.h>
 #include <linux/namei.h>
-#include <linux/vfs.h>
+#include <linux/statfs.h>
 #include <linux/utsname.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/sunrpc/clnt.h>
-#include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/state.h>
 #include <linux/nfsd/xdr4.h>
 #include <linux/nfsd_idmap.h>
-#include <linux/nfs4.h>
 #include <linux/nfs4_acl.h>
-#include <linux/sunrpc/gss_api.h>
 #include <linux/sunrpc/svcauth_gss.h>
 #include "vfs.h"
 
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index 4638635..96694b8 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -10,14 +10,6 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/kernel.h>
-#include <linux/time.h>
-#include <linux/slab.h>
-#include <linux/string.h>
-#include <linux/spinlock.h>
-#include <linux/list.h>
-
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
 
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 5c01fc1..e4f49fd 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -6,42 +6,17 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/module.h>
-
-#include <linux/linkage.h>
-#include <linux/time.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
 #include <linux/namei.h>
-#include <linux/fcntl.h>
-#include <linux/net.h>
-#include <linux/in.h>
-#include <linux/syscalls.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/proc_fs.h>
-#include <linux/seq_file.h>
-#include <linux/pagemap.h>
-#include <linux/init.h>
-#include <linux/inet.h>
-#include <linux/string.h>
 #include <linux/ctype.h>
 
-#include <linux/nfs.h>
 #include <linux/nfsd_idmap.h>
-#include <linux/lockd/bind.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/svcsock.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
-#include <linux/nfsd/xdr.h>
 #include <linux/nfsd/syscall.h>
 #include <linux/lockd/lockd.h>
 #include <linux/sunrpc/clnt.h>
 
-#include <asm/uaccess.h>
-#include <net/ipv6.h>
-
 /*
  *	We have a single directory with 9 nodes in it.
  */
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index d0d8a21..4ef4601 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -9,17 +9,8 @@
  * ... and again Southern-Winter 2001 to support export_operations
  */
 
-#include <linux/slab.h>
-#include <linux/fs.h>
-#include <linux/unistd.h>
-#include <linux/string.h>
-#include <linux/stat.h>
-#include <linux/dcache.h>
 #include <linux/exportfs.h>
-#include <linux/mount.h>
 
-#include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/svcauth_gss.h>
 #include <linux/nfsd/nfsd.h>
 #include "vfs.h"
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index 6c967e1..b6bd9e0 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -7,21 +7,8 @@
  * Copyright (C) 1995-1997 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/linkage.h>
-#include <linux/time.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/stat.h>
-#include <linux/fcntl.h>
-#include <linux/net.h>
-#include <linux/in.h>
 #include <linux/namei.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
 
-#include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
 #include <linux/nfsd/xdr.h>
 #include "vfs.h"
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 2944b31..b2d7ffa 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -8,30 +8,15 @@
  * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/module.h>
 #include <linux/sched.h>
-#include <linux/time.h>
-#include <linux/errno.h>
-#include <linux/nfs.h>
-#include <linux/in.h>
-#include <linux/uio.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/smp.h>
 #include <linux/freezer.h>
 #include <linux/fs_struct.h>
-#include <linux/kthread.h>
 #include <linux/swap.h>
 
-#include <linux/sunrpc/types.h>
 #include <linux/sunrpc/stats.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/svcsock.h>
-#include <linux/sunrpc/cache.h>
 #include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/stats.h>
 #include <linux/nfsd/cache.h>
-#include <linux/nfsd/syscall.h>
 #include <linux/lockd/bind.h>
 #include <linux/nfsacl.h>
 #include <linux/seq_file.h>
diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c
index afd08e2..5e0603d 100644
--- a/fs/nfsd/nfsxdr.c
+++ b/fs/nfsd/nfsxdr.c
@@ -6,15 +6,7 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/types.h>
-#include <linux/time.h>
-#include <linux/nfs.h>
-#include <linux/vfs.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/xdr.h>
-#include <linux/mm.h>
 #include "auth.h"
 
 #define NFSDDBG_FACILITY		NFSDDBG_XDR
diff --git a/fs/nfsd/stats.c b/fs/nfsd/stats.c
index 71944cd..e3e411e 100644
--- a/fs/nfsd/stats.c
+++ b/fs/nfsd/stats.c
@@ -23,14 +23,9 @@
  * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
  */
 
-#include <linux/kernel.h>
-#include <linux/time.h>
-#include <linux/proc_fs.h>
 #include <linux/seq_file.h>
-#include <linux/stat.h>
 #include <linux/module.h>
 
-#include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/stats.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/stats.h>
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index a7038ed..81ce108 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -16,43 +16,23 @@
  * Zerocpy NFS support (C) 2002 Hirokazu Takahashi <taka-jCdQPDEk3idL9jVzuh4AOg@public.gmane.org>
  */
 
-#include <linux/string.h>
-#include <linux/time.h>
-#include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/file.h>
-#include <linux/mount.h>
-#include <linux/major.h>
 #include <linux/splice.h>
-#include <linux/proc_fs.h>
-#include <linux/stat.h>
 #include <linux/fcntl.h>
-#include <linux/net.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/pagemap.h>
-#include <linux/in.h>
-#include <linux/module.h>
 #include <linux/namei.h>
-#include <linux/vfs.h>
 #include <linux/delay.h>
-#include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
 #ifdef CONFIG_NFSD_V3
-#include <linux/nfs3.h>
 #include <linux/nfsd/xdr3.h>
 #endif /* CONFIG_NFSD_V3 */
-#include <linux/nfsd/nfsfh.h>
 #include <linux/quotaops.h>
 #include <linux/fsnotify.h>
-#include <linux/posix_acl.h>
 #include <linux/posix_acl_xattr.h>
 #include <linux/xattr.h>
 #ifdef CONFIG_NFSD_V4
-#include <linux/nfs4.h>
 #include <linux/nfs4_acl.h>
 #include <linux/nfsd_idmap.h>
-#include <linux/security.h>
 #endif /* CONFIG_NFSD_V4 */
 #include <linux/jhash.h>
 #include <linux/ima.h>
-- 
1.6.5.2



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/6] nfsd: Remove nfsfh.h dependency on sunrpc
  2009-11-24  8:28             ` Boaz Harrosh
  (?)
@ 2009-11-25 20:57             ` J. Bruce Fields
  -1 siblings, 0 replies; 26+ messages in thread
From: J. Bruce Fields @ 2009-11-25 20:57 UTC (permalink / raw)
  To: Boaz Harrosh
  Cc: Benny Halevy, NFS list, pNFS Mailing List, Trond Myklebust,
	Andrew Morton, linux-fsdevel, Al Viro, Randy Dunlap

On Tue, Nov 24, 2009 at 10:28:59AM +0200, Boaz Harrosh wrote:
> On 11/24/2009 12:17 AM, J. Bruce Fields wrote:
> > On Mon, Nov 23, 2009 at 05:58:30PM +0200, Boaz Harrosh wrote:
> >> linux/nfsd/nfsfh.h defines some low level types which
> >> are needed by exportfs and though by filesystems.
> >>
> >> In the file, fh_lock() uses the sunrpc dprint facility which
> >> might cause a dependency of exportfs (and filesystems) on
> > 
> > "might cause"?
> > 
> > Does mere inclusion of this .h (without referencing fh_lock_nested() or
> > its callers) actually create a dependency?
> > 
> > --b.
> > 
> 
> No, only if code actually uses fh_lock_nested it will cause a dependency.
> Which is only used in fs/nfsd/...
> 
> But I would like to discourage nfsd/debug.h at this level.
> 
> Should I move fh_lock_nested() and it's siblings to the new private vfs.h header
> you made, and get rid of it this way?

Sure, that sounds reasonable.

--b.

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2009-11-25 20:56 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-23 15:54 [PATCHSET 0-6] nfsd: #includes cleanup Boaz Harrosh
2009-11-23 15:54 ` Boaz Harrosh
     [not found] ` <4B0AB039.6020608-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
2009-11-23 15:58   ` [PATCH 1/6] nfsd: Remove nfsfh.h dependency on sunrpc Boaz Harrosh
2009-11-23 15:58     ` Boaz Harrosh
     [not found]     ` <1258991910-25335-1-git-send-email-bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
2009-11-23 22:17       ` J. Bruce Fields
2009-11-23 22:17         ` J. Bruce Fields
     [not found]         ` <20091123221705.GF8534-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2009-11-24  8:28           ` Boaz Harrosh
2009-11-24  8:28             ` Boaz Harrosh
2009-11-25 20:57             ` J. Bruce Fields
2009-11-23 15:58   ` [PATCH 2/6] sunrpc: Clean never used include files Boaz Harrosh
2009-11-23 15:58     ` Boaz Harrosh
2009-11-23 15:59   ` [PATCH 3/6] nfsd: Fix independence of a few nfsd related headers Boaz Harrosh
2009-11-23 15:59     ` Boaz Harrosh
2009-11-23 15:59   ` [PATCH 4/6] nfsd: Headers Independence and include cleanups Boaz Harrosh
2009-11-23 15:59     ` Boaz Harrosh
2009-11-23 16:00   ` [PATCH 6/6] compat.c: Remove dependence on nfsd private headers Boaz Harrosh
2009-11-23 16:00     ` Boaz Harrosh
2009-11-23 15:59 ` [PATCH 5/6] nfsd: Source files #include cleanups Boaz Harrosh
2009-11-24  8:17   ` [PATCH 5/6 version2] " Boaz Harrosh
     [not found]   ` <1258991991-25446-1-git-send-email-bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
2009-11-23 17:26     ` [pnfs] [PATCH 5/6] " Boaz Harrosh
2009-11-23 17:26       ` Boaz Harrosh
2009-11-24 12:43     ` [pnfs] [PATCH 5/6 version3] " Boaz Harrosh
2009-11-24 12:43       ` Boaz Harrosh
2009-11-23 22:14 ` [PATCHSET 0-6] nfsd: #includes cleanup J. Bruce Fields
     [not found]   ` <20091123221415.GE8534-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2009-11-24 12:42     ` Boaz Harrosh
2009-11-24 12:42       ` Boaz Harrosh

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.