* [PATCH 1/3] nvme: remove nvme_ns_config_oncs
2019-03-12 15:24 fix discard and write zeroes configureation for multipath devices Christoph Hellwig
@ 2019-03-12 15:24 ` Christoph Hellwig
2019-03-12 15:59 ` Keith Busch
2019-03-12 22:25 ` Sagi Grimberg
2019-03-12 15:24 ` [PATCH 2/3] nvme: add proper discard setup for the multipath device Christoph Hellwig
` (2 subsequent siblings)
3 siblings, 2 replies; 11+ messages in thread
From: Christoph Hellwig @ 2019-03-12 15:24 UTC (permalink / raw)
Just opencode the two function calls in the caller.
Signed-off-by: Christoph Hellwig <hch at lst.de>
---
drivers/nvme/host/core.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 844cf84105b0..724ac6075901 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1552,12 +1552,6 @@ static inline void nvme_config_write_zeroes(struct nvme_ns *ns)
blk_queue_max_write_zeroes_sectors(ns->queue, max_sectors);
}
-static inline void nvme_ns_config_oncs(struct nvme_ns *ns)
-{
- nvme_config_discard(ns);
- nvme_config_write_zeroes(ns);
-}
-
static void nvme_report_ns_ids(struct nvme_ctrl *ctrl, unsigned int nsid,
struct nvme_id_ns *id, struct nvme_ns_ids *ids)
{
@@ -1620,7 +1614,9 @@ static void nvme_update_disk_info(struct gendisk *disk,
}
set_capacity(disk, capacity);
- nvme_ns_config_oncs(ns);
+
+ nvme_config_discard(ns);
+ nvme_config_write_zeroes(ns);
if (id->nsattr & (1 << 0))
set_disk_ro(disk, true);
--
2.20.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/3] nvme: add proper discard setup for the multipath device
2019-03-12 15:24 fix discard and write zeroes configureation for multipath devices Christoph Hellwig
2019-03-12 15:24 ` [PATCH 1/3] nvme: remove nvme_ns_config_oncs Christoph Hellwig
@ 2019-03-12 15:24 ` Christoph Hellwig
2019-03-12 15:59 ` Keith Busch
2019-03-12 22:25 ` Sagi Grimberg
2019-03-12 15:24 ` [PATCH 3/3] nvme: add proper write zeroes " Christoph Hellwig
2019-03-12 16:08 ` fix discard and write zeroes configureation for multipath devices Max Gurtovoy
3 siblings, 2 replies; 11+ messages in thread
From: Christoph Hellwig @ 2019-03-12 15:24 UTC (permalink / raw)
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 at lst.de>
Reported-by: Sagi Grimberg <sagi at grimberg.me>
---
drivers/nvme/host/core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 724ac6075901..b3c13a486423 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)) {
@@ -1615,7 +1615,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))
--
2.20.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/3] nvme: add proper write zeroes setup for the multipath device
2019-03-12 15:24 fix discard and write zeroes configureation for multipath devices Christoph Hellwig
2019-03-12 15:24 ` [PATCH 1/3] nvme: remove nvme_ns_config_oncs Christoph Hellwig
2019-03-12 15:24 ` [PATCH 2/3] nvme: add proper discard setup for the multipath device Christoph Hellwig
@ 2019-03-12 15:24 ` Christoph Hellwig
2019-03-12 15:59 ` Keith Busch
2019-03-12 22:25 ` Sagi Grimberg
2019-03-12 16:08 ` fix discard and write zeroes configureation for multipath devices Max Gurtovoy
3 siblings, 2 replies; 11+ messages in thread
From: Christoph Hellwig @ 2019-03-12 15:24 UTC (permalink / raw)
Add a gendisk argument to nvme_config_write_zeroes 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 at lst.de>
---
drivers/nvme/host/core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index b3c13a486423..5791e2ca2d2e 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1526,7 +1526,7 @@ static void nvme_config_discard(struct gendisk *disk, struct nvme_ns *ns)
blk_queue_max_write_zeroes_sectors(queue, UINT_MAX);
}
-static inline void nvme_config_write_zeroes(struct nvme_ns *ns)
+static void nvme_config_write_zeroes(struct gendisk *disk, struct nvme_ns *ns)
{
u32 max_sectors;
unsigned short bs = 1 << ns->lba_shift;
@@ -1549,7 +1549,7 @@ static inline void nvme_config_write_zeroes(struct nvme_ns *ns)
else
max_sectors = ((u32)(ns->ctrl->max_hw_sectors + 1) * bs) >> 9;
- blk_queue_max_write_zeroes_sectors(ns->queue, max_sectors);
+ blk_queue_max_write_zeroes_sectors(disk->queue, max_sectors);
}
static void nvme_report_ns_ids(struct nvme_ctrl *ctrl, unsigned int nsid,
@@ -1616,7 +1616,7 @@ static void nvme_update_disk_info(struct gendisk *disk,
set_capacity(disk, capacity);
nvme_config_discard(disk, ns);
- nvme_config_write_zeroes(ns);
+ nvme_config_write_zeroes(disk, ns);
if (id->nsattr & (1 << 0))
set_disk_ro(disk, true);
--
2.20.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* fix discard and write zeroes configureation for multipath devices
2019-03-12 15:24 fix discard and write zeroes configureation for multipath devices Christoph Hellwig
` (2 preceding siblings ...)
2019-03-12 15:24 ` [PATCH 3/3] nvme: add proper write zeroes " Christoph Hellwig
@ 2019-03-12 16:08 ` Max Gurtovoy
3 siblings, 0 replies; 11+ messages in thread
From: Max Gurtovoy @ 2019-03-12 16:08 UTC (permalink / raw)
On 3/12/2019 5:24 PM, Christoph Hellwig wrote:
> Hi all,
>
> this series is based on earlier patches from Sagi and fixes up
> nvme_update_disk_info so that we properly configure discard and
> write zeroes for the multipath device node.
all this series looks good,
Reviewed-by: Max Gurtovoy <maxg at mellanox.com>
^ permalink raw reply [flat|nested] 11+ messages in thread