summaryrefslogtreecommitdiff
path: root/drivers/block/nbd.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-11-26 10:41:07 +0100
committerJens Axboe <axboe@kernel.dk>2020-12-01 14:53:40 -0700
commit977115c0f664e016a6b2774d4f97116ade23d732 (patch)
tree1fec5aa76caa573bdc71d4731aa5b18b959a3aa3 /drivers/block/nbd.c
parent0d02129e76edf91cf04fabf1efbc3a9a1f1d729a (diff)
downloadlwn-977115c0f664e016a6b2774d4f97116ade23d732.tar.gz
lwn-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/block/nbd.c')
-rw-r--r--drivers/block/nbd.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 014683968ce1..92f84ed0ba9e 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1488,12 +1488,10 @@ out:
static void nbd_release(struct gendisk *disk, fmode_t mode)
{
struct nbd_device *nbd = disk->private_data;
- struct block_device *bdev = bdget_disk(disk, 0);
if (test_bit(NBD_RT_DISCONNECT_ON_CLOSE, &nbd->config->runtime_flags) &&
- bdev->bd_openers == 0)
+ disk->part0->bd_openers == 0)
nbd_disconnect_and_put(nbd);
- bdput(bdev);
nbd_config_put(nbd);
nbd_put(nbd);