]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - block/blk-cgroup.c
Merge tag 'iommu-fixes-v3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mirror_ubuntu-artful-kernel.git] / block / blk-cgroup.c
index 1039fb9ff5f5f998628884dedab422c9b405a36c..b9f4cc494ecefbf2560483bdc4685bb98d59b5d3 100644 (file)
@@ -80,7 +80,7 @@ static struct blkcg_gq *blkg_alloc(struct blkcg *blkcg, struct request_queue *q,
        blkg->q = q;
        INIT_LIST_HEAD(&blkg->q_node);
        blkg->blkcg = blkcg;
-       blkg->refcnt = 1;
+       atomic_set(&blkg->refcnt, 1);
 
        /* root blkg uses @q->root_rl, init rl only for !root blkgs */
        if (blkcg != &blkcg_root) {
@@ -185,7 +185,7 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
        lockdep_assert_held(q->queue_lock);
 
        /* blkg holds a reference to blkcg */
-       if (!css_tryget(&blkcg->css)) {
+       if (!css_tryget_online(&blkcg->css)) {
                ret = -EINVAL;
                goto err_free_blkg;
        }
@@ -399,11 +399,8 @@ void __blkg_release_rcu(struct rcu_head *rcu_head)
 
        /* release the blkcg and parent blkg refs this blkg has been holding */
        css_put(&blkg->blkcg->css);
-       if (blkg->parent) {
-               spin_lock_irq(blkg->q->queue_lock);
+       if (blkg->parent)
                blkg_put(blkg->parent);
-               spin_unlock_irq(blkg->q->queue_lock);
-       }
 
        blkg_free(blkg);
 }