* [PATCH] nvme: zns: Simplify nvme_zone_parse_entry()
@ 2025-03-13 5:25 Damien Le Moal
2025-03-13 6:29 ` Christoph Hellwig
2025-03-13 17:02 ` Keith Busch
0 siblings, 2 replies; 3+ messages in thread
From: Damien Le Moal @ 2025-03-13 5:25 UTC (permalink / raw)
To: linux-nvme, Keith Busch, Christoph Hellwig, Sagi Grimberg
Instead of passing a pointer to a struct nvme_ctrl and a pointer to a
struct nvme_ns_head as the first two arguments of
nvme_zone_parse_entry(), pass only a pointer to a struct nvme_ns as both
the controller structure and ns head structure can be infered from the
namespace structure.
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
drivers/nvme/host/zns.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/nvme/host/zns.c b/drivers/nvme/host/zns.c
index 382949e18c6a..cce4c5b55aa9 100644
--- a/drivers/nvme/host/zns.c
+++ b/drivers/nvme/host/zns.c
@@ -146,17 +146,16 @@ static void *nvme_zns_alloc_report_buffer(struct nvme_ns *ns,
return NULL;
}
-static int nvme_zone_parse_entry(struct nvme_ctrl *ctrl,
- struct nvme_ns_head *head,
+static int nvme_zone_parse_entry(struct nvme_ns *ns,
struct nvme_zone_descriptor *entry,
unsigned int idx, report_zones_cb cb,
void *data)
{
+ struct nvme_ns_head *head = ns->head;
struct blk_zone zone = { };
if ((entry->zt & 0xf) != NVME_ZONE_TYPE_SEQWRITE_REQ) {
- dev_err(ctrl->device, "invalid zone type %#x\n",
- entry->zt);
+ dev_err(ns->ctrl->device, "invalid zone type %#x\n", entry->zt);
return -EINVAL;
}
@@ -213,8 +212,7 @@ int nvme_ns_report_zones(struct nvme_ns *ns, sector_t sector,
break;
for (i = 0; i < nz && zone_idx < nr_zones; i++) {
- ret = nvme_zone_parse_entry(ns->ctrl, ns->head,
- &report->entries[i],
+ ret = nvme_zone_parse_entry(ns, &report->entries[i],
zone_idx, cb, data);
if (ret)
goto out_free;
--
2.48.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme: zns: Simplify nvme_zone_parse_entry()
2025-03-13 5:25 [PATCH] nvme: zns: Simplify nvme_zone_parse_entry() Damien Le Moal
@ 2025-03-13 6:29 ` Christoph Hellwig
2025-03-13 17:02 ` Keith Busch
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2025-03-13 6:29 UTC (permalink / raw)
To: Damien Le Moal; +Cc: linux-nvme, Keith Busch, Sagi Grimberg
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme: zns: Simplify nvme_zone_parse_entry()
2025-03-13 5:25 [PATCH] nvme: zns: Simplify nvme_zone_parse_entry() Damien Le Moal
2025-03-13 6:29 ` Christoph Hellwig
@ 2025-03-13 17:02 ` Keith Busch
1 sibling, 0 replies; 3+ messages in thread
From: Keith Busch @ 2025-03-13 17:02 UTC (permalink / raw)
To: Damien Le Moal; +Cc: linux-nvme, Christoph Hellwig, Sagi Grimberg
On Thu, Mar 13, 2025 at 02:25:20PM +0900, Damien Le Moal wrote:
> Instead of passing a pointer to a struct nvme_ctrl and a pointer to a
> struct nvme_ns_head as the first two arguments of
> nvme_zone_parse_entry(), pass only a pointer to a struct nvme_ns as both
> the controller structure and ns head structure can be infered from the
> namespace structure.
Thanks, applied to nvme-6.15.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-13 17:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-13 5:25 [PATCH] nvme: zns: Simplify nvme_zone_parse_entry() Damien Le Moal
2025-03-13 6:29 ` Christoph Hellwig
2025-03-13 17:02 ` Keith Busch
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.