diff options
author | Keith Busch <keith.busch@intel.com> | 2016-02-24 17:15:53 +0100 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-03-03 22:42:49 +0100 |
commit | 075790ebba4a1eb297f9875e581b55c0382b1f3d (patch) | |
tree | 0b6119c4f7decc6b2809be19006b951e88e34f17 /drivers/nvme/host/nvme.h | |
parent | NVMe: Don't unmap controller registers on reset (diff) | |
download | linux-075790ebba4a1eb297f9875e581b55c0382b1f3d.tar.xz linux-075790ebba4a1eb297f9875e581b55c0382b1f3d.zip |
NVMe: Use IDA for namespace disk naming
A namespace may be detached from a controller, but a user may be holding
a reference to it. Attaching a new namespace with the same NSID will create
duplicate names when using the NSID to name the disk.
This patch uses an IDA that is released only when the last reference is
released instead of using the namespace ID.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme/host/nvme.h')
-rw-r--r-- | drivers/nvme/host/nvme.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index 9664d07d807d..9407f2fa4487 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -72,6 +72,7 @@ struct nvme_ctrl { struct mutex namespaces_mutex; struct device *device; /* char device */ struct list_head node; + struct ida ns_ida; char name[12]; char serial[20]; @@ -102,6 +103,7 @@ struct nvme_ns { struct request_queue *queue; struct gendisk *disk; struct kref kref; + int instance; u8 eui[8]; u8 uuid[16]; |