Skip to content

Commit

Permalink
blk-mq: remove RQF_ELVPRIV
Browse files Browse the repository at this point in the history
RQF_ELVPRIV is set for all non-flush requests that have RQF_ELV set.
Expand this condition in the two users of the flag and remove it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230518053101.760632-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and axboe committed May 19, 2023
1 parent d97217e commit fdcab6c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion block/blk-mq-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ static const char *const rqf_name[] = {
RQF_NAME(DONTPREP),
RQF_NAME(FAILED),
RQF_NAME(QUIET),
RQF_NAME(ELVPRIV),
RQF_NAME(IO_STAT),
RQF_NAME(PM),
RQF_NAME(HASHED),
Expand Down
4 changes: 2 additions & 2 deletions block/blk-mq-sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ static inline void blk_mq_sched_completed_request(struct request *rq, u64 now)

static inline void blk_mq_sched_requeue_request(struct request *rq)
{
if (rq->rq_flags & RQF_ELV) {
if ((rq->rq_flags & RQF_ELV) && !op_is_flush(rq->cmd_flags)) {
struct request_queue *q = rq->q;
struct elevator_queue *e = q->elevator;

if ((rq->rq_flags & RQF_ELVPRIV) && e->type->ops.requeue_request)
if (e->type->ops.requeue_request)
e->type->ops.requeue_request(rq);
}
}
Expand Down
6 changes: 2 additions & 4 deletions block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,8 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data,
RB_CLEAR_NODE(&rq->rb_node);

if (!op_is_flush(data->cmd_flags) &&
e->type->ops.prepare_request) {
e->type->ops.prepare_request)
e->type->ops.prepare_request(rq);
rq->rq_flags |= RQF_ELVPRIV;
}
}

return rq;
Expand Down Expand Up @@ -696,7 +694,7 @@ void blk_mq_free_request(struct request *rq)
struct request_queue *q = rq->q;
struct blk_mq_hw_ctx *hctx = rq->mq_hctx;

if ((rq->rq_flags & RQF_ELVPRIV) &&
if ((rq->rq_flags & RQF_ELV) && !op_is_flush(rq->cmd_flags) &&
q->elevator->type->ops.finish_request)
q->elevator->type->ops.finish_request(rq);

Expand Down
2 changes: 0 additions & 2 deletions include/linux/blk-mq.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ typedef __u32 __bitwise req_flags_t;
#define RQF_FAILED ((__force req_flags_t)(1 << 10))
/* don't warn about errors */
#define RQF_QUIET ((__force req_flags_t)(1 << 11))
/* elevator private data attached */
#define RQF_ELVPRIV ((__force req_flags_t)(1 << 12))
/* account into disk and partition IO statistics */
#define RQF_IO_STAT ((__force req_flags_t)(1 << 13))
/* runtime pm request */
Expand Down

0 comments on commit fdcab6c

Please sign in to comment.