summaryrefslogtreecommitdiff
path: root/block/blk-cgroup.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-02-03 16:03:59 +0100
committerJens Axboe <axboe@kernel.dk>2023-02-03 08:20:05 -0700
commit479664cee14d8452d3d76f8d0b7fccd0cbe4ed49 (patch)
treef0d6272a3076166c34f17b2e3c92fb0024e28b31 /block/blk-cgroup.c
parent0a0b4f79db2e6e745672aa3852cf5fdf7af14a0f (diff)
downloadlinux-479664cee14d8452d3d76f8d0b7fccd0cbe4ed49.tar.gz
blk-cgroup: pass a gendisk to blkg_lookup
Pass a gendisk to blkg_lookup and use that to find the match as part of phasing out usage of the request_queue in the blk-cgroup code. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Andreas Herrmann <aherrmann@suse.de> Acked-by: Tejun Heo <tj@kernel.org> Link: https://lore.kernel.org/r/20230203150400.3199230-19-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-cgroup.c')
-rw-r--r--block/blk-cgroup.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index fc264b155882..45a683e88bca 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -337,7 +337,7 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg, struct gendisk *disk,
/* link parent */
if (blkcg_parent(blkcg)) {
- blkg->parent = blkg_lookup(blkcg_parent(blkcg), disk->queue);
+ blkg->parent = blkg_lookup(blkcg_parent(blkcg), disk);
if (WARN_ON_ONCE(!blkg->parent)) {
ret = -ENODEV;
goto err_put_css;
@@ -409,12 +409,12 @@ static struct blkcg_gq *blkg_lookup_create(struct blkcg *blkcg,
WARN_ON_ONCE(!rcu_read_lock_held());
- blkg = blkg_lookup(blkcg, q);
+ blkg = blkg_lookup(blkcg, disk);
if (blkg)
return blkg;
spin_lock_irqsave(&q->queue_lock, flags);
- blkg = blkg_lookup(blkcg, q);
+ blkg = blkg_lookup(blkcg, disk);
if (blkg) {
if (blkcg != &blkcg_root &&
blkg != rcu_dereference(blkcg->blkg_hint))
@@ -433,7 +433,7 @@ static struct blkcg_gq *blkg_lookup_create(struct blkcg *blkcg,
struct blkcg_gq *ret_blkg = q->root_blkg;
while (parent) {
- blkg = blkg_lookup(parent, q);
+ blkg = blkg_lookup(parent, disk);
if (blkg) {
/* remember closest blkg */
ret_blkg = blkg;
@@ -719,7 +719,7 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
goto fail_unlock;
}
- blkg = blkg_lookup(blkcg, q);
+ blkg = blkg_lookup(blkcg, disk);
if (blkg)
goto success;
@@ -733,7 +733,7 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
struct blkcg_gq *new_blkg;
parent = blkcg_parent(blkcg);
- while (parent && !blkg_lookup(parent, q)) {
+ while (parent && !blkg_lookup(parent, disk)) {
pos = parent;
parent = blkcg_parent(parent);
}
@@ -763,7 +763,7 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
goto fail_preloaded;
}
- blkg = blkg_lookup(pos, q);
+ blkg = blkg_lookup(pos, disk);
if (blkg) {
blkg_free(new_blkg);
} else {
@@ -1838,7 +1838,7 @@ void blkcg_maybe_throttle_current(void)
blkcg = css_to_blkcg(blkcg_css());
if (!blkcg)
goto out;
- blkg = blkg_lookup(blkcg, disk->queue);
+ blkg = blkg_lookup(blkcg, disk);
if (!blkg)
goto out;
if (!blkg_tryget(blkg))