linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Harkes <jaharkes@cs.cmu.edu>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jan Harkes <jaharkes@cs.cmu.edu>,
	linux-fsdevel@vger.kernel.org, Fabian Frederick <fabf@skynet.be>
Subject: [PATCH 20/22] coda: remove sysctl object from module when unused
Date: Fri, 17 May 2019 14:36:58 -0400	[thread overview]
Message-ID: <9afcc2cd09490849b309786bbf47fef75de7f91c.1558117389.git.jaharkes@cs.cmu.edu> (raw)
In-Reply-To: <cover.1558117389.git.jaharkes@cs.cmu.edu>

From: Fabian Frederick <fabf@skynet.be>

Inspired by NFS sysctl process

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
---
 fs/coda/Makefile     |  3 ++-
 fs/coda/coda_int.h   | 10 ++++++++++
 fs/coda/coda_linux.h |  4 ----
 fs/coda/sysctl.c     | 11 -----------
 4 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/fs/coda/Makefile b/fs/coda/Makefile
index 1bab69a0d347..30e4e1bd22bb 100644
--- a/fs/coda/Makefile
+++ b/fs/coda/Makefile
@@ -5,7 +5,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.
 
diff --git a/fs/coda/coda_int.h b/fs/coda/coda_int.h
index bb0b3e0ed6c2..f82b59c9dd28 100644
--- a/fs/coda/coda_int.h
+++ b/fs/coda/coda_int.h
@@ -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_  */
 
 
diff --git a/fs/coda/coda_linux.h b/fs/coda/coda_linux.h
index 517a363245c9..d5ebd36fb2cc 100644
--- a/fs/coda/coda_linux.h
+++ b/fs/coda/coda_linux.h
@@ -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)
diff --git a/fs/coda/sysctl.c b/fs/coda/sysctl.c
index 0301d45000a8..fda3b702b1c5 100644
--- a/fs/coda/sysctl.c
+++ b/fs/coda/sysctl.c
@@ -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
-- 
2.20.1


  parent reply	other threads:[~2019-05-17 18:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17 18:36 [PATCH 00/22] Coda updates Jan Harkes
2019-05-17 18:36 ` [PATCH 01/22] coda: pass the host file in vma->vm_file on mmap Jan Harkes
     [not found]   ` <20190518122241.D867120B7C@mail.kernel.org>
2019-05-18 13:18     ` Jan Harkes
2019-05-17 18:36 ` [PATCH 02/22] uapi linux/coda.h: use __kernel_pid_t for userspace Jan Harkes
2019-05-17 18:36 ` [PATCH 03/22] uapi linux/coda_psdev.h: move upc_req definition from uapi to kernel side headers Jan Harkes
2019-05-17 18:36 ` [PATCH 04/22] coda: add error handling for fget Jan Harkes
2019-05-17 18:36 ` [PATCH 05/22] coda: potential buffer overflow in coda_psdev_write() Jan Harkes
2019-05-17 18:36 ` [PATCH 06/22] coda: Fix build using bare-metal toolchain Jan Harkes
2019-05-17 18:36 ` [PATCH 07/22] coda: don't try to print names that were considered too long Jan Harkes
2019-05-17 18:36 ` [PATCH 08/22] uapi linux/coda_psdev.h: Move CODA_REQ_ from uapi to kernel side headers Jan Harkes
2019-05-17 18:36 ` [PATCH 09/22] coda: clean up indentation, replace spaces with tab Jan Harkes
2019-05-17 18:36 ` [PATCH 10/22] coda: stop using 'struct timespec' in user API Jan Harkes
2019-05-17 18:36 ` [PATCH 11/22] coda: change Coda's user api to use 64-bit time_t in timespec Jan Harkes
2019-05-17 18:36 ` [PATCH 12/22] coda: get rid of CODA_ALLOC() Jan Harkes
2019-05-17 18:36 ` [PATCH 13/22] coda: get rid of CODA_FREE() Jan Harkes
2019-05-17 18:36 ` [PATCH 14/22] coda: bump module version Jan Harkes
2019-05-17 18:36 ` [PATCH 15/22] coda: Move internal defs out of include/linux/ [ver #2] Jan Harkes
2019-05-17 18:36 ` [PATCH 16/22] coda: remove uapi/linux/coda_psdev.h Jan Harkes
2019-05-17 23:29   ` Andrew Morton
2019-05-17 23:49     ` Andrew Morton
2019-05-17 23:51     ` Jan Harkes
2019-05-17 18:36 ` [PATCH 17/22] coda: destroy mutex in put_super() Jan Harkes
2019-05-17 18:36 ` [PATCH 18/22] coda: use SIZE() for stat Jan Harkes
2019-05-17 18:36 ` [PATCH 19/22] coda: add __init to init_coda_psdev() Jan Harkes
2019-05-17 18:36 ` Jan Harkes [this message]
2019-05-17 18:36 ` [PATCH 21/22] coda: remove sb test in coda_fid_to_inode() Jan Harkes
2019-05-17 18:37 ` [PATCH 22/22] coda: ftoc validity check integration Jan Harkes
  -- strict thread matches above, loose matches on Subject: below --
2019-03-20 16:45 [PATCH 00/22] Coda updates for linux-5.1 Jan Harkes
2019-03-20 16:45 ` [PATCH 20/22] coda: remove sysctl object from module when unused Jan Harkes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9afcc2cd09490849b309786bbf47fef75de7f91c.1558117389.git.jaharkes@cs.cmu.edu \
    --to=jaharkes@cs.cmu.edu \
    --cc=akpm@linux-foundation.org \
    --cc=fabf@skynet.be \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).