diff mbox series

[03/17] blk-cgroup: remove open coded blkg_lookup instances

Message ID 20220921180501.1539876-4-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [01/17] blk-cgroup: fix error unwinding in blkcg_init_queue | expand

Commit Message

Christoph Hellwig Sept. 21, 2022, 6:04 p.m. UTC
Use blkg_lookup instead of open coding it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-cgroup.c | 6 +++---
 block/blk-cgroup.h | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

Comments

Andreas Herrmann Sept. 22, 2022, 1:17 p.m. UTC | #1
On Wed, Sep 21, 2022 at 08:04:47PM +0200, Christoph Hellwig wrote:
> Use blkg_lookup instead of open coding it.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  block/blk-cgroup.c | 6 +++---
>  block/blk-cgroup.h | 8 ++++----
>  2 files changed, 7 insertions(+), 7 deletions(-)

Reviewed-by: Andreas Herrmann <aherrmann@suse.de>

> diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
> index 4180de4cbb3e1..b9a1dcee5a244 100644
> --- a/block/blk-cgroup.c
> +++ b/block/blk-cgroup.c
> @@ -324,7 +324,7 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
>  
>  	/* link parent */
>  	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)) {
>  			ret = -ENODEV;
>  			goto err_put_css;
> @@ -412,7 +412,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, false);
> +			blkg = blkg_lookup(parent, q);
>  			if (blkg) {
>  				/* remember closest blkg */
>  				ret_blkg = blkg;
> @@ -724,7 +724,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, false)) {
> +		while (parent && !blkg_lookup(parent, q)) {
>  			pos = parent;
>  			parent = blkcg_parent(parent);
>  		}
> diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
> index c1fb00a1dfc03..30396cad50e9a 100644
> --- a/block/blk-cgroup.h
> +++ b/block/blk-cgroup.h
> @@ -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)		\
>  	css_for_each_descendant_pre((pos_css), &(p_blkg)->blkcg->css)	\
> -		if (((d_blkg) = __blkg_lookup(css_to_blkcg(pos_css),	\
> -					      (p_blkg)->q, false)))
> +		if (((d_blkg) = blkg_lookup(css_to_blkcg(pos_css),	\
> +					    (p_blkg)->q)))
>  
>  /**
>   * 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)
>   */
>  #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)->q, false)))
> +		if (((d_blkg) = blkg_lookup(css_to_blkcg(pos_css),	\
> +					    (p_blkg)->q)))
>  
>  bool __blkcg_punt_bio_submit(struct bio *bio);
>  
> -- 
> 2.30.2
>
Tejun Heo Sept. 26, 2022, 8:56 p.m. UTC | #2
On Wed, Sep 21, 2022 at 08:04:47PM +0200, Christoph Hellwig wrote:
> Use blkg_lookup instead of open coding it.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

For patches 1-3:

 Acked-by: Tejun Heo <tj@kernel.org>

Thanks.
diff mbox series

Patch

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 4180de4cbb3e1..b9a1dcee5a244 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -324,7 +324,7 @@  static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
 
 	/* link parent */
 	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)) {
 			ret = -ENODEV;
 			goto err_put_css;
@@ -412,7 +412,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, false);
+			blkg = blkg_lookup(parent, q);
 			if (blkg) {
 				/* remember closest blkg */
 				ret_blkg = blkg;
@@ -724,7 +724,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, false)) {
+		while (parent && !blkg_lookup(parent, q)) {
 			pos = parent;
 			parent = blkcg_parent(parent);
 		}
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
index c1fb00a1dfc03..30396cad50e9a 100644
--- a/block/blk-cgroup.h
+++ b/block/blk-cgroup.h
@@ -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)		\
 	css_for_each_descendant_pre((pos_css), &(p_blkg)->blkcg->css)	\
-		if (((d_blkg) = __blkg_lookup(css_to_blkcg(pos_css),	\
-					      (p_blkg)->q, false)))
+		if (((d_blkg) = blkg_lookup(css_to_blkcg(pos_css),	\
+					    (p_blkg)->q)))
 
 /**
  * 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)
  */
 #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)->q, false)))
+		if (((d_blkg) = blkg_lookup(css_to_blkcg(pos_css),	\
+					    (p_blkg)->q)))
 
 bool __blkcg_punt_bio_submit(struct bio *bio);