summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/lightnvm.c
diff options
context:
space:
mode:
authorMatias Bjørling2016-09-16 14:25:04 +0200
committerJens Axboe2016-09-21 15:56:12 +0200
commitac81bfa9867103c9d50996ec21fa9179b81b727e (patch)
treef286f5ea3943c3532b852b44c460d6beb0c6d3c7 /drivers/nvme/host/lightnvm.c
parentlightnvm: NVM should depend on HAS_DMA (diff)
downloadkernel-qcow2-linux-ac81bfa9867103c9d50996ec21fa9179b81b727e.tar.gz
kernel-qcow2-linux-ac81bfa9867103c9d50996ec21fa9179b81b727e.tar.xz
kernel-qcow2-linux-ac81bfa9867103c9d50996ec21fa9179b81b727e.zip
nvme: refactor namespaces to support non-gendisk devices
With LightNVM enabled namespaces, the gendisk structure is not exposed to the user. This prevents LightNVM users from accessing the NVMe device driver specific sysfs entries, and LightNVM namespace geometry. Refactor the revalidation process, so that a namespace, instead of a gendisk, is revalidated. This later allows patches to wire up the sysfs entries up to a non-gendisk namespace. Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme/host/lightnvm.c')
-rw-r--r--drivers/nvme/host/lightnvm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
index 63f483daf930..7268a7a1a19a 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -474,8 +474,9 @@ static inline void nvme_nvm_rqtocmd(struct request *rq, struct nvm_rq *rqd,
c->ph_rw.length = cpu_to_le16(rqd->nr_ppas - 1);
if (rqd->opcode == NVM_OP_HBWRITE || rqd->opcode == NVM_OP_HBREAD)
- c->hb_rw.slba = cpu_to_le64(nvme_block_nr(ns,
- rqd->bio->bi_iter.bi_sector));
+ /* momentarily hardcode the shift configuration. lba_shift from
+ * nvm_dev will be available in a follow-up patch */
+ c->hb_rw.slba = cpu_to_le64(rqd->bio->bi_iter.bi_sector >> 3);
}
static void nvme_nvm_end_io(struct request *rq, int error)