From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <linux-kernel@vger.kernel.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
Jens Axboe <axboe@kernel.dk>
Subject: [PATCH 1/3] block: make genhd.c slightly more explicitly non-modular
Date: Sun, 13 Dec 2015 15:04:02 -0500 [thread overview]
Message-ID: <1450037044-27628-2-git-send-email-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <1450037044-27628-1-git-send-email-paul.gortmaker@windriver.com>
The Makefile currently controlling compilation of this code is:
obj-$(CONFIG_BLOCK) := bio.o elevator.o blk-core.o blk-tag.o blk-sysfs.o \
[...]
genhd.o scsi_ioctl.o partition-generic.o ioprio.o \
...and the Kconfig is:
menuconfig BLOCK
bool "Enable the block layer" if EXPERT
default y
...meaning that it currently is not being built as a module by anyone.
While the code uses moduleparam and other modular infrastructure that
prevents removal of module.h itself, we can at least ensure the way
it is loaded sends a clear message that it is built-in or absent.
Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit. We
do that because the file already has subsys_initcall() usage within,
and I don't want to risk breaking ordering within the file itself.
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
block/genhd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/genhd.c b/block/genhd.c
index cd78712bab8e..333cd557c3a4 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1214,7 +1214,7 @@ static int __init proc_genhd_init(void)
proc_create("partitions", 0, NULL, &proc_partitions_operations);
return 0;
}
-module_init(proc_genhd_init);
+device_initcall(proc_genhd_init);
#endif /* CONFIG_PROC_FS */
dev_t blk_lookup_devt(const char *name, int partno)
--
2.6.1
next prev parent reply other threads:[~2015-12-13 20:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-13 20:04 [PATCH 0/3] block: avoid module usage in non-modular code Paul Gortmaker
2015-12-13 20:04 ` Paul Gortmaker [this message]
2015-12-13 20:04 ` [PATCH 2/3] block: make blk-throttle.c explicitly non-modular Paul Gortmaker
2015-12-15 13:30 ` Vivek Goyal
2015-12-13 20:04 ` [PATCH 3/3] block: make noop-iosched.c " Paul Gortmaker
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=1450037044-27628-2-git-send-email-paul.gortmaker@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=axboe@kernel.dk \
--cc=linux-kernel@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