summaryrefslogtreecommitdiffstats
path: root/block/blk-mq.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-10-19 09:32:57 -0600
committerJens Axboe <axboe@kernel.dk>2021-10-27 08:43:15 -0600
commit56f8da642bd827ef50a952e7bc3728c5830452be (patch)
tree916416a924b3e3eaa85af1b2502df37114c7f66e /block/blk-mq.h
parent842e39b013465a279fb60348427b9309427a29de (diff)
downloadlinux-56f8da642bd827ef50a952e7bc3728c5830452be.tar.gz
linux-56f8da642bd827ef50a952e7bc3728c5830452be.tar.bz2
linux-56f8da642bd827ef50a952e7bc3728c5830452be.zip
block: add rq_flags to struct blk_mq_alloc_data
There's a hole here we can use, and it's faster to set this earlier rather than need to check q->elevator multiple times. Signed-off-by: Jens Axboe <axboe@kernel.dk> Link: https://lore.kernel.org/r/20211019153300.623322-2-axboe@kernel.dk Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.h')
-rw-r--r--block/blk-mq.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/block/blk-mq.h b/block/blk-mq.h
index 08fb5922e611..28859fc5faee 100644
--- a/block/blk-mq.h
+++ b/block/blk-mq.h
@@ -149,6 +149,7 @@ struct blk_mq_alloc_data {
blk_mq_req_flags_t flags;
unsigned int shallow_depth;
unsigned int cmd_flags;
+ unsigned int rq_flags;
/* allocate multiple requests/tags in one go */
unsigned int nr_tags;
@@ -166,10 +167,9 @@ static inline bool blk_mq_is_shared_tags(unsigned int flags)
static inline struct blk_mq_tags *blk_mq_tags_from_data(struct blk_mq_alloc_data *data)
{
- if (data->q->elevator)
- return data->hctx->sched_tags;
-
- return data->hctx->tags;
+ if (!(data->rq_flags & RQF_ELV))
+ return data->hctx->tags;
+ return data->hctx->sched_tags;
}
static inline bool blk_mq_hctx_stopped(struct blk_mq_hw_ctx *hctx)