block: support delayed holder registration
device mapper needs to register holders before it is ready to do I/O. Currently it does so by registering the disk early, which can leave the disk and queue in a weird half state where the queue is registered with the disk, except for sysfs and the elevator. And this state has been a bit promlematic before, and will get more so when sorting out the responsibilities between the queue and the disk. Support registering holders on an initialized but not registered disk instead by delaying the sysfs registration until the disk is registered. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Link: https://lore.kernel.org/r/20210804094147.459763-5-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
0dbcfe247f
commit
d626338735
3 changed files with 66 additions and 17 deletions
|
|
@ -323,6 +323,7 @@ long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
|
|||
#ifdef CONFIG_BLOCK_HOLDER_DEPRECATED
|
||||
int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk);
|
||||
void bd_unlink_disk_holder(struct block_device *bdev, struct gendisk *disk);
|
||||
int bd_register_pending_holders(struct gendisk *disk);
|
||||
#else
|
||||
static inline int bd_link_disk_holder(struct block_device *bdev,
|
||||
struct gendisk *disk)
|
||||
|
|
@ -333,6 +334,10 @@ static inline void bd_unlink_disk_holder(struct block_device *bdev,
|
|||
struct gendisk *disk)
|
||||
{
|
||||
}
|
||||
static inline int bd_register_pending_holders(struct gendisk *disk)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_BLOCK_HOLDER_DEPRECATED */
|
||||
|
||||
dev_t part_devt(struct gendisk *disk, u8 partno);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue