nvme: introduce generic per-namespace chardev
authorMinwoo Im <minwoo.im.dev@gmail.com>
Wed, 21 Apr 2021 07:45:04 +0000 (16:45 +0900)
committerChristoph Hellwig <hch@lst.de>
Thu, 22 Apr 2021 05:25:17 +0000 (07:25 +0200)
commit2637baed78010eeaae274feb5b99ce90933fadfb
treef62d5575463b77bd8ca7da8d6d2ed8086d54a8a3
parent60df5de9b0532aff59a00475b57c265b4a3620e1
nvme: introduce generic per-namespace chardev

Userspace has not been allowed to I/O to device that's failed to
be initialized.  This patch introduces generic per-namespace character
device to allow userspace to I/O regardless the block device is there or
not.

The chardev naming convention will similar to the existing blkdev naming,
using a ng prefix instead of nvme, i.e.

- /dev/ngXnY

It also supports multipath which means it will not expose chardev for the
hidden namespace blkdevs (e.g., nvmeXcYnZ).  If /dev/ngXnY is created for
a ns_head, then I/O request will be routed to a specific controller
selected by the iopolicy of the subsystem.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Signed-off-by: Javier González <javier.gonz@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Tested-by: Kanchan Joshi <joshi.k@samsung.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c
drivers/nvme/host/ioctl.c
drivers/nvme/host/multipath.c
drivers/nvme/host/nvme.h