[PATCH v2] nvme: use uuid_t in nvme_ns

Andy Shevchenko andy.shevchenko at gmail.com
Mon Jun 12 02:50:55 PDT 2017


On Mon, Jun 12, 2017 at 12:12 PM, Johannes Thumshirn <jthumshirn at suse.de> wrote:
> struct nvme_ns still uses u u8 uuid[16], change it to using uuid_t and
> use the UUID API.

Thanks for an update.

See my further comments below.

>                         len = NVME_NIDT_UUID_LEN;
> -                       memcpy(ns->uuid, data + pos + sizeof(*cur), len);
> +                       uuid_copy(&ns->uuid, data + pos + sizeof(*cur));

So, this reveals two thins:
1) shall we define NVME_NIDT_UUID_LEN to be UUID_LEN or substitute it
completely with the latter?
2) Is the len variable used later in the function?

> -               if (!memchr_inv(ns->uuid, 0, sizeof(ns->uuid)) ||
> +               if (uuid_is_null(&ns->uuid) ||
>                     !memchr_inv(ns->nguid, 0, sizeof(ns->nguid)))

>         u8 nguid[16];
> -       u8 uuid[16];
> +       uuid_t uuid;

Do you plan to switch nguid to be guid_t / uuid_t ?

-- 
With Best Regards,
Andy Shevchenko



More information about the Linux-nvme mailing list