diff options
author | Christoph Hellwig <hch@lst.de> | 2016-10-20 15:12:12 +0200 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | 0d29a94140c40f1b8a8b371926bf45bddc5e49f1 (patch) | |
tree | cbdda3d4d828d94fcc05489e7b06129b8c40c5d1 /block | |
parent | d5f93913ee55ac7899bc8d50f41391827b596d81 (diff) |
block: replace REQ_THROTTLED with a bio flag
It's the last bio-only REQ_* flag, and we have space for it in the bio
bi_flags field.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Shaun Tancheff <shaun.tancheff@seagate.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 8d2bbd4c8236e9e38e6b36ac9e2c54fdcfe5b335)
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-throttle.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 3a4c9a3c1427..f63ca3dc1136 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -829,13 +829,13 @@ static void throtl_charge_bio(struct throtl_grp *tg, struct bio *bio) tg->io_disp[rw]++; /* - * REQ_THROTTLED is used to prevent the same bio to be throttled + * BIO_THROTTLED is used to prevent the same bio to be throttled * more than once as a throttled bio will go through blk-throtl the * second time when it eventually gets issued. Set it when a bio * is being charged to a tg. */ - if (!(bio->bi_opf & REQ_THROTTLED)) - bio->bi_opf |= REQ_THROTTLED; + if (!bio_flagged(bio, BIO_THROTTLED)) + bio_set_flag(bio, BIO_THROTTLED); } /** @@ -1412,7 +1412,7 @@ bool blk_throtl_bio(struct request_queue *q, struct blkcg_gq *blkg, WARN_ON_ONCE(!rcu_read_lock_held()); /* see throtl_charge_bio() */ - if ((bio->bi_opf & REQ_THROTTLED) || !tg->has_rules[rw]) + if (bio_flagged(bio, BIO_THROTTLED) || !tg->has_rules[rw]) goto out; spin_lock_irq(q->queue_lock); @@ -1491,7 +1491,7 @@ out: * being issued. */ if (!throttled) - bio->bi_opf &= ~REQ_THROTTLED; + bio_clear_flag(bio, BIO_THROTTLED); return throttled; } |