summaryrefslogtreecommitdiff
path: root/drivers/block/loop.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-07-16 17:33:09 +0300
committerJens Axboe <axboe@kernel.dk>2020-07-16 18:35:44 +0300
commitecbe6bc0003bfd5bf8581cb679cae0eb944432cb (patch)
tree5006b0a7baecfb91cdcdb8ccc8a033e6ba02ba49 /drivers/block/loop.c
parent58e46ed9cc634b3c64ea402789f8a92ce45cee48 (diff)
downloadlinux-ecbe6bc0003bfd5bf8581cb679cae0eb944432cb.tar.xz
block: use bd_prepare_to_claim directly in the loop driver
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. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/loop.c')
-rw-r--r--drivers/block/loop.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index a943207705dd..d18160146226 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1090,11 +1090,10 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
* here to avoid changing device under exclusive owner.
*/
if (!(mode & FMODE_EXCL)) {
- claimed_bdev = bd_start_claiming(bdev, loop_configure);
- if (IS_ERR(claimed_bdev)) {
- error = PTR_ERR(claimed_bdev);
+ claimed_bdev = bdev->bd_contains;
+ error = bd_prepare_to_claim(bdev, claimed_bdev, loop_configure);
+ if (error)
goto out_putf;
- }
}
error = mutex_lock_killable(&loop_ctl_mutex);