OSDN Git Service

nvmet: support configuring ANA groups
authorChristoph Hellwig <hch@lst.de>
Fri, 1 Jun 2018 06:59:25 +0000 (08:59 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 27 Jul 2018 17:13:06 +0000 (19:13 +0200)
commit62ac0d32f74ea511d5813be728dc589d03f866a3
tree9e707f80d3c84f64117349e24bcd37dc6a4a91c6
parent72efd25dcf4f6310e9e6fa85620aa443b27c23fe
nvmet: support configuring ANA groups

Allow creating non-default ANA groups (group ID > 1).  Groups are created
either by assigning the group ID to a namespace, or by creating a configfs
group object under a specific port.  All namespaces assigned to a group
that doesn't have a configfs object for a given port are marked as
inaccessible.

Allow changing the ANA state on a per-port basis by creating an
ana_groups directory under each port, and another directory with an
ana_state file in it.  The default ANA group 1 directory is created
automatically for each port.

For all changes in ANA configuration the ANA change AEN is sent.  We only
keep a global changecount instead of additional per-group changecounts to
keep the implementation as simple as possible.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
drivers/nvme/target/admin-cmd.c
drivers/nvme/target/configfs.c
drivers/nvme/target/core.c
drivers/nvme/target/nvmet.h