From patchwork Fri Oct 19 08:19:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 10648797 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A74D813A4 for ; Fri, 19 Oct 2018 08:20:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96ED928AA7 for ; Fri, 19 Oct 2018 08:20:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B44E28AAF; Fri, 19 Oct 2018 08:20:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D863928AAE for ; Fri, 19 Oct 2018 08:20:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727460AbeJSQZS (ORCPT ); Fri, 19 Oct 2018 12:25:18 -0400 Received: from mailrelay101.isp.belgacom.be ([195.238.20.128]:36172 "EHLO mailrelay101.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727215AbeJSQZP (ORCPT ); Fri, 19 Oct 2018 12:25:15 -0400 X-Belgacom-Dynamic: yes IronPort-PHdr: 9a23:MKI9/xJn2Gabliak2NmcpTZWNBhigK39O0sv0rFitYgfI//xwZ3uMQTl6Ol3ixeRBMOHs60C07KempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzah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65/rFdmyleA0al4heJXFcBJ6/xSTAhpfaLbmuV5E9XaXgPHY8fMRlG7RNmvHTA2SJQ22dBdTVx6HoCMhxrC1iziLaUYm7GRBZc3uvbS1nL/D91+2nDLyO8rgg91EYN0KWS6i/snpEDoDInTnhDBmg== X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AxAACMkslb/7dPQldjHAEBAQQBAQcEAQGBUQcBAQsBgQh8gVMSKIwNX41+AYhQjgmBejgBhEAChQMiNA0NAQMBAQIBAQIBbCiCNiKCYgZWIxBROR4ZgyGBdRGoDYN9hieHLIQ6gUE/gRGIXYUNAohtlVQJhiGKSwIVgU+Ec4lnmBU4gVVNIBiDJ4ImF44cPTCBAwE9AYoyAQE X-IPAS-Result: A2AxAACMkslb/7dPQldjHAEBAQQBAQcEAQGBUQcBAQsBgQh8gVMSKIwNX41+AYhQjgmBejgBhEAChQMiNA0NAQMBAQIBAQIBbCiCNiKCYgZWIxBROR4ZgyGBdRGoDYN9hieHLIQ6gUE/gRGIXYUNAohtlVQJhiGKSwIVgU+Ec4lnmBU4gVVNIBiDJ4ImF44cPTCBAwE9AYoyAQE Received: from 183.79-66-87.adsl-dyn.isp.belgacom.be (HELO localhost.localdomain) ([87.66.79.183]) by relay.skynet.be with ESMTP; 19 Oct 2018 10:20:12 +0200 From: Fabian Frederick To: akpm@linux-foundation.org Cc: jaharkes@cs.cmu.edu, coda@cs.cmu.edu, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, fabf@skynet.be Subject: [PATCH 5/7 linux-next] coda: remove sysctl object from module when unused Date: Fri, 19 Oct 2018 10:19:31 +0200 Message-Id: <1539937173-26260-6-git-send-email-fabf@skynet.be> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1539937173-26260-1-git-send-email-fabf@skynet.be> References: <1539937173-26260-1-git-send-email-fabf@skynet.be> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Inspired by NFS sysctl process Signed-off-by: Fabian Frederick --- 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 1bab69a..30e4e1b 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 bb0b3e0..f82b59c 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 903f2a3..4087264 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); - #define CODA_ALLOC(ptr, cast, size) do { \ if (size < PAGE_SIZE) \ ptr = kzalloc((unsigned long) size, GFP_KERNEL); \ diff --git a/fs/coda/sysctl.c b/fs/coda/sysctl.c index 0301d45..fda3b70 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