Skip to content

Commit

Permalink
block: add a rq_dma_dir helper
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig committed Apr 5, 2019
1 parent 2a876f5 commit 9d9de53
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,9 @@ static inline bool blk_account_rq(struct request *rq)

#define rq_data_dir(rq) (op_is_write(req_op(rq)) ? WRITE : READ)

#define rq_dma_dir(rq) \
(op_is_write(req_op(rq)) ? DMA_TO_DEVICE : DMA_FROM_DEVICE)

static inline bool queue_is_mq(struct request_queue *q)
{
return q->mq_ops;
Expand Down

0 comments on commit 9d9de53

Please sign in to comment.