Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309279
b: refs/heads/master
c: 496fb78
h: refs/heads/master
i:
  309277: c23d226
  309275: 31232cd
  309271: 4f4e66c
  309263: 2918dca
  309247: 1666743
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Apr 20, 2012
1 parent f2c7fca commit a2f79ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aaf7c680682f1999ef2e574f743c45d1674a8b8a
refs/heads/master: 496fb7806d616185a46865a4f3a20ef19dc6c7e3
19 changes: 9 additions & 10 deletions trunk/block/blk-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ static struct blkcg_gq *__blkg_lookup_create(struct blkcg *blkcg,
__releases(q->queue_lock) __acquires(q->queue_lock)
{
struct blkcg_gq *blkg;
int ret;

WARN_ON_ONCE(!rcu_read_lock_held());
lockdep_assert_held(q->queue_lock);
Expand All @@ -186,24 +187,22 @@ static struct blkcg_gq *__blkg_lookup_create(struct blkcg *blkcg,
if (!css_tryget(&blkcg->css))
return ERR_PTR(-EINVAL);

/*
* Allocate and initialize.
*/
/* allocate */
ret = -ENOMEM;
blkg = blkg_alloc(blkcg, q);

/* did alloc fail? */
if (unlikely(!blkg)) {
blkg = ERR_PTR(-ENOMEM);
goto out;
}
if (unlikely(!blkg))
goto err_put;

/* insert */
spin_lock(&blkcg->lock);
hlist_add_head_rcu(&blkg->blkcg_node, &blkcg->blkg_list);
list_add(&blkg->q_node, &q->blkg_list);
spin_unlock(&blkcg->lock);
out:
return blkg;

err_put:
css_put(&blkcg->css);
return ERR_PTR(ret);
}

struct blkcg_gq *blkg_lookup_create(struct blkcg *blkcg,
Expand Down

0 comments on commit a2f79ef

Please sign in to comment.