提交 2f68309b 编写于 作者: B Baolin Wang 提交者: Caspar Zhang

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: NBaolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
上级 1f0aa1e1
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册