[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170605053119.GA19480@lst.de>
Date: Mon, 5 Jun 2017 07:31:19 +0200
From: Christoph Hellwig <hch@....de>
To: Johannes Thumshirn <jthumshirn@...e.de>
Cc: Christoph Hellwig <hch@....de>, Sagi Grimberg <sagi@...mberg.me>,
Keith Busch <keith.busch@...el.com>,
Hannes Reinecke <hare@...e.de>, maxg@...lanox.com,
Linux NVMe Mailinglist <linux-nvme@...ts.infradead.org>,
Linux Kernel Mailinglist <linux-kernel@...r.kernel.org>
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;
}
Powered by blists - more mailing lists