FS-Cache: audit and remove any unnecessary uses of module.h
PATCH 1/1 FS-Cache: audit and remove any unnecessary uses of module.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 fix up an implict dependence on kobject.h that was being hidden by the previous inclusion of module.h in the process.
---
[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/fscache/cache.c | 3 ++- fs/fscache/cookie.c | 2 +- fs/fscache/fsdef.c | 2 +- fs/fscache/histogram.c | 1 - fs/fscache/netfs.c | 2 +- fs/fscache/object-list.c | 1 - fs/fscache/object.c | 2 +- fs/fscache/operation.c | 2 +- fs/fscache/page.c | 2 +- fs/fscache/proc.c | 2 +- fs/fscache/stats.c | 1 - 11 files changed, 9 insertions(+), 11 deletions(-)
fs/fscache/cache.c +2 -1
@@ -10,7 +10,8 @@*/ #define FSCACHE_DEBUG_LEVEL CACHE -#include <linux/module.h> +#include <linux/export.h> +#include <linux/kobject.h> #include <linux/slab.h> #include "internal.h"
fs/fscache/cookie.c +1 -1
@@ -13,7 +13,7 @@*/ #define FSCACHE_DEBUG_LEVEL COOKIE -#include <linux/module.h> +#include <linux/export.h> #include <linux/slab.h> #include "internal.h"
fs/fscache/fsdef.c +1 -1
@@ -10,7 +10,7 @@*/ #define FSCACHE_DEBUG_LEVEL CACHE -#include <linux/module.h> +#include <linux/export.h> #include "internal.h" static uint16_t fscache_fsdef_netfs_get_key(const void *cookie_netfs_data,
fs/fscache/histogram.c +0 -1
@@ -10,7 +10,6 @@*/ #define FSCACHE_DEBUG_LEVEL THREAD -#include <linux/module.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> #include "internal.h"
fs/fscache/netfs.c +1 -1
@@ -10,7 +10,7 @@*/ #define FSCACHE_DEBUG_LEVEL COOKIE -#include <linux/module.h> +#include <linux/export.h> #include <linux/slab.h> #include "internal.h"
fs/fscache/object-list.c +0 -1
@@ -10,7 +10,6 @@*/ #define FSCACHE_DEBUG_LEVEL COOKIE -#include <linux/module.h> #include <linux/seq_file.h> #include <linux/slab.h> #include <linux/key.h>
fs/fscache/object.c +1 -1
@@ -13,7 +13,7 @@*/ #define FSCACHE_DEBUG_LEVEL COOKIE -#include <linux/module.h> +#include <linux/init.h> #include <linux/slab.h> #include <linux/prefetch.h> #include "internal.h"
fs/fscache/operation.c +1 -1
@@ -12,7 +12,7 @@*/ #define FSCACHE_DEBUG_LEVEL OPERATION -#include <linux/module.h> +#include <linux/export.h> #include <linux/seq_file.h> #include <linux/slab.h> #include "internal.h"
fs/fscache/page.c +1 -1
@@ -10,7 +10,7 @@*/ #define FSCACHE_DEBUG_LEVEL PAGE -#include <linux/module.h> +#include <linux/export.h> #include <linux/fscache-cache.h> #include <linux/buffer_head.h> #include <linux/pagevec.h>
fs/fscache/proc.c +1 -1
@@ -10,7 +10,7 @@*/ #define FSCACHE_DEBUG_LEVEL OPERATION -#include <linux/module.h> +#include <linux/init.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> #include "internal.h"
fs/fscache/stats.c +0 -1
@@ -10,7 +10,6 @@*/ #define FSCACHE_DEBUG_LEVEL THREAD -#include <linux/module.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> #include "internal.h"
Signature · 1 line
2.8.4