Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d9de535 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarKeith Busch <keith.busch@intel.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
parent 2a876f5e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;