block: add dma_map_bvec helper
authorChristoph Hellwig <hch@lst.de>
Sun, 3 Mar 2019 15:40:36 +0000 (08:40 -0700)
committerChristoph Hellwig <hch@lst.de>
Fri, 5 Apr 2019 06:07:57 +0000 (08:07 +0200)
Provide a nice little shortcut for mapping a single bvec.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
include/linux/blkdev.h

index 74469a4dc0a16f0dd20770bf2befd139798a8de7..4b85dc0662641c35ac5928ec74e5d77f5f65905c 100644 (file)
@@ -644,6 +644,10 @@ static inline bool blk_account_rq(struct request *rq)
 #define rq_dma_dir(rq) \
        (op_is_write(req_op(rq)) ? DMA_TO_DEVICE : DMA_FROM_DEVICE)
 
+#define dma_map_bvec(dev, bv, dir, attrs) \
+       dma_map_page_attrs(dev, (bv)->bv_page, (bv)->bv_offset, (bv)->bv_len, \
+       (dir), (attrs))
+
 static inline bool queue_is_mq(struct request_queue *q)
 {
        return q->mq_ops;