diff options
author | Christoph Hellwig <hch@lst.de> | 2015-10-26 17:12:51 +0900 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-12-22 09:38:34 -0700 |
commit | bf68405705bd35c09ec1f7528718dce5af88daff (patch) | |
tree | 5a2f78fcb3663462754ffe8706ae1814bf959130 /drivers/nvme | |
parent | eee417b0697827a6e120199b126b447af3c81b47 (diff) |
nvme: meta_sg doesn't have to be an array
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/pci.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index ec768b64ab77..24d695a2f6c4 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -174,7 +174,7 @@ struct nvme_iod { int nents; /* Used in scatterlist */ int length; /* Of data, in bytes */ dma_addr_t first_dma; - struct scatterlist meta_sg[1]; /* metadata requires single contiguous buffer */ + struct scatterlist meta_sg; /* metadata requires single contiguous buffer */ struct scatterlist sg[0]; }; @@ -594,21 +594,21 @@ static int nvme_map_data(struct nvme_dev *dev, struct nvme_iod *iod, if (blk_rq_count_integrity_sg(q, req->bio) != 1) goto out_unmap; - sg_init_table(iod->meta_sg, 1); - if (blk_rq_map_integrity_sg(q, req->bio, iod->meta_sg) != 1) + sg_init_table(&iod->meta_sg, 1); + if (blk_rq_map_integrity_sg(q, req->bio, &iod->meta_sg) != 1) goto out_unmap; if (rq_data_dir(req)) nvme_dif_remap(req, nvme_dif_prep); - if (!dma_map_sg(dev->dev, iod->meta_sg, 1, dma_dir)) + if (!dma_map_sg(dev->dev, &iod->meta_sg, 1, dma_dir)) goto out_unmap; } cmnd->rw.prp1 = cpu_to_le64(sg_dma_address(iod->sg)); cmnd->rw.prp2 = cpu_to_le64(iod->first_dma); if (blk_integrity_rq(req)) - cmnd->rw.metadata = cpu_to_le64(sg_dma_address(iod->meta_sg)); + cmnd->rw.metadata = cpu_to_le64(sg_dma_address(&iod->meta_sg)); return BLK_MQ_RQ_QUEUE_OK; out_unmap: @@ -628,7 +628,7 @@ static void nvme_unmap_data(struct nvme_dev *dev, struct nvme_iod *iod) if (blk_integrity_rq(req)) { if (!rq_data_dir(req)) nvme_dif_remap(req, nvme_dif_complete); - dma_unmap_sg(dev->dev, iod->meta_sg, 1, dma_dir); + dma_unmap_sg(dev->dev, &iod->meta_sg, 1, dma_dir); } } |