summaryrefslogtreecommitdiff
path: root/kernel/cgroup/cgroup-v1.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2019-01-17 10:44:07 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2019-02-28 11:29:33 +0300
commit71d883c37e8d4484207708af56685abb39703b04 (patch)
tree6832158277340fa8de0508aad96495930eb26bc8 /kernel/cgroup/cgroup-v1.c
parentcf6299b1d00555cd10dc30d95b300d7084128a2c (diff)
downloadlinux-71d883c37e8d4484207708af56685abb39703b04.tar.xz
cgroup_do_mount(): massage calling conventions
pass it fs_context instead of fs_type/flags/root triple, have it return int instead of dentry and make it deal with setting fc->root. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel/cgroup/cgroup-v1.c')
-rw-r--r--kernel/cgroup/cgroup-v1.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c
index 45a198c63d6e..05f05d773adf 100644
--- a/kernel/cgroup/cgroup-v1.c
+++ b/kernel/cgroup/cgroup-v1.c
@@ -1141,7 +1141,6 @@ int cgroup1_get_tree(struct fs_context *fc)
struct cgroup_fs_context *ctx = cgroup_fc2context(fc);
struct cgroup_root *root;
struct cgroup_subsys *ss;
- struct dentry *dentry;
int i, ret;
/* Check if the caller has permission to mount. */
@@ -1253,21 +1252,15 @@ out_free:
if (ret)
return ret;
- dentry = cgroup_do_mount(&cgroup_fs_type, fc->sb_flags, root,
- CGROUP_SUPER_MAGIC, ns);
- if (IS_ERR(dentry))
- return PTR_ERR(dentry);
-
- if (percpu_ref_is_dying(&root->cgrp.self.refcnt)) {
- struct super_block *sb = dentry->d_sb;
- dput(dentry);
+ ret = cgroup_do_mount(fc, CGROUP_SUPER_MAGIC, ns);
+ if (!ret && percpu_ref_is_dying(&root->cgrp.self.refcnt)) {
+ struct super_block *sb = fc->root->d_sb;
+ dput(fc->root);
deactivate_locked_super(sb);
msleep(10);
return restart_syscall();
}
-
- fc->root = dentry;
- return 0;
+ return ret;
}
static int __init cgroup1_wq_init(void)