Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[firefly-linux-kernel-4.4.55.git] / kernel / cgroup.c
index 7b4705b51d4a13839476113ff3e6e7b0ce6b8ddd..51cddc11cd85c847ec0fee3cd9a00fae3b66b4b0 100644 (file)
@@ -876,7 +876,6 @@ static void cgroup_clear_directory(struct dentry *dentry)
        struct list_head *node;
 
        BUG_ON(!mutex_is_locked(&dentry->d_inode->i_mutex));
-       spin_lock(&dcache_lock);
        spin_lock(&dentry->d_lock);
        node = dentry->d_subdirs.next;
        while (node != &dentry->d_subdirs) {
@@ -888,21 +887,18 @@ static void cgroup_clear_directory(struct dentry *dentry)
                        /* This should never be called on a cgroup
                         * directory with child cgroups */
                        BUG_ON(d->d_inode->i_mode & S_IFDIR);
-                       dget_locked_dlock(d);
+                       dget_dlock(d);
                        spin_unlock(&d->d_lock);
                        spin_unlock(&dentry->d_lock);
-                       spin_unlock(&dcache_lock);
                        d_delete(d);
                        simple_unlink(dentry->d_inode, d);
                        dput(d);
-                       spin_lock(&dcache_lock);
                        spin_lock(&dentry->d_lock);
                } else
                        spin_unlock(&d->d_lock);
                node = dentry->d_subdirs.next;
        }
        spin_unlock(&dentry->d_lock);
-       spin_unlock(&dcache_lock);
 }
 
 /*
@@ -914,14 +910,12 @@ static void cgroup_d_remove_dir(struct dentry *dentry)
 
        cgroup_clear_directory(dentry);
 
-       spin_lock(&dcache_lock);
        parent = dentry->d_parent;
        spin_lock(&parent->d_lock);
        spin_lock(&dentry->d_lock);
        list_del_init(&dentry->d_u.d_child);
        spin_unlock(&dentry->d_lock);
        spin_unlock(&parent->d_lock);
-       spin_unlock(&dcache_lock);
        remove_dir(dentry);
 }
 
@@ -2228,7 +2222,7 @@ static struct dentry *cgroup_lookup(struct inode *dir,
 
        if (dentry->d_name.len > NAME_MAX)
                return ERR_PTR(-ENAMETOOLONG);
-       dentry->d_op = &cgroup_dentry_operations;
+       d_set_d_op(dentry, &cgroup_dentry_operations);
        d_add(dentry, NULL);
        return NULL;
 }