From 2f68309ba8522672d278d4a9bce20e7a2b47dd1a Mon Sep 17 00:00:00 2001 From: Baolin Wang Date: Fri, 31 Jul 2020 16:45:32 +0800 Subject: [PATCH] alinux: nvme: pci: Use bio->bi_vcnt directly fix #29327388 Just use bio->bi_vcnt directly to validate if only one bvec in a bio for PRP mode, which can remove warnings for dm device. No functional changes. Fixes: c8b92b847512 ("alios: nvme-pci: Improve mapping single segment requests using PRP") Signed-off-by: Baolin Wang Reviewed-by: Joseph Qi --- drivers/nvme/host/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index b469130c8f14..62bc81b610a2 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -854,9 +854,9 @@ static blk_status_t nvme_map_data(struct nvme_dev *dev, struct request *req, if (blk_rq_nr_phys_segments(req) == 1) { struct bio_vec bv = req_bvec(req); - unsigned int bio_pages = bio_pages_all(req->bio); - if (bio_pages == 1 && bv.bv_offset + bv.bv_len <= dev->ctrl.page_size * 2) + if (req->bio->bi_vcnt == 1 && + bv.bv_offset + bv.bv_len <= dev->ctrl.page_size * 2) return nvme_setup_prp_simple(dev, req, &cmnd->rw, &bv); -- GitLab