Commit ea511e3c authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

blk-mq: remove blk_mq_sched_{get,put}_rq_priv

Having these as separate helpers in a header really does not help
readability, or my chances to refactor this code sanely.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent d2c0d383
...@@ -36,6 +36,7 @@ static void __blk_mq_sched_assign_ioc(struct request_queue *q, ...@@ -36,6 +36,7 @@ static void __blk_mq_sched_assign_ioc(struct request_queue *q,
struct bio *bio, struct bio *bio,
struct io_context *ioc) struct io_context *ioc)
{ {
struct elevator_queue *e = q->elevator;
struct io_cq *icq; struct io_cq *icq;
spin_lock_irq(q->queue_lock); spin_lock_irq(q->queue_lock);
...@@ -49,13 +50,14 @@ static void __blk_mq_sched_assign_ioc(struct request_queue *q, ...@@ -49,13 +50,14 @@ static void __blk_mq_sched_assign_ioc(struct request_queue *q,
} }
rq->elv.icq = icq; rq->elv.icq = icq;
if (!blk_mq_sched_get_rq_priv(q, rq, bio)) { if (e && e->type->ops.mq.get_rq_priv &&
rq->rq_flags |= RQF_ELVPRIV; e->type->ops.mq.get_rq_priv(q, rq, bio)) {
get_io_context(icq->ioc); rq->elv.icq = NULL;
return; return;
} }
rq->elv.icq = NULL; rq->rq_flags |= RQF_ELVPRIV;
get_io_context(icq->ioc);
} }
void blk_mq_sched_assign_ioc(struct request_queue *q, struct request *rq, void blk_mq_sched_assign_ioc(struct request_queue *q, struct request *rq,
......
...@@ -44,27 +44,6 @@ blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio) ...@@ -44,27 +44,6 @@ blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio)
return __blk_mq_sched_bio_merge(q, bio); return __blk_mq_sched_bio_merge(q, bio);
} }
static inline int blk_mq_sched_get_rq_priv(struct request_queue *q,
struct request *rq,
struct bio *bio)
{
struct elevator_queue *e = q->elevator;
if (e && e->type->ops.mq.get_rq_priv)
return e->type->ops.mq.get_rq_priv(q, rq, bio);
return 0;
}
static inline void blk_mq_sched_put_rq_priv(struct request_queue *q,
struct request *rq)
{
struct elevator_queue *e = q->elevator;
if (e && e->type->ops.mq.put_rq_priv)
e->type->ops.mq.put_rq_priv(q, rq);
}
static inline bool static inline bool
blk_mq_sched_allow_merge(struct request_queue *q, struct request *rq, blk_mq_sched_allow_merge(struct request_queue *q, struct request *rq,
struct bio *bio) struct bio *bio)
......
...@@ -438,7 +438,8 @@ void blk_mq_free_request(struct request *rq) ...@@ -438,7 +438,8 @@ void blk_mq_free_request(struct request *rq)
struct elevator_queue *e = q->elevator; struct elevator_queue *e = q->elevator;
if (rq->rq_flags & RQF_ELVPRIV) { if (rq->rq_flags & RQF_ELVPRIV) {
blk_mq_sched_put_rq_priv(rq->q, rq); if (e && e->type->ops.mq.put_rq_priv)
e->type->ops.mq.put_rq_priv(q, rq);
if (rq->elv.icq) { if (rq->elv.icq) {
put_io_context(rq->elv.icq->ioc); put_io_context(rq->elv.icq->ioc);
rq->elv.icq = NULL; rq->elv.icq = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment