aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <[email protected]>2019-03-13 18:55:07 +0100
committerJens Axboe <[email protected]>2019-03-13 12:57:34 -0600
commit2631857160ecbea04e54423f5053133fe2b6ea45 (patch)
treec4fbd6e2b8003da5793927629ba9033a78d7cf0b
parentb1aafb35b45b1d734c670059c125a4ff111a47bd (diff)
nvme: add proper discard setup for the multipath device
Add a gendisk argument to nvme_config_discard so that the call to nvme_update_disk_info for the multipath device node updates the proper request_queue. Signed-off-by: Christoph Hellwig <[email protected]> Reported-by: Sagi Grimberg <[email protected]> Reviewed-by: Keith Busch <[email protected]> Reviewed-by: Max Gurtovoy <[email protected]> Tested-by: Sagi Grimberg <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
-rw-r--r--drivers/nvme/host/core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 26ae805fc958..6a57ece7d76b 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1495,10 +1495,10 @@ static void nvme_set_chunk_size(struct nvme_ns *ns)
blk_queue_chunk_sectors(ns->queue, rounddown_pow_of_two(chunk_size));
}
-static void nvme_config_discard(struct nvme_ns *ns)
+static void nvme_config_discard(struct gendisk *disk, struct nvme_ns *ns)
{
struct nvme_ctrl *ctrl = ns->ctrl;
- struct request_queue *queue = ns->queue;
+ struct request_queue *queue = disk->queue;
u32 size = queue_logical_block_size(queue);
if (!(ctrl->oncs & NVME_CTRL_ONCS_DSM)) {
@@ -1606,7 +1606,7 @@ static void nvme_update_disk_info(struct gendisk *disk,
set_capacity(disk, capacity);
- nvme_config_discard(ns);
+ nvme_config_discard(disk, ns);
nvme_config_write_zeroes(ns);
if (id->nsattr & (1 << 0))