Commit 0be0dee6 authored by Bart Van Assche's avatar Bart Van Assche Committed by Jens Axboe

block: Inline blk_rq_set_prio()

Since only a single caller remains, inline blk_rq_set_prio(). Initialize
req->ioprio even if no I/O priority has been set in the bio nor in the
I/O context.
Signed-off-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: default avatarAdam Manzanares <adam.manzanares@wdc.com>
Tested-by: default avatarAdam Manzanares <adam.manzanares@wdc.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Cc: Matias Bjørling <m@bjorling.me>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 9460e280
...@@ -1630,14 +1630,19 @@ unsigned int blk_plug_queued_count(struct request_queue *q) ...@@ -1630,14 +1630,19 @@ unsigned int blk_plug_queued_count(struct request_queue *q)
void blk_init_request_from_bio(struct request *req, struct bio *bio) void blk_init_request_from_bio(struct request *req, struct bio *bio)
{ {
struct io_context *ioc = rq_ioc(bio);
if (bio->bi_opf & REQ_RAHEAD) if (bio->bi_opf & REQ_RAHEAD)
req->cmd_flags |= REQ_FAILFAST_MASK; req->cmd_flags |= REQ_FAILFAST_MASK;
req->errors = 0; req->errors = 0;
req->__sector = bio->bi_iter.bi_sector; req->__sector = bio->bi_iter.bi_sector;
blk_rq_set_prio(req, rq_ioc(bio));
if (ioprio_valid(bio_prio(bio))) if (ioprio_valid(bio_prio(bio)))
req->ioprio = bio_prio(bio); req->ioprio = bio_prio(bio);
else if (ioc)
req->ioprio = ioc->ioprio;
else
req->ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 0);
blk_rq_bio_prep(req->q, req, bio); blk_rq_bio_prep(req->q, req, bio);
} }
EXPORT_SYMBOL_GPL(blk_init_request_from_bio); EXPORT_SYMBOL_GPL(blk_init_request_from_bio);
......
...@@ -1087,20 +1087,6 @@ static inline unsigned int blk_rq_count_bios(struct request *rq) ...@@ -1087,20 +1087,6 @@ static inline unsigned int blk_rq_count_bios(struct request *rq)
return nr_bios; return nr_bios;
} }
/*
* blk_rq_set_prio - associate a request with prio from ioc
* @rq: request of interest
* @ioc: target iocontext
*
* Assocate request prio with ioc prio so request based drivers
* can leverage priority information.
*/
static inline void blk_rq_set_prio(struct request *rq, struct io_context *ioc)
{
if (ioc)
rq->ioprio = ioc->ioprio;
}
/* /*
* Request issue related functions. * Request issue related functions.
*/ */
......
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