block: call blk_register_queue earlier in device_add_disk
authorChristoph Hellwig <hch@lst.de>
Wed, 18 Aug 2021 14:45:37 +0000 (16:45 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 23 Aug 2021 18:55:45 +0000 (12:55 -0600)
commit75f4dca59694dfe288ae6a48d7b147b60d11c95c
treed289fc188015956312856ccba0be547fbf25118e
parentbab53f6b617d9f530978d6e3693f88e586d81a8a
block: call blk_register_queue earlier in device_add_disk

Ensure that all the sysfs bits are set up before bdev_add is called,
as that will make the upcomding error handling much easier.  However
this means the call to disk_update_readahead has to be split as that
requires a bdi.  Also remove various sanity checks that don't make
sense now that blk_register_queue only has a single caller.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210818144542.19305-7-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-sysfs.c
block/genhd.c