diff options
author | Christoph Hellwig <hch@lst.de> | 2023-02-14 19:33:07 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-02-14 14:24:09 -0700 |
commit | 9a9c261e6b5512e0b8d9ae9b1c1746c743a15a48 (patch) | |
tree | e9e77c307203e2407ca881ba14b900ad19c60628 /block/blk-cgroup.h | |
parent | b6553bef8cdc2983943f60edb8dc5e49361ebb3b (diff) |
Revert "blk-cgroup: pass a gendisk to blkg_lookup"
This reverts commit 821e840c08ad83736eced4037cdad864e95e2584.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20230214183308.1658775-5-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-cgroup.h')
-rw-r--r-- | block/blk-cgroup.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 151f24de2539..3d9e42c519db 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h @@ -234,30 +234,30 @@ static inline bool bio_issue_as_root_blkg(struct bio *bio) } /** - * blkg_lookup - lookup blkg for the specified blkcg - disk pair + * blkg_lookup - lookup blkg for the specified blkcg - q pair * @blkcg: blkcg of interest - * @disk: gendisk of interest + * @q: request_queue of interest * - * Lookup blkg for the @blkcg - @disk pair. + * Lookup blkg for the @blkcg - @q pair. * Must be called in a RCU critical section. */ static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg, - struct gendisk *disk) + struct request_queue *q) { struct blkcg_gq *blkg; WARN_ON_ONCE(!rcu_read_lock_held()); if (blkcg == &blkcg_root) - return disk->queue->root_blkg; + return q->root_blkg; blkg = rcu_dereference(blkcg->blkg_hint); - if (blkg && blkg->disk == disk) + if (blkg && blkg->disk->queue == q) return blkg; - blkg = radix_tree_lookup(&blkcg->blkg_tree, disk->queue->id); - if (blkg && blkg->disk != disk) + blkg = radix_tree_lookup(&blkcg->blkg_tree, q->id); + if (blkg && blkg->disk->queue != q) blkg = NULL; return blkg; } @@ -357,7 +357,7 @@ static inline void blkg_put(struct blkcg_gq *blkg) #define blkg_for_each_descendant_pre(d_blkg, pos_css, p_blkg) \ css_for_each_descendant_pre((pos_css), &(p_blkg)->blkcg->css) \ if (((d_blkg) = blkg_lookup(css_to_blkcg(pos_css), \ - (p_blkg)->disk))) + (p_blkg)->disk->queue))) /** * blkg_for_each_descendant_post - post-order walk of a blkg's descendants @@ -372,7 +372,7 @@ static inline void blkg_put(struct blkcg_gq *blkg) #define blkg_for_each_descendant_post(d_blkg, pos_css, p_blkg) \ css_for_each_descendant_post((pos_css), &(p_blkg)->blkcg->css) \ if (((d_blkg) = blkg_lookup(css_to_blkcg(pos_css), \ - (p_blkg)->disk))) + (p_blkg)->disk->queue))) bool __blkcg_punt_bio_submit(struct bio *bio); |