mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 08:03:01 +09:00
block: deprecate autoloading based on dev_t
Make the legacy dev_t based autoloading optional and add a deprecation warning. This kind of autoloading has ceased to be useful about 20 years ago. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20220104071647.164918-1-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
26291c54e1
commit
fbdee71bb5
@@ -733,12 +733,15 @@ struct block_device *blkdev_get_no_open(dev_t dev)
|
||||
struct inode *inode;
|
||||
|
||||
inode = ilookup(blockdev_superblock, dev);
|
||||
if (!inode) {
|
||||
if (!inode && IS_ENABLED(CONFIG_BLOCK_LEGACY_AUTOLOAD)) {
|
||||
blk_request_module(dev);
|
||||
inode = ilookup(blockdev_superblock, dev);
|
||||
if (!inode)
|
||||
return NULL;
|
||||
if (inode)
|
||||
pr_warn_ratelimited(
|
||||
"block device autoloading is deprecated. It will be removed in Linux 5.19\n");
|
||||
}
|
||||
if (!inode)
|
||||
return NULL;
|
||||
|
||||
/* switch from the inode reference to a device mode one: */
|
||||
bdev = &BDEV_I(inode)->bdev;
|
||||
|
||||
Reference in New Issue
Block a user