[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200826062446.31860-1-hch@lst.de>
Date: Wed, 26 Aug 2020 08:24:27 +0200
From: Christoph Hellwig <hch@....de>
To: Jens Axboe <axboe@...nel.dk>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Denis Efremov <efremov@...ux.com>,
"David S. Miller" <davem@...emloft.net>,
Song Liu <song@...nel.org>, Al Viro <viro@...iv.linux.org.uk>,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-ide@...r.kernel.org, linux-raid@...r.kernel.org,
linux-scsi@...r.kernel.org, linux-m68k@...ts.linux-m68k.org
Subject: simplify gendisk lookup and remove struct block_device aliases
Hi all,
this series removes the annoying struct block_device aliases, which can
happen for a bunch of old floppy drivers (and z2ram). In that case
multiple struct block device instances for different dev_t's can point
to the same gendisk, without being partitions. The cause for that
is the probe/get callback registered through blk_register_regions.
This series removes blk_register_region entirely, splitting it it into
a simple xarray lookup of registered gendisks, and a probe callback
stored in the major_names array that can be used for modprobe overrides
or creating devices on demands when no gendisk is found. The old
remapping is gone entirely, and instead the 4 remaining drivers just
register a gendisk for each operating mode. In case of the two drivers
that have lots of aliases that is done on-demand using the new probe
callback, while for the other two I simply register all at probe time
to keep things simple.
Note that the m68k drivers are compile tested only.
Diffstat:
b/block/genhd.c | 183 +++++++--------
b/drivers/base/Makefile | 2
b/drivers/block/amiflop.c | 98 ++++----
b/drivers/block/ataflop.c | 135 +++++++----
b/drivers/block/brd.c | 39 ---
b/drivers/block/floppy.c | 154 ++++++++----
b/drivers/block/loop.c | 30 --
b/drivers/block/swim.c | 17 -
b/drivers/block/z2ram.c | 551 ++++++++++++++++++++++------------------------
b/drivers/ide/ide-probe.c | 66 -----
b/drivers/ide/ide-tape.c | 2
b/drivers/md/md.c | 21 -
b/drivers/scsi/sd.c | 19 -
b/fs/char_dev.c | 94 +++----
b/fs/dcache.c | 1
b/fs/internal.h | 5
b/include/linux/genhd.h | 12 -
b/include/linux/ide.h | 3
drivers/base/map.c | 154 ------------
include/linux/kobj_map.h | 20 -
20 files changed, 686 insertions(+), 920 deletions(-)
Powered by blists - more mailing lists