History

block: replace BIO_QUEUE_ENTERED with BIO_CGROUP_ACCT

BIO_QUEUE_ENTERED is only used for cgroup accounting now, so rename the flag and move setting it into the cgroup code.

Christoph Hellwig committed 6 years ago

Commit 0376e9e1 parent 760f83e3 files · +7 −15Browse files

Showing the changes to include/linux (2 of 3 files). Show all

Unified · Split

2 files
  1. include/linux/blk-cgroup.h +6 −4
  2. include/linux/blk_types.h +1 −1
include/linux/blk-cgroup.h+6−4
@@ -607,12 +607,14 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q, · 606 unmodified lines
607 u64_stats_update_begin(&bis->sync);607 u64_stats_update_begin(&bis->sync);
608 608
609 /*609 /*
610 * If the bio is flagged with BIO_QUEUE_ENTERED it means this610 * If the bio is flagged with BIO_CGROUP_ACCT it means this is a
611 * is a split bio and we would have already accounted for the611 * split bio and we would have already accounted for the size of
612 * size of the bio.612 * the bio.
613 */613 */
614 if (!bio_flagged(bio, BIO_QUEUE_ENTERED))614 if (!bio_flagged(bio, BIO_CGROUP_ACCT)) {
615 bio_set_flag(bio, BIO_CGROUP_ACCT);
615 bis->cur.bytes[rwd] += bio->bi_iter.bi_size;616 bis->cur.bytes[rwd] += bio->bi_iter.bi_size;
617 }
616 bis->cur.ios[rwd]++;618 bis->cur.ios[rwd]++;
617 619
618 u64_stats_update_end(&bis->sync);620 u64_stats_update_end(&bis->sync);
include/linux/blk_types.h+1−1
@@ -220,7 +220,7 @@ enum { · 219 unmodified lines
220 * throttling rules. Don't do it again. */220 * throttling rules. Don't do it again. */
221 BIO_TRACE_COMPLETION, /* bio_endio() should trace the final completion221 BIO_TRACE_COMPLETION, /* bio_endio() should trace the final completion
222 * of this bio. */222 * of this bio. */
223 BIO_QUEUE_ENTERED, /* can use blk_queue_enter_live() */223 BIO_CGROUP_ACCT, /* has been accounted to a cgroup */
224 BIO_TRACKED, /* set if bio goes through the rq_qos path */224 BIO_TRACKED, /* set if bio goes through the rq_qos path */
225 BIO_FLAG_LAST225 BIO_FLAG_LAST
226};226};