[PATCH] NFS: audit and remove any unnecessary uses of module.h

2016-09-19 Thread Paul Gortmaker
Historically a lot of these existed because we did not have
a distinction between what was modular code and what was providing
support to modules via EXPORT_SYMBOL and friends.  That changed
when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h
in code that is obj-y Makefile or bool Kconfig.

In the case of some code where it is modular, we can extend that to
also include files that are building basic support functionality but
not related to loading or registering the final module; such files
also have no need whatsoever for module.h

The advantage in removing such instances is that module.h itself
sources about 15 other headers; adding significantly to what we feed
cpp, and it can obscure what headers we are effectively using.

Since module.h might have been the implicit source for init.h
(for __init) and for export.h (for EXPORT_SYMBOL) we consider each
instance for the presence of either and replace as needed.

We also keep an eye out for module_param usage that doesn't have the
corresponding moduleparam.h and fix accordingly.

Cc: "J. Bruce Fields" 
Cc: Jeff Layton 
Cc: Trond Myklebust 
Cc: Anna Schumaker 
Cc: linux-...@vger.kernel.org
Signed-off-by: Paul Gortmaker 
---

[I've been building this on linux-next on a regular basis for
 allmodconfig for x86(32/64) ARM(32/64) ppc and mips so there
 shouldn't be any unseen fallout.]

 fs/nfs/cache_lib.c| 1 -
 fs/nfs/callback.c | 1 -
 fs/nfs/delegation.c   | 2 +-
 fs/nfs/dir.c  | 3 ++-
 fs/nfs/direct.c   | 2 +-
 fs/nfs/file.c | 2 +-
 fs/nfs/filelayout/filelayoutdev.c | 2 +-
 fs/nfs/flexfilelayout/flexfilelayoutdev.c | 2 +-
 fs/nfs/getroot.c  | 2 --
 fs/nfs/inode.c| 1 +
 fs/nfs/namespace.c| 2 +-
 fs/nfs/nfs4client.c   | 2 +-
 fs/nfs/nfs4idmap.c| 2 +-
 fs/nfs/nfs4proc.c | 2 +-
 fs/nfs/nfs4session.c  | 2 +-
 fs/nfs/nfs4xdr.c  | 2 +-
 fs/nfs/pnfs_nfs.c | 2 +-
 fs/nfs/read.c | 2 +-
 fs/nfs/super.c| 4 ++--
 fs/nfs/sysctl.c   | 1 -
 fs/nfsd/export.c  | 1 -
 fs/nfsd/fault_inject.c| 1 -
 fs/nfsd/nfs4idmap.c   | 2 +-
 fs/nfsd/nfs4recover.c | 1 +
 fs/nfsd/stats.c   | 1 -
 25 files changed, 20 insertions(+), 25 deletions(-)

diff --git a/fs/nfs/cache_lib.c b/fs/nfs/cache_lib.c
index 5f7b053720ee..3f8ebf4c4987 100644
--- a/fs/nfs/cache_lib.c
+++ b/fs/nfs/cache_lib.c
@@ -6,7 +6,6 @@
  * Copyright (c) 2009 Trond Myklebust 
  */
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index a7f2e6e33305..908ea10d95f7 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -8,7 +8,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 322c2585bc34..c05e3369f684 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -8,7 +8,7 @@
  */
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 177fefb26c18..7d547a147cdd 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -17,7 +17,8 @@
  *  6 Jun 1999 Cache readdir lookups in the page cache. -DaveM
  */
 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 72b7d13ee3c6..2eb8df0bb186 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -46,7 +46,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 7d620970f2e1..47d51ef87f74 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -16,7 +16,7 @@
  *  nfs regular file handling functions
  */
 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/fs/nfs/filelayout/filelayoutdev.c 
b/fs/nfs/filelayout/filelayoutdev.c
index 4946ef40ba87..d77ce25041b6 100644
--- a/fs/nfs/filelayout/filelayoutdev.c
+++ b/fs/nfs/filelayout/filelayoutdev.c
@@ -30,7 +30,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 #include "../internal.h"
 #include "../nfs4session.h"
diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c 
b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
index 0aa36be71fce..93e2893ed834 100644
--- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c
+++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
@@ -8,7 +8,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 

[PATCH] NFS: audit and remove any unnecessary uses of module.h

2016-09-19 Thread Paul Gortmaker
Historically a lot of these existed because we did not have
a distinction between what was modular code and what was providing
support to modules via EXPORT_SYMBOL and friends.  That changed
when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h
in code that is obj-y Makefile or bool Kconfig.

In the case of some code where it is modular, we can extend that to
also include files that are building basic support functionality but
not related to loading or registering the final module; such files
also have no need whatsoever for module.h

The advantage in removing such instances is that module.h itself
sources about 15 other headers; adding significantly to what we feed
cpp, and it can obscure what headers we are effectively using.

Since module.h might have been the implicit source for init.h
(for __init) and for export.h (for EXPORT_SYMBOL) we consider each
instance for the presence of either and replace as needed.

We also keep an eye out for module_param usage that doesn't have the
corresponding moduleparam.h and fix accordingly.

Cc: "J. Bruce Fields" 
Cc: Jeff Layton 
Cc: Trond Myklebust 
Cc: Anna Schumaker 
Cc: linux-...@vger.kernel.org
Signed-off-by: Paul Gortmaker 
---

[I've been building this on linux-next on a regular basis for
 allmodconfig for x86(32/64) ARM(32/64) ppc and mips so there
 shouldn't be any unseen fallout.]

 fs/nfs/cache_lib.c| 1 -
 fs/nfs/callback.c | 1 -
 fs/nfs/delegation.c   | 2 +-
 fs/nfs/dir.c  | 3 ++-
 fs/nfs/direct.c   | 2 +-
 fs/nfs/file.c | 2 +-
 fs/nfs/filelayout/filelayoutdev.c | 2 +-
 fs/nfs/flexfilelayout/flexfilelayoutdev.c | 2 +-
 fs/nfs/getroot.c  | 2 --
 fs/nfs/inode.c| 1 +
 fs/nfs/namespace.c| 2 +-
 fs/nfs/nfs4client.c   | 2 +-
 fs/nfs/nfs4idmap.c| 2 +-
 fs/nfs/nfs4proc.c | 2 +-
 fs/nfs/nfs4session.c  | 2 +-
 fs/nfs/nfs4xdr.c  | 2 +-
 fs/nfs/pnfs_nfs.c | 2 +-
 fs/nfs/read.c | 2 +-
 fs/nfs/super.c| 4 ++--
 fs/nfs/sysctl.c   | 1 -
 fs/nfsd/export.c  | 1 -
 fs/nfsd/fault_inject.c| 1 -
 fs/nfsd/nfs4idmap.c   | 2 +-
 fs/nfsd/nfs4recover.c | 1 +
 fs/nfsd/stats.c   | 1 -
 25 files changed, 20 insertions(+), 25 deletions(-)

diff --git a/fs/nfs/cache_lib.c b/fs/nfs/cache_lib.c
index 5f7b053720ee..3f8ebf4c4987 100644
--- a/fs/nfs/cache_lib.c
+++ b/fs/nfs/cache_lib.c
@@ -6,7 +6,6 @@
  * Copyright (c) 2009 Trond Myklebust 
  */
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index a7f2e6e33305..908ea10d95f7 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -8,7 +8,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 322c2585bc34..c05e3369f684 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -8,7 +8,7 @@
  */
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 177fefb26c18..7d547a147cdd 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -17,7 +17,8 @@
  *  6 Jun 1999 Cache readdir lookups in the page cache. -DaveM
  */
 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 72b7d13ee3c6..2eb8df0bb186 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -46,7 +46,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 7d620970f2e1..47d51ef87f74 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -16,7 +16,7 @@
  *  nfs regular file handling functions
  */
 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/fs/nfs/filelayout/filelayoutdev.c 
b/fs/nfs/filelayout/filelayoutdev.c
index 4946ef40ba87..d77ce25041b6 100644
--- a/fs/nfs/filelayout/filelayoutdev.c
+++ b/fs/nfs/filelayout/filelayoutdev.c
@@ -30,7 +30,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 #include "../internal.h"
 #include "../nfs4session.h"
diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c 
b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
index 0aa36be71fce..93e2893ed834 100644
--- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c
+++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
@@ -8,7 +8,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include "../internal.h"
diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
index a608ffd28acc..71e7bdd00ac3 100644
--- a/fs/nfs/getroot.c
+++ b/fs/nfs/getroot.c
@@