mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-15 09:55:36 +00:00
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 <hch@lst.de> Reported-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Keith Busch <keith.busch@intel.com> Reviewed-by: Max Gurtovoy <maxg@mellanox.com> Tested-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
b1aafb35b4
commit
2631857160
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user