[PATCH V10 1/8] nvmet: trim args for nvmet_copy_ns_identifier()

Chaitanya Kulkarni Chaitanya.Kulkarni at wdc.com
Tue Mar 9 21:03:26 GMT 2021


On 3/9/21 03:34, Christoph Hellwig wrote:
> This looks really strange to me.  The copy function should just do
> the grunt work, while the policy should stay in the callers.
>

Looking at the code again, this is not a generic copy function but this
is a designated function for the identifier copy, and for each
identifier we have a length parameter that has 1:1 mapping [1], so why
pass that values for each call ?

Anyways if it is going to make code hard to read or maintain I'll drop.

Please let me know.

[1] Identifier to len 1:1 mapping from include/linux/nvme.h :-

#define NVME_NIDT_EUI64_LEN     8
#define NVME_NIDT_NGUID_LEN     16
#define NVME_NIDT_UUID_LEN      16
#define NVME_NIDT_CSI_LEN       1

enum
{                                                                                                

        NVME_NIDT_EUI64         = 0x01,
        NVME_NIDT_NGUID         = 0x02,
        NVME_NIDT_UUID          = 0x03,
        NVME_NIDT_CSI           = 0x04,
};





More information about the Linux-nvme mailing list