[RFC PATCH 1/8] nvme-core: add new interfaces
Chaitanya Kulkarni
Chaitanya.Kulkarni at wdc.com
Mon Apr 2 16:25:57 PDT 2018
[CK] Okay, I'll fix it in next version.
On 3/30/18, 10:48 AM, "Logan Gunthorpe" <logang at deltatee.com> wrote:
On 30/03/18 12:57 AM, Chaitanya Kulkarni wrote:
> +int nvme_get_ctrl_by_name(char *ctrl_name, struct nvme_ctrl **ctrl)
> +{
> + int ret = -ENODEV;
> + char str[256] = "/dev/";
Kernel code should not make assumptions about the layout of the
filesystem. Prepending "/dev/" to a controller name is icky. I'd suggest
looking at blkdev_get_by_path() and doing something similar. Also this
function should probably be called nvme_get_ctrl_by_path() seeing it
seems to be trying to take a path and not a name.
Logan
More information about the Linux-nvme
mailing list