aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-09-25 18:06:18 +0200
committerJens Axboe <axboe@kernel.dk>2020-10-05 10:38:33 -0600
commit10ed16662da9e28a33b6c991c36c6b323b03dd5b (patch)
tree18e9b39f3f6eb5528a33567258782a20c96384c0 /block
parentdrbd: remove ->this_bdev (diff)
downloadlinux-dev-10ed16662da9e28a33b6c991c36c6b323b03dd5b.tar.xz
linux-dev-10ed16662da9e28a33b6c991c36c6b323b03dd5b.zip
block: add a bdget_part helper
All remaining callers of bdget() outside of fs/block_dev.c want to get a reference to the struct block_device for a given struct hd_struct. Add a helper just for that and then mark bdget static. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/genhd.c2
-rw-r--r--block/partitions/core.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/block/genhd.c b/block/genhd.c
index e5f17f022ec7..0a273211fec2 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1048,7 +1048,7 @@ struct block_device *bdget_disk(struct gendisk *disk, int partno)
part = disk_get_part(disk, partno);
if (part)
- bdev = bdget(part_devt(part));
+ bdev = bdget_part(part);
disk_put_part(part);
return bdev;
diff --git a/block/partitions/core.c b/block/partitions/core.c
index dd6811422a87..5309e0f44ba3 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -580,7 +580,7 @@ int bdev_resize_partition(struct block_device *bdev, int partno,
return -ENXIO;
ret = -ENOMEM;
- bdevp = bdget(part_devt(part));
+ bdevp = bdget_part(part);
if (!bdevp)
goto out_put_part;