From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <linux-kernel@vger.kernel.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
Al Viro <viro@zeniv.linux.org.uk>,
Andrew Morton <akpm@linux-foundation.org>,
David Howells <dhowells@redhat.com>,
Eric Paris <eparis@parisplace.org>, Jan Kara <jack@suse.com>,
"J. Bruce Fields" <bfields@fieldses.org>,
Jeff Layton <jlayton@poochiereds.net>,
Josh Triplett <josh@joshtriplett.org>,
<linux-fsdevel@vger.kernel.org>,
Nadia Yvette Chambers <nyc@holomorphy.com>,
Peter Hurley <peter@hurleysoftware.com>
Subject: [PATCH 00/10] fs: don't use module_init in non-modular code
Date: Sat, 12 Dec 2015 16:30:02 -0500 [thread overview]
Message-ID: <1449955812-10149-1-git-send-email-paul.gortmaker@windriver.com> (raw)
There are several reasons to not use module_init for code that can
never be built as a module, but the big ones are:
(1) it is easy to accidentally code up an unused module_exit function
(2) it can be misleading when reading the source, thinking it can be
modular when the Makefile and/or Kconfig prohibit it
(3) it requires the include of the module.h header file which in turn
includes nearly everything else.
Here we convert some module_init() calls into fs_initcall(). In doing
so we must note that this changes the init ordering slightly, since
module_init() becomes device_initcall() in the non-modular case, and
that comes after fs_initcall().
We could have used device_initcall here to strictly preserve the old
ordering, but using that in the fs/ dir just seems wrong, and we have
done similar minor init ordering shuffles in the past w/o fallout.
Fortunately the code here is core fs code and not strictly a driver
in the sense that a UART or GPIO driver is. So we don't have the
concerns here with respect to limiting unbinding that we have when
doing similar cleanups over there in the drivers/* dir.
These commits were generated and tested on linux-next but I can put
them on a v4.4-rc4 based branch if merge processing vs mail processing
is desired. Given that they are largely trivial, I don't think the
underlying baseline is all that important here.
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Eric Paris <eparis@parisplace.org>
Cc: Jan Kara <jack@suse.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Jeff Layton <jlayton@poochiereds.net>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: linux-fsdevel@vger.kernel.org
Cc: Nadia Yvette Chambers <nyc@holomorphy.com>
Cc: Peter Hurley <peter@hurleysoftware.com>
Paul Gortmaker (10):
fs: make notify dnotify.c explicitly non-modular
fs: make quota/netlink.c explicitly non-modular
fs: make fcntl.c explicitly non-modular
fs: make filesystems.c explicitly non-modular
fs: make locks.c explicitly non-modular
fs: make direct-io.c explicitly non-modular
fs: make devpts/inode.c explicitly non-modular
fs: make binfmt_elf.c explicitly non-modular
fs: make hugetlbfs/inode.c explicitly non-modular
fs: make quota/dquot.c explicitly non-modular
fs/binfmt_elf.c | 11 +----------
fs/devpts/inode.c | 3 +--
fs/direct-io.c | 4 ++--
fs/fcntl.c | 4 +---
fs/filesystems.c | 2 +-
fs/hugetlbfs/inode.c | 27 ++-------------------------
fs/locks.c | 3 +--
fs/notify/dnotify/dnotify.c | 4 +---
fs/quota/dquot.c | 2 +-
fs/quota/netlink.c | 5 +----
10 files changed, 12 insertions(+), 53 deletions(-)
--
2.6.1
next reply other threads:[~2015-12-12 21:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-12 21:30 Paul Gortmaker [this message]
2015-12-12 21:30 ` [PATCH 03/10] fs: make fcntl.c explicitly non-modular Paul Gortmaker
2015-12-12 21:30 ` [PATCH 04/10] fs: make filesystems.c " Paul Gortmaker
2015-12-12 21:30 ` [PATCH 05/10] fs: make locks.c " Paul Gortmaker
2015-12-14 11:31 ` Jeff Layton
2015-12-14 15:34 ` Paul Gortmaker
2015-12-12 21:30 ` [PATCH 06/10] fs: make direct-io.c " Paul Gortmaker
2015-12-12 21:30 ` [PATCH 08/10] fs: make binfmt_elf.c " Paul Gortmaker
2015-12-12 21:30 ` [PATCH 09/10] fs: make hugetlbfs/inode.c " Paul Gortmaker
2015-12-14 16:14 ` Paul Gortmaker
2015-12-14 20:41 ` [PATCH v2] hugetlb: make mm and fs code " Paul Gortmaker
2015-12-12 21:30 ` [PATCH 10/10] fs: make quota/dquot.c " Paul Gortmaker
2015-12-14 11:05 ` Jan Kara
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=1449955812-10149-1-git-send-email-paul.gortmaker@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=akpm@linux-foundation.org \
--cc=bfields@fieldses.org \
--cc=dhowells@redhat.com \
--cc=eparis@parisplace.org \
--cc=jack@suse.com \
--cc=jlayton@poochiereds.net \
--cc=josh@joshtriplett.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nyc@holomorphy.com \
--cc=peter@hurleysoftware.com \
--cc=viro@zeniv.linux.org.uk \
/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).