Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1657283
| Path | csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Christoph Hellwig <hch@lst.de> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4 5/8] nvme: get list of namespace descriptors |
| Date | Mon, 05 Jun 2017 07:40:03 +0200 |
| Message-ID | <tOSUb-79A-27@gated-at.bofh.it> (permalink) |
| References | <tOB6V-3JJ-5@gated-at.bofh.it> <tOB6V-3JJ-7@gated-at.bofh.it> |
| X-Original-To | Johannes Thumshirn <jthumshirn@suse.de> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.17 (2007-11-01) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 36 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>, Keith Busch <keith.busch@intel.com>, Hannes Reinecke <hare@suse.de>, maxg@mellanox.com, Linux NVMe Mailinglist <linux-nvme@lists.infradead.org>, Linux Kernel Mailinglist <linux-kernel@vger.kernel.org> |
| X-Original-Date | Mon, 5 Jun 2017 07:38:27 +0200 |
| X-Original-Message-ID | <20170605053825.GE19480@lst.de> |
| X-Original-References | <20170604103649.22130-1-jthumshirn@suse.de> <20170604103649.22130-6-jthumshirn@suse.de> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1657283 |
Show key headers only | View raw
> + }
> + len = NVME_NIDT_UUID_LEN;
> + memcpy(ns->uuid, data + pos + sizeof(*cur), len);
> + break;
> + default:
> + dev_warn(ns->ctrl->dev,
> + "Invalid Namespace Identification Descriptor Type: %d\n",
> + cur->nidt);
> + return;
Please drop the warning and return, the spec says hosts should ignore
unknown types. This is important to future proof for new types that
could be added.
> +static int nvme_identify_ns_descs(struct nvme_ns *ns, unsigned nsid)
> +{
> + struct nvme_command c = { };
> + int status;
> + void *data;
> +
> + c.identify.opcode = nvme_admin_identify;
> + c.identify.nsid = cpu_to_le32(nsid);
> + c.identify.cns = NVME_ID_CNS_NS_DESC_LIST;
> +
> + data = kzalloc(NVME_IDENTIFY_DATA_SIZE, GFP_KERNEL);
> + if (!data)
> + return -ENOMEM;
> +
> + status = nvme_submit_sync_cmd(ns->ctrl->admin_q, &c, data,
> + NVME_IDENTIFY_DATA_SIZE);
> + if (status)
> + goto free_data;
> +
> + nvme_parse_ns_descs(ns, data);
Just merge nvme_parse_ns_descs into the caller?
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v4 5/8] nvme: get list of namespace descriptors Johannes Thumshirn <jthumshirn@suse.de> - 2017-06-04 12:40 +0200
Re: [PATCH v4 5/8] nvme: get list of namespace descriptors Sagi Grimberg <sagi@grimberg.me> - 2017-06-04 17:10 +0200
Re: [PATCH v4 5/8] nvme: get list of namespace descriptors Christoph Hellwig <hch@lst.de> - 2017-06-05 07:40 +0200
Re: [PATCH v4 5/8] nvme: get list of namespace descriptors Sagi Grimberg <sagi@grimberg.me> - 2017-06-06 09:20 +0200
Re: [PATCH v4 5/8] nvme: get list of namespace descriptors Hannes Reinecke <hare@suse.de> - 2017-06-06 08:30 +0200
csiph-web