diff options
author | Christoph Hellwig <hch@lst.de> | 2023-06-08 14:02:36 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-06-12 17:04:04 +0300 |
commit | d32e2bf83791727a84ad5d3e3d713e82f9adbe30 (patch) | |
tree | 6aaaf62734fcc70cbb04543bc161c56ab9e2f2b5 /drivers/nvme | |
parent | 444aa2c58cb3b6cfe3b7cc7db6c294d73393a894 (diff) | |
download | linux-d32e2bf83791727a84ad5d3e3d713e82f9adbe30.tar.xz |
block: pass a gendisk to ->open
->open is only called on the whole device. Make that explicit by
passing a gendisk instead of the block_device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christian Brauner <brauner@kernel.org>
Acked-by: Jack Wang <jinpu.wang@ionos.com> [rnbd]
Link: https://lore.kernel.org/r/20230608110258.189493-9-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/core.c | 4 | ||||
-rw-r--r-- | drivers/nvme/host/multipath.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index ccb6eb1282f8..b1c8af5d9376 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1591,9 +1591,9 @@ static void nvme_ns_release(struct nvme_ns *ns) nvme_put_ns(ns); } -static int nvme_open(struct block_device *bdev, fmode_t mode) +static int nvme_open(struct gendisk *disk, fmode_t mode) { - return nvme_ns_open(bdev->bd_disk->private_data); + return nvme_ns_open(disk->private_data); } static void nvme_release(struct gendisk *disk, fmode_t mode) diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index 9171452e2f6d..e8d5d62efa6d 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -402,9 +402,9 @@ static void nvme_ns_head_submit_bio(struct bio *bio) srcu_read_unlock(&head->srcu, srcu_idx); } -static int nvme_ns_head_open(struct block_device *bdev, fmode_t mode) +static int nvme_ns_head_open(struct gendisk *disk, fmode_t mode) { - if (!nvme_tryget_ns_head(bdev->bd_disk->private_data)) + if (!nvme_tryget_ns_head(disk->private_data)) return -ENXIO; return 0; } |