[PATCH V2 0/1] nvme: introduce generic per-namespace chardev

Minwoo Im minwoo.im.dev at gmail.com
Tue Apr 6 07:48:40 BST 2021


Hello,

This is the second patch series to support generic ns character device
to expose per-namespace instance to the userspace.  This version fixed
code mis-ordered reported by Kanchan.

This patch introduces per-namespace character device to I/O in case that
blkdev is not initialized properly.  Userspace applications are able to
I/O to the generic namespace chardev even there's no blkdev properly
initialized.  Because we don't allow nvme controller device to I/O with
a specified nsid, this generic device will provide a way to I/O.

This patch is derived from Javier's patch series [1].  Javier and I have
re-coded this series again and it starts with new version tag.  Changes
from the previous series are:

  - Update naming convention for the chardev exactly the same with the
    blkdev:
        /dev/nvme-generic-XcYnZ  to  /dev/nvme-generic-XnY

  - Re-consider the multipath support.  Rather than exposing all the
    path-specific namespace path with controller(e.g., nvmeXcYnZ), only
    expose head namespace instance in case of multipath.  Otherwise, it
    will expose all the blkdevs created.

[1] https://lore.kernel.org/linux-nvme/20210301192452.16770-1-javier.gonz@samsung.com/

Since V1:
  - Fix code mis-ordered issue about nvme-subsystem class destroy.
  - Fix for case !multipath, but path-specified namespaces.  Eariler, it
    just created the generic device when the ns_head is initialized, but
    even it's a same namespace and path is different, then generic
    device will be shown as usual in case of !multipath.

Minwoo Im (1):
  nvme: introduce generic per-namespace chardev

 drivers/nvme/host/core.c      | 172 +++++++++++++++++++++++++++++++++-
 drivers/nvme/host/multipath.c |  17 ++++
 drivers/nvme/host/nvme.h      |  25 +++++
 3 files changed, 212 insertions(+), 2 deletions(-)

-- 
2.27.0




More information about the Linux-nvme mailing list