aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-01-09 11:05:10 -0500
committerTejun Heo <tj@kernel.org>2013-01-09 11:05:10 -0500
commit93e6d5d8f5c909479623c6ab4427f038c6c3f63f (patch)
treea67f60f0b7582f0e85437455c40e071fb27607dd /block
parent86cde6b62313dd221c2e5935db02de7234cb4164 (diff)
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: Tejun Heo <tj@kernel.org> Acked-by: Vivek Goyal <vgoyal@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-cgroup.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 201275467d8b..18ae48083f4a 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -187,16 +187,16 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
187 187
188 /* blkg holds a reference to blkcg */ 188 /* blkg holds a reference to blkcg */
189 if (!css_tryget(&blkcg->css)) { 189 if (!css_tryget(&blkcg->css)) {
190 blkg = ERR_PTR(-EINVAL); 190 ret = -EINVAL;
191 goto out_free; 191 goto err_free_blkg;
192 } 192 }
193 193
194 /* allocate */ 194 /* allocate */
195 if (!new_blkg) { 195 if (!new_blkg) {
196 new_blkg = blkg_alloc(blkcg, q, GFP_ATOMIC); 196 new_blkg = blkg_alloc(blkcg, q, GFP_ATOMIC);
197 if (unlikely(!new_blkg)) { 197 if (unlikely(!new_blkg)) {
198 blkg = ERR_PTR(-ENOMEM); 198 ret = -ENOMEM;
199 goto out_put; 199 goto err_put_css;
200 } 200 }
201 } 201 }
202 blkg = new_blkg; 202 blkg = new_blkg;
@@ -213,12 +213,11 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
213 if (!ret) 213 if (!ret)
214 return blkg; 214 return blkg;
215 215
216 blkg = ERR_PTR(ret); 216err_put_css:
217out_put:
218 css_put(&blkcg->css); 217 css_put(&blkcg->css);
219out_free: 218err_free_blkg:
220 blkg_free(new_blkg); 219 blkg_free(new_blkg);
221 return blkg; 220 return ERR_PTR(ret);
222} 221}
223 222
224/** 223/**