diff options
author | Christoph Hellwig <hch@lst.de> | 2020-11-26 10:41:07 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-12-01 14:53:40 -0700 |
commit | 977115c0f664e016a6b2774d4f97116ade23d732 (patch) | |
tree | 1fec5aa76caa573bdc71d4731aa5b18b959a3aa3 /drivers/md/dm.c | |
parent | 0d02129e76edf91cf04fabf1efbc3a9a1f1d729a (diff) | |
download | linux-977115c0f664e016a6b2774d4f97116ade23d732.tar.gz linux-977115c0f664e016a6b2774d4f97116ade23d732.tar.bz2 linux-977115c0f664e016a6b2774d4f97116ade23d732.zip |
block: stop using bdget_disk for partition 0
We can just dereference the point in struct gendisk instead. Also
remove the now unused export.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r-- | drivers/md/dm.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 176adcff56b3..ed7e836efbcd 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2375,16 +2375,11 @@ out: */ static int lock_fs(struct mapped_device *md) { - struct block_device *bdev; int r; WARN_ON(test_bit(DMF_FROZEN, &md->flags)); - bdev = bdget_disk(md->disk, 0); - if (!bdev) - return -ENOMEM; - r = freeze_bdev(bdev); - bdput(bdev); + r = freeze_bdev(md->disk->part0); if (!r) set_bit(DMF_FROZEN, &md->flags); return r; @@ -2392,16 +2387,9 @@ static int lock_fs(struct mapped_device *md) static void unlock_fs(struct mapped_device *md) { - struct block_device *bdev; - if (!test_bit(DMF_FROZEN, &md->flags)) return; - - bdev = bdget_disk(md->disk, 0); - if (!bdev) - return; - thaw_bdev(bdev); - bdput(bdev); + thaw_bdev(md->disk->part0); clear_bit(DMF_FROZEN, &md->flags); } |