summaryrefslogtreecommitdiff
path: root/kernel/cgroup/cgroup-v1.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2016-12-27 22:49:07 +0300
committerTejun Heo <tj@kernel.org>2016-12-27 22:49:07 +0300
commitfa069904dd38c2d8e121a3c7e37f8daaddb6dafa (patch)
tree770d75ea020938331ac3d2150ea1ec3848d7a067 /kernel/cgroup/cgroup-v1.c
parent633feee310de6b6c3191011140b88fe772f560cf (diff)
downloadlinux-fa069904dd38c2d8e121a3c7e37f8daaddb6dafa.tar.xz
cgroup: separate out cgroup1_kf_syscall_ops
Currently, cgroup_kf_syscall_ops is shared by v1 and v2 and the specific methods test the version and take different actions. Split out v1 functions and put them in cgroup1_kf_syscall_ops and remove the now unnecessary explicit branches in specific methods. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Acked-by: Zefan Li <lizefan@huawei.com>
Diffstat (limited to 'kernel/cgroup/cgroup-v1.c')
-rw-r--r--kernel/cgroup/cgroup-v1.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c
index 7af745a46f91..0b2c24f0b310 100644
--- a/kernel/cgroup/cgroup-v1.c
+++ b/kernel/cgroup/cgroup-v1.c
@@ -800,8 +800,8 @@ out_free:
/*
* cgroup_rename - Only allow simple rename of directories in place.
*/
-int cgroup_rename(struct kernfs_node *kn, struct kernfs_node *new_parent,
- const char *new_name_str)
+int cgroup1_rename(struct kernfs_node *kn, struct kernfs_node *new_parent,
+ const char *new_name_str)
{
struct cgroup *cgrp = kn->priv;
int ret;
@@ -812,13 +812,6 @@ int cgroup_rename(struct kernfs_node *kn, struct kernfs_node *new_parent,
return -EIO;
/*
- * This isn't a proper migration and its usefulness is very
- * limited. Disallow on the default hierarchy.
- */
- if (cgroup_on_dfl(cgrp))
- return -EPERM;
-
- /*
* We're gonna grab cgroup_mutex which nests outside kernfs
* active_ref. kernfs_rename() doesn't require active_ref
* protection. Break them before grabbing cgroup_mutex.