OSDN Git Service

nvmet: introduce the passthru configfs interface
authorLogan Gunthorpe <logang@deltatee.com>
Fri, 24 Jul 2020 17:25:19 +0000 (11:25 -0600)
committerChristoph Hellwig <hch@lst.de>
Wed, 29 Jul 2020 05:45:21 +0000 (07:45 +0200)
commitcae5b01a2afc2058bee94b4b8f873d3a4a9ec41e
tree78f740284dd55f02b1997b986930f46bc6bbc077
parentba76af676cd0514614b5a99b8adad9d3956f5d7d
nvmet: introduce the passthru configfs interface

When CONFIG_NVME_TARGET_PASSTHRU as 'passthru' directory will
be added to each subsystem. The directory is similar to a namespace
and has two attributes: device_path and enable. The user must set the
path to the nvme controller's char device and write '1' to enable the
subsystem to use passthru.

Any given subsystem is prevented from enabling both a regular namespace
and the passthru device. If one is enabled, enabling the other will
produce an error.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/configfs.c
drivers/nvme/target/nvmet.h