Skip to content

Commit 6975259

Browse files
Fabian Fredericktorvalds
authored andcommitted
coda: remove sysctl object from module when unused
Inspired by NFS sysctl process Link: http://lkml.kernel.org/r/9afcc2cd09490849b309786bbf47fef75de7f91c.1558117389.git.jaharkes@cs.cmu.edu Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Colin Ian King <colin.king@canonical.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Cc: David Howells <dhowells@redhat.com> Cc: Mikko Rapeli <mikko.rapeli@iki.fi> Cc: Sam Protsenko <semen.protsenko@linaro.org> Cc: Yann Droneaud <ydroneaud@opteya.com> Cc: Zhouyang Jia <jiazhouyang09@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent f948452 commit 6975259

4 files changed

Lines changed: 12 additions & 16 deletions

File tree

‎fs/coda/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
obj-$(CONFIG_CODA_FS) += coda.o
77

88
coda-objs := psdev.o cache.o cnode.o inode.o dir.o file.o upcall.o \
9-
coda_linux.o symlink.o pioctl.o sysctl.o
9+
coda_linux.o symlink.o pioctl.o
10+
coda-$(CONFIG_SYSCTL) += sysctl.o
1011

1112
# If you want debugging output, please uncomment the following line.
1213

‎fs/coda/coda_int.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,19 @@ extern int coda_fake_statfs;
1313
void coda_destroy_inodecache(void);
1414
int __init coda_init_inodecache(void);
1515
int coda_fsync(struct file *coda_file, loff_t start, loff_t end, int datasync);
16+
17+
#ifdef CONFIG_SYSCTL
1618
void coda_sysctl_init(void);
1719
void coda_sysctl_clean(void);
20+
#else
21+
static inline void coda_sysctl_init(void)
22+
{
23+
}
1824

25+
static inline void coda_sysctl_clean(void)
26+
{
27+
}
28+
#endif
1929
#endif /* _CODA_INT_ */
2030

2131

‎fs/coda/coda_linux.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ void coda_vattr_to_iattr(struct inode *, struct coda_vattr *);
5959
void coda_iattr_to_vattr(struct iattr *, struct coda_vattr *);
6060
unsigned short coda_flags_to_cflags(unsigned short);
6161

62-
/* sysctl.h */
63-
void coda_sysctl_init(void);
64-
void coda_sysctl_clean(void);
65-
6662
/* inode to cnode access functions */
6763

6864
static inline struct coda_inode_info *ITOC(struct inode *inode)

‎fs/coda/sysctl.c‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#include "coda_int.h"
1414

15-
#ifdef CONFIG_SYSCTL
1615
static struct ctl_table_header *fs_table_header;
1716

1817
static struct ctl_table coda_table[] = {
@@ -62,13 +61,3 @@ void coda_sysctl_clean(void)
6261
fs_table_header = NULL;
6362
}
6463
}
65-
66-
#else
67-
void coda_sysctl_init(void)
68-
{
69-
}
70-
71-
void coda_sysctl_clean(void)
72-
{
73-
}
74-
#endif

0 commit comments

Comments
 (0)