summaryrefslogtreecommitdiffstats
path: root/block/blk-core.c
diff options
context:
space:
mode:
authorDamien Le Moal <damien.lemoal@wdc.com>2018-11-20 10:52:35 +0900
committerJens Axboe <axboe@kernel.dk>2018-11-19 19:03:46 -0700
commit64845a1ddd655574886eb48e9a5eaeeb9b05bf0d (patch)
tree25bc608fd44a569c9fefd6d89a13de734193555e /block/blk-core.c
parente2b3fa5af70c1e646270f6c7c799414f5e904d7a (diff)
downloadlinux-64845a1ddd655574886eb48e9a5eaeeb9b05bf0d.tar.gz
linux-64845a1ddd655574886eb48e9a5eaeeb9b05bf0d.tar.bz2
linux-64845a1ddd655574886eb48e9a5eaeeb9b05bf0d.zip
block: Introduce get_current_ioprio()
Define get_current_ioprio() as an inline helper to obtain the caller I/O priority from its task I/O context. Use this helper in blk_init_request_from_bio() to set a request ioprio. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r--block/blk-core.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 492648c96992..4450d3c08f25 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -813,18 +813,14 @@ out:
void blk_init_request_from_bio(struct request *req, struct bio *bio)
{
- struct io_context *ioc = current->io_context;
-
if (bio->bi_opf & REQ_RAHEAD)
req->cmd_flags |= REQ_FAILFAST_MASK;
req->__sector = bio->bi_iter.bi_sector;
if (ioprio_valid(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);
+ req->ioprio = get_current_ioprio();
req->write_hint = bio->bi_write_hint;
blk_rq_bio_prep(req->q, req, bio);
}