diff options
author | Arnd Bergmann <arnd@arndb.de> | 2021-12-14 01:36:33 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-12-14 02:23:21 +0000 |
commit | 0f6630355ea573a79534db7190715c5f13903804 (patch) | |
tree | 55c0d7c375f35e3bd8882b5405e189ac48fe129c | |
parent | 8cb2ec9927f9161c9bd5ddd0e7fe99ff2b77790f (diff) | |
download | linux-0f6630355ea573a79534db7190715c5f13903804.tar.gz linux-0f6630355ea573a79534db7190715c5f13903804.tar.xz |
fs/dcache: avoid unused-function warning
Now that 'dentry_stat' is marked 'static', we can run into this warning:
fs/dcache.c:128:29: error: 'dentry_stat' defined but not used [-Werror=unused-variable]
128 | static struct dentry_stat_t dentry_stat = {
Hide it in the same #ifdef as its only references.
Link: https://lkml.kernel.org/r/20211203190123.874239-2-arnd@kernel.org
Fixes: f0eea17ca8da ("fs: move dcache sysctls to its own file")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | fs/dcache.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 0eef1102f460..c84269c6e8bf 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -124,16 +124,15 @@ struct dentry_stat_t { long dummy; /* Reserved for future use */ }; -/* Statistics gathering. */ -static struct dentry_stat_t dentry_stat = { - .age_limit = 45, -}; - static DEFINE_PER_CPU(long, nr_dentry); static DEFINE_PER_CPU(long, nr_dentry_unused); static DEFINE_PER_CPU(long, nr_dentry_negative); #if defined(CONFIG_SYSCTL) && defined(CONFIG_PROC_FS) +/* Statistics gathering. */ +static struct dentry_stat_t dentry_stat = { + .age_limit = 45, +}; /* * Here we resort to our own counters instead of using generic per-cpu counters |