diff options
author | Christoph Hellwig <hch@lst.de> | 2021-08-04 11:56:34 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-08-16 10:50:33 -0600 |
commit | 3973e15fa5342783ce0009ab3a423ae9b811fc63 (patch) | |
tree | 6e4e177714c4ba8d7bfc2eabe8cb84dc2fd2d28f /drivers | |
parent | 2b7a8112212afa90f36391e3ab7df531614bfb6a (diff) |
nvme: use bvec_virt
Use bvec_virt instead of open coding it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Link: https://lore.kernel.org/r/20210804095634.460779-16-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/nvme/host/core.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 1478d825011d..9e51266c9e2c 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -968,12 +968,11 @@ void nvme_cleanup_cmd(struct request *req) { if (req->rq_flags & RQF_SPECIAL_PAYLOAD) { struct nvme_ctrl *ctrl = nvme_req(req)->ctrl; - struct page *page = req->special_vec.bv_page; - if (page == ctrl->discard_page) + if (req->special_vec.bv_page == ctrl->discard_page) clear_bit_unlock(0, &ctrl->discard_page_busy); else - kfree(page_address(page) + req->special_vec.bv_offset); + kfree(bvec_virt(&req->special_vec)); } } EXPORT_SYMBOL_GPL(nvme_cleanup_cmd); |