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>
This commit is contained in:
Fabian Frederick 2019-07-16 16:29:03 -07:00 committed by Linus Torvalds
parent f94845284a
commit 6975259ae3
4 changed files with 12 additions and 16 deletions

View File

@ -6,7 +6,8 @@
obj-$(CONFIG_CODA_FS) += coda.o
coda-objs := psdev.o cache.o cnode.o inode.o dir.o file.o upcall.o \
coda_linux.o symlink.o pioctl.o sysctl.o
coda_linux.o symlink.o pioctl.o
coda-$(CONFIG_SYSCTL) += sysctl.o
# If you want debugging output, please uncomment the following line.

View File

@ -13,9 +13,19 @@ extern int coda_fake_statfs;
void coda_destroy_inodecache(void);
int __init coda_init_inodecache(void);
int coda_fsync(struct file *coda_file, loff_t start, loff_t end, int datasync);
#ifdef CONFIG_SYSCTL
void coda_sysctl_init(void);
void coda_sysctl_clean(void);
#else
static inline void coda_sysctl_init(void)
{
}
static inline void coda_sysctl_clean(void)
{
}
#endif
#endif /* _CODA_INT_ */

View File

@ -59,10 +59,6 @@ void coda_vattr_to_iattr(struct inode *, struct coda_vattr *);
void coda_iattr_to_vattr(struct iattr *, struct coda_vattr *);
unsigned short coda_flags_to_cflags(unsigned short);
/* sysctl.h */
void coda_sysctl_init(void);
void coda_sysctl_clean(void);
/* inode to cnode access functions */
static inline struct coda_inode_info *ITOC(struct inode *inode)

View File

@ -12,7 +12,6 @@
#include "coda_int.h"
#ifdef CONFIG_SYSCTL
static struct ctl_table_header *fs_table_header;
static struct ctl_table coda_table[] = {
@ -62,13 +61,3 @@ void coda_sysctl_clean(void)
fs_table_header = NULL;
}
}
#else
void coda_sysctl_init(void)
{
}
void coda_sysctl_clean(void)
{
}
#endif