]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet: Change max_nsid in subsystem due to ns_disable if needed
authorRoy Shterman <roys@lightbitslabs.com>
Wed, 18 Oct 2017 10:46:07 +0000 (13:46 +0300)
committerChristoph Hellwig <hch@lst.de>
Fri, 20 Oct 2017 10:06:02 +0000 (12:06 +0200)
commite103d7b01529a3675265b42ffef03be7de67e079
tree4ab490185eed392dab6b55cab62f0fc48ecc78b4
parent537928e76fa641f35c518963e8134a910b6cc0a4
nvmet: Change max_nsid in subsystem due to ns_disable if needed

In case we disable namespaces which has the nsid like
subsystem max_nsid we need to search for the next largest nsid
in this subsystem. If the subsystem don't has more namespaces
we set it to 0, else we take nsid from the last namespace in
namespaces list because the list is sorted while inserting.

Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Roy Shterman <roys@lightbitslabs.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
[hch: slight refactor]
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/core.c