Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1657088
| From | Sagi Grimberg <sagi@grimberg.me> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4 7/8] nvmet: allow overriding the NVMe VS via configfs |
| Date | 2017-06-04 17:10 +0200 |
| Message-ID | <tOFkd-6N9-5@gated-at.bofh.it> (permalink) |
| References | <tOB6V-3JJ-5@gated-at.bofh.it> <tOB6V-3JJ-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 04/06/17 13:36, Johannes Thumshirn wrote:
> Allow overriding the announced NVMe Version of a via configfs.
>
> This is particularly helpful when debugging new features for the host
> or target side without bumping the hard coded version (as the target
> might not be fully compliant to the announced version yet).
>
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> ---
> drivers/nvme/target/configfs.c | 34 ++++++++++++++++++++++++++++++++++
> include/linux/nvme.h | 4 ++++
> 2 files changed, 38 insertions(+)
>
> diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
> index 16f9f6e3a084..45421d4308a4 100644
> --- a/drivers/nvme/target/configfs.c
> +++ b/drivers/nvme/target/configfs.c
> @@ -650,8 +650,42 @@ static ssize_t nvmet_subsys_attr_allow_any_host_store(struct config_item *item,
>
> CONFIGFS_ATTR(nvmet_subsys_, attr_allow_any_host);
>
> +static ssize_t nvmet_subsys_version_show(struct config_item *item,
> + char *page)
> +{
> + struct nvmet_subsys *subsys = to_subsys(item);
> + int major, minor, tertiary;
> + u32 ver;
> +
> + ver = subsys->ver;
> + major = NVME_MAJOR(ver);
> + minor = NVME_MINOR(ver);
> + tertiary = NVME_TERRIARY(ver);
> +
> + return snprintf(page, PAGE_SIZE, "%d %d %d\n", major, minor, tertiary);
Nit: maybe a dot separator would be better? e.g. "1.3.0" rather than
"1 3 0"
Otherwise looks good,
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v4 7/8] nvmet: allow overriding the NVMe VS via configfs Johannes Thumshirn <jthumshirn@suse.de> - 2017-06-04 12:40 +0200 Re: [PATCH v4 7/8] nvmet: allow overriding the NVMe VS via configfs Sagi Grimberg <sagi@grimberg.me> - 2017-06-04 17:10 +0200 Re: [PATCH v4 7/8] nvmet: allow overriding the NVMe VS via configfs Christoph Hellwig <hch@lst.de> - 2017-06-05 07:50 +0200 Re: [PATCH v4 7/8] nvmet: allow overriding the NVMe VS via configfs Hannes Reinecke <hare@suse.de> - 2017-06-06 08:30 +0200
csiph-web