summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/lightnvm.c
diff options
context:
space:
mode:
authorMatias Bjørling <mb@lightnvm.io>2018-03-30 00:05:05 +0200
committerJens Axboe <axboe@kernel.dk>2018-03-30 01:29:09 +0200
commit96257a8a7f3183613550c41a909819e028372b61 (patch)
tree0d9f7c00b8c5d2e81f83f152df416cccfe220a03 /drivers/nvme/host/lightnvm.c
parentlightnvm: remove nvm_dev_ops->max_phys_sect (diff)
downloadlinux-96257a8a7f3183613550c41a909819e028372b61.tar.xz
linux-96257a8a7f3183613550c41a909819e028372b61.zip
nvme: lightnvm: add late setup of block size and metadata
The nvme driver sets up the size of the nvme namespace in two steps. First it initializes the device with standard logical block and metadata sizes, and then sets the correct logical block and metadata size. Due to the OCSSD 2.0 specification relies on the namespace to expose these sizes for correct initialization, let it be updated appropriately on the LightNVM side as well. Signed-off-by: Matias Bjørling <mb@lightnvm.io> Acked-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/nvme/host/lightnvm.c')
-rw-r--r--drivers/nvme/host/lightnvm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
index e38d835b15b5..839c0b96466a 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -812,6 +812,14 @@ int nvme_nvm_ioctl(struct nvme_ns *ns, unsigned int cmd, unsigned long arg)
}
}
+void nvme_nvm_update_nvm_info(struct nvme_ns *ns)
+{
+ struct nvm_dev *ndev = ns->ndev;
+
+ ndev->identity.csecs = ndev->geo.sec_size = 1 << ns->lba_shift;
+ ndev->identity.sos = ndev->geo.oob_size = ns->ms;
+}
+
int nvme_nvm_register(struct nvme_ns *ns, char *disk_name, int node)
{
struct request_queue *q = ns->queue;