Skip to content

Commit 945e826

Browse files
damien-lemoalkeithbusch
authored andcommitted
nvme: zns: Simplify nvme_zone_parse_entry()
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent ba65af9 commit 945e826

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/nvme/host/zns.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,16 @@ static void *nvme_zns_alloc_report_buffer(struct nvme_ns *ns,
146146
return NULL;
147147
}
148148

149-
static int nvme_zone_parse_entry(struct nvme_ctrl *ctrl,
150-
struct nvme_ns_head *head,
149+
static int nvme_zone_parse_entry(struct nvme_ns *ns,
151150
struct nvme_zone_descriptor *entry,
152151
unsigned int idx, report_zones_cb cb,
153152
void *data)
154153
{
154+
struct nvme_ns_head *head = ns->head;
155155
struct blk_zone zone = { };
156156

157157
if ((entry->zt & 0xf) != NVME_ZONE_TYPE_SEQWRITE_REQ) {
158-
dev_err(ctrl->device, "invalid zone type %#x\n",
159-
entry->zt);
158+
dev_err(ns->ctrl->device, "invalid zone type %#x\n", entry->zt);
160159
return -EINVAL;
161160
}
162161

@@ -213,8 +212,7 @@ int nvme_ns_report_zones(struct nvme_ns *ns, sector_t sector,
213212
break;
214213

215214
for (i = 0; i < nz && zone_idx < nr_zones; i++) {
216-
ret = nvme_zone_parse_entry(ns->ctrl, ns->head,
217-
&report->entries[i],
215+
ret = nvme_zone_parse_entry(ns, &report->entries[i],
218216
zone_idx, cb, data);
219217
if (ret)
220218
goto out_free;

0 commit comments

Comments
 (0)