aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-04-01 15:09:54 -0400
committerTejun Heo <tj@kernel.org>2012-04-01 15:09:54 -0400
commitff4c8d503e2583b485da46d0ec3dcc29639ab889 (patch)
treef4f03ab7e743f96e9b8e7c178b61554e3d591d52 /kernel
parent8b5a5a9dbca914d1f7d70276024d1525a3c94081 (diff)
cgroup: move cgroup_clear_directory() call out of cgroup_populate_dir()
cgroup_populate_dir() currently clears all files and then repopulate the directory; however, the clearing part is only useful when it's called from cgroup_remount(). Relocate the invocation to cgroup_remount(). This is to prepare for further cgroup file handling updates. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizf@cn.fujitsu.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 741c120e06c1..8f72853131d3 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1313,7 +1313,8 @@ static int cgroup_remount(struct super_block *sb, int *flags, char *data)
1313 goto out_unlock; 1313 goto out_unlock;
1314 } 1314 }
1315 1315
1316 /* (re)populate subsystem files */ 1316 /* clear out any existing files and repopulate subsystem files */
1317 cgroup_clear_directory(cgrp->dentry);
1317 cgroup_populate_dir(cgrp); 1318 cgroup_populate_dir(cgrp);
1318 1319
1319 if (opts.release_agent) 1320 if (opts.release_agent)
@@ -3644,9 +3645,6 @@ static int cgroup_populate_dir(struct cgroup *cgrp)
3644 int err; 3645 int err;
3645 struct cgroup_subsys *ss; 3646 struct cgroup_subsys *ss;
3646 3647
3647 /* First clear out any existing files */
3648 cgroup_clear_directory(cgrp->dentry);
3649
3650 err = cgroup_add_files(cgrp, NULL, files, ARRAY_SIZE(files)); 3648 err = cgroup_add_files(cgrp, NULL, files, ARRAY_SIZE(files));
3651 if (err < 0) 3649 if (err < 0)
3652 return err; 3650 return err;