diff options
| author | Christoph Hellwig <hch@lst.de> | 2019-03-03 10:18:30 -0500 |
|---|---|---|
| committer | Christoph Hellwig <hch@lst.de> | 2019-04-05 02:07:57 -0400 |
| commit | 9d9de535f385a8b3ba0e88ca0abf386c5704bbfc (patch) | |
| tree | 78ac5236bc0b996e69c8156b4d920693c9a72b7a /include/linux/blkdev.h | |
| parent | 2a876f5e25e8ec9fa5777d36e5695ee33dd63f6f (diff) | |
block: add a rq_dma_dir helper
In a lot of places we want to know the DMA direction for a given
struct request. Add a little helper to make it a littler easier.
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>
Diffstat (limited to 'include/linux/blkdev.h')
| -rw-r--r-- | include/linux/blkdev.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 3a13fbe13e08..74469a4dc0a1 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -641,6 +641,9 @@ static inline bool blk_account_rq(struct request *rq) | |||
| 641 | 641 | ||
| 642 | #define rq_data_dir(rq) (op_is_write(req_op(rq)) ? WRITE : READ) | 642 | #define rq_data_dir(rq) (op_is_write(req_op(rq)) ? WRITE : READ) |
| 643 | 643 | ||
| 644 | #define rq_dma_dir(rq) \ | ||
| 645 | (op_is_write(req_op(rq)) ? DMA_TO_DEVICE : DMA_FROM_DEVICE) | ||
| 646 | |||
| 644 | static inline bool queue_is_mq(struct request_queue *q) | 647 | static inline bool queue_is_mq(struct request_queue *q) |
| 645 | { | 648 | { |
| 646 | return q->mq_ops; | 649 | return q->mq_ops; |
