@@ -6,7 +6,6 @@
* Copyright (c) 2009 Trond Myklebust <Trond.Myklebust@netapp.com>
*/
#include <linux/kmod.h>
-#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/mount.h>
#include <linux/namei.h>
@@ -8,7 +8,6 @@
#include <linux/completion.h>
#include <linux/ip.h>
-#include <linux/module.h>
#include <linux/sunrpc/svc.h>
#include <linux/sunrpc/svcsock.h>
#include <linux/nfs_fs.h>
@@ -8,7 +8,7 @@
*/
#include <linux/completion.h>
#include <linux/kthread.h>
-#include <linux/module.h>
+#include <linux/export.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
@@ -17,7 +17,8 @@
* 6 Jun 1999 Cache readdir lookups in the page cache. -DaveM
*/
-#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/export.h>
#include <linux/time.h>
#include <linux/errno.h>
#include <linux/stat.h>
@@ -46,7 +46,7 @@
#include <linux/kref.h>
#include <linux/slab.h>
#include <linux/task_io_accounting_ops.h>
-#include <linux/module.h>
+#include <linux/export.h>
#include <linux/nfs_fs.h>
#include <linux/nfs_page.h>
@@ -16,7 +16,7 @@
* nfs regular file handling functions
*/
-#include <linux/module.h>
+#include <linux/export.h>
#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/errno.h>
@@ -30,7 +30,7 @@
#include <linux/nfs_fs.h>
#include <linux/vmalloc.h>
-#include <linux/module.h>
+#include <linux/moduleparam.h>
#include "../internal.h"
#include "../nfs4session.h"
@@ -8,7 +8,7 @@
#include <linux/nfs_fs.h>
#include <linux/vmalloc.h>
-#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/sunrpc/addr.h>
#include "../internal.h"
@@ -9,9 +9,7 @@
* 2 of the License, or (at your option) any later version.
*/
-#include <linux/module.h>
#include <linux/init.h>
-
#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/mm.h>
@@ -14,6 +14,7 @@
*/
#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/time.h>
@@ -7,7 +7,7 @@
* NFS namespace
*/
-#include <linux/module.h>
+#include <linux/export.h>
#include <linux/dcache.h>
#include <linux/gfp.h>
#include <linux/mount.h>
@@ -2,7 +2,7 @@
* Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
*/
-#include <linux/module.h>
+#include <linux/export.h>
#include <linux/nfs_fs.h>
#include <linux/nfs_mount.h>
#include <linux/sunrpc/addr.h>
@@ -44,7 +44,7 @@
#include <linux/keyctl.h>
#include <linux/key-type.h>
#include <keys/user-type.h>
-#include <linux/module.h>
+#include <linux/export.h>
#include "internal.h"
#include "netns.h"
@@ -51,7 +51,7 @@
#include <linux/nfs_mount.h>
#include <linux/namei.h>
#include <linux/mount.h>
-#include <linux/module.h>
+#include <linux/export.h>
#include <linux/xattr.h>
#include <linux/utsname.h>
#include <linux/freezer.h>
@@ -14,7 +14,7 @@
#include <linux/nfs.h>
#include <linux/nfs4.h>
#include <linux/nfs_fs.h>
-#include <linux/module.h>
+#include <linux/export.h>
#include "nfs4_fs.h"
#include "internal.h"
@@ -44,7 +44,7 @@
#include <linux/pagemap.h>
#include <linux/proc_fs.h>
#include <linux/kdev_t.h>
-#include <linux/module.h>
+#include <linux/export.h>
#include <linux/utsname.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/msg_prot.h>
@@ -10,7 +10,7 @@
#include <linux/nfs_fs.h>
#include <linux/nfs_page.h>
#include <linux/sunrpc/addr.h>
-#include <linux/module.h>
+#include <linux/export.h>
#include "nfs4session.h"
#include "internal.h"
@@ -18,7 +18,7 @@
#include <linux/sunrpc/clnt.h>
#include <linux/nfs_fs.h>
#include <linux/nfs_page.h>
-#include <linux/module.h>
+#include <linux/export.h>
#include "nfs4_fs.h"
#include "internal.h"
@@ -20,9 +20,9 @@
* of another (see nfs_lookup())
*/
-#include <linux/module.h>
#include <linux/init.h>
-
+#include <linux/export.h>
+#include <linux/moduleparam.h>
#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/mm.h>
@@ -8,7 +8,6 @@
#include <linux/ctype.h>
#include <linux/fs.h>
#include <linux/sysctl.h>
-#include <linux/module.h>
#include <linux/nfs_fs.h>
static struct ctl_table_header *nfs_callback_sysctl_table;
@@ -13,7 +13,6 @@
#include <linux/slab.h>
#include <linux/namei.h>
-#include <linux/module.h>
#include <linux/exportfs.h>
#include <linux/sunrpc/svc_xprt.h>
@@ -7,7 +7,6 @@
#include <linux/types.h>
#include <linux/fs.h>
#include <linux/debugfs.h>
-#include <linux/module.h>
#include <linux/nsproxy.h>
#include <linux/sunrpc/addr.h>
#include <asm/uaccess.h>
@@ -32,7 +32,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/seq_file.h>
#include <linux/sched.h>
#include <linux/slab.h>
@@ -39,6 +39,7 @@
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <net/net_namespace.h>
#include <linux/sunrpc/rpc_pipe_fs.h>
#include <linux/sunrpc/clnt.h>
@@ -22,7 +22,6 @@
*/
#include <linux/seq_file.h>
-#include <linux/module.h>
#include <linux/sunrpc/stats.h>
#include <net/net_namespace.h>
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" <bfields@fieldses.org> Cc: Jeff Layton <jlayton@poochiereds.net> Cc: Trond Myklebust <trond.myklebust@primarydata.com> Cc: Anna Schumaker <anna.schumaker@netapp.com> Cc: linux-nfs@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> --- [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(-)