]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - block/blk-throttle.c
Merge tag 'configfs-for-4.10' of git://git.infradead.org/users/hch/configfs
[mirror_ubuntu-artful-kernel.git] / block / blk-throttle.c
index a3ea8260c94c89236f938fb255158be8cb880a73..a6bb4fe326c39b2a996fe4330bc15933451d6503 100644 (file)
@@ -818,13 +818,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);
 }
 
 /**
@@ -1401,7 +1401,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);
@@ -1480,7 +1480,7 @@ out:
         * being issued.
         */
        if (!throttled)
-               bio->bi_opf &= ~REQ_THROTTLED;
+               bio_clear_flag(bio, BIO_THROTTLED);
        return throttled;
 }