The arcane magic in bd_start_claiming is only needed to be able to claim a block_device that hasn't been fully set up. Switch the loop driver that claims from the ioctl path with a fully set up struct block_device to just use the much simpler bd_prepare_to_claim directly.
Showing the changes to include/linux/blkdev.h (1 of 3 files). Show all
Unified · Split
| @@ -1919,7 +1919,8 @@ int blkdev_get(struct block_device *bdev, fmode_t mode, void *holder); · 1918 unmodified lines | |||
| 1919 | struct block_device *blkdev_get_by_path(const char *path, fmode_t mode, | 1919 | struct block_device *blkdev_get_by_path(const char *path, fmode_t mode, |
| 1920 | void *holder); | 1920 | void *holder); |
| 1921 | struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode, void *holder); | 1921 | struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode, void *holder); |
| 1922 | struct block_device *bd_start_claiming(struct block_device *bdev, void *holder); | 1922 | int bd_prepare_to_claim(struct block_device *bdev, struct block_device *whole, |
| 1923 | void *holder); | ||
| 1923 | void bd_abort_claiming(struct block_device *bdev, struct block_device *whole, | 1924 | void bd_abort_claiming(struct block_device *bdev, struct block_device *whole, |
| 1924 | void *holder); | 1925 | void *holder); |
| 1925 | void blkdev_put(struct block_device *bdev, fmode_t mode); | 1926 | void blkdev_put(struct block_device *bdev, fmode_t mode); |