提交 93e6d5d8 编写于 作者: T Tejun Heo

blkcg: cosmetic updates to blkg_create()

* Rename out_* labels to err_*.

* Do ERR_PTR() conversion once in the error return path.

This patch is cosmetic and to prepare for the hierarchy support.
Signed-off-by: NTejun Heo <tj@kernel.org>
Acked-by: NVivek Goyal <vgoyal@redhat.com>
上级 86cde6b6
...@@ -187,16 +187,16 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg, ...@@ -187,16 +187,16 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
/* blkg holds a reference to blkcg */ /* blkg holds a reference to blkcg */
if (!css_tryget(&blkcg->css)) { if (!css_tryget(&blkcg->css)) {
blkg = ERR_PTR(-EINVAL); ret = -EINVAL;
goto out_free; goto err_free_blkg;
} }
/* allocate */ /* allocate */
if (!new_blkg) { if (!new_blkg) {
new_blkg = blkg_alloc(blkcg, q, GFP_ATOMIC); new_blkg = blkg_alloc(blkcg, q, GFP_ATOMIC);
if (unlikely(!new_blkg)) { if (unlikely(!new_blkg)) {
blkg = ERR_PTR(-ENOMEM); ret = -ENOMEM;
goto out_put; goto err_put_css;
} }
} }
blkg = new_blkg; blkg = new_blkg;
...@@ -213,12 +213,11 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg, ...@@ -213,12 +213,11 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
if (!ret) if (!ret)
return blkg; return blkg;
blkg = ERR_PTR(ret); err_put_css:
out_put:
css_put(&blkcg->css); css_put(&blkcg->css);
out_free: err_free_blkg:
blkg_free(new_blkg); blkg_free(new_blkg);
return blkg; return ERR_PTR(ret);
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册