Commit 79fcc5be authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

blk-cgroup: remove open coded blkg_lookup instances

Use blkg_lookup instead of open coding it.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarAndreas Herrmann <aherrmann@suse.de>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20220921180501.1539876-4-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 928f6f00
...@@ -324,7 +324,7 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg, ...@@ -324,7 +324,7 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
/* link parent */ /* link parent */
if (blkcg_parent(blkcg)) { if (blkcg_parent(blkcg)) {
blkg->parent = __blkg_lookup(blkcg_parent(blkcg), q, false); blkg->parent = blkg_lookup(blkcg_parent(blkcg), q);
if (WARN_ON_ONCE(!blkg->parent)) { if (WARN_ON_ONCE(!blkg->parent)) {
ret = -ENODEV; ret = -ENODEV;
goto err_put_css; goto err_put_css;
...@@ -412,7 +412,7 @@ static struct blkcg_gq *blkg_lookup_create(struct blkcg *blkcg, ...@@ -412,7 +412,7 @@ static struct blkcg_gq *blkg_lookup_create(struct blkcg *blkcg,
struct blkcg_gq *ret_blkg = q->root_blkg; struct blkcg_gq *ret_blkg = q->root_blkg;
while (parent) { while (parent) {
blkg = __blkg_lookup(parent, q, false); blkg = blkg_lookup(parent, q);
if (blkg) { if (blkg) {
/* remember closest blkg */ /* remember closest blkg */
ret_blkg = blkg; ret_blkg = blkg;
...@@ -724,7 +724,7 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, ...@@ -724,7 +724,7 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
struct blkcg_gq *new_blkg; struct blkcg_gq *new_blkg;
parent = blkcg_parent(blkcg); parent = blkcg_parent(blkcg);
while (parent && !__blkg_lookup(parent, q, false)) { while (parent && !blkg_lookup(parent, q)) {
pos = parent; pos = parent;
parent = blkcg_parent(parent); parent = blkcg_parent(parent);
} }
......
...@@ -362,8 +362,8 @@ static inline void blkg_put(struct blkcg_gq *blkg) ...@@ -362,8 +362,8 @@ static inline void blkg_put(struct blkcg_gq *blkg)
*/ */
#define blkg_for_each_descendant_pre(d_blkg, pos_css, p_blkg) \ #define blkg_for_each_descendant_pre(d_blkg, pos_css, p_blkg) \
css_for_each_descendant_pre((pos_css), &(p_blkg)->blkcg->css) \ css_for_each_descendant_pre((pos_css), &(p_blkg)->blkcg->css) \
if (((d_blkg) = __blkg_lookup(css_to_blkcg(pos_css), \ if (((d_blkg) = blkg_lookup(css_to_blkcg(pos_css), \
(p_blkg)->q, false))) (p_blkg)->q)))
/** /**
* blkg_for_each_descendant_post - post-order walk of a blkg's descendants * blkg_for_each_descendant_post - post-order walk of a blkg's descendants
...@@ -377,8 +377,8 @@ static inline void blkg_put(struct blkcg_gq *blkg) ...@@ -377,8 +377,8 @@ static inline void blkg_put(struct blkcg_gq *blkg)
*/ */
#define blkg_for_each_descendant_post(d_blkg, pos_css, p_blkg) \ #define blkg_for_each_descendant_post(d_blkg, pos_css, p_blkg) \
css_for_each_descendant_post((pos_css), &(p_blkg)->blkcg->css) \ css_for_each_descendant_post((pos_css), &(p_blkg)->blkcg->css) \
if (((d_blkg) = __blkg_lookup(css_to_blkcg(pos_css), \ if (((d_blkg) = blkg_lookup(css_to_blkcg(pos_css), \
(p_blkg)->q, false))) (p_blkg)->q)))
bool __blkcg_punt_bio_submit(struct bio *bio); bool __blkcg_punt_bio_submit(struct bio *bio);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment