Messages in this thread | | | Date | Mon, 5 Jun 2017 07:31:19 +0200 | From | Christoph Hellwig <> | Subject | Re: [PATCH v3 3/8] nvmet: implement namespace identify descriptor list |
| |
What about a little helper like this: ?
static u16 nvmet_copy_ns_identifier(struct nvmet_req *req, u8 type, u8 len, void *id, off_t *off) { struct nvme_ns_identifier_hdr hdr = { .nidt = type, .nidl = len, }; u16 status;
status = nvmet_copy_to_sgl(req, *off, &hdr, sizeof(hdr)); if (status) return status; *off += sizeof(hdr);
status = nvmet_copy_to_sgl(req, off, id, len); if (status) return status; *off += len;
return 0; }
| |