Skip to content

Commit

Permalink
cgroup: move cgroup_clear_directory() call out of cgroup_populate_dir()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tejun Heo committed Apr 1, 2012
1 parent 8b5a5a9 commit ff4c8d5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,8 @@ static int cgroup_remount(struct super_block *sb, int *flags, char *data)
goto out_unlock;
}

/* (re)populate subsystem files */
/* clear out any existing files and repopulate subsystem files */
cgroup_clear_directory(cgrp->dentry);
cgroup_populate_dir(cgrp);

if (opts.release_agent)
Expand Down Expand Up @@ -3644,9 +3645,6 @@ static int cgroup_populate_dir(struct cgroup *cgrp)
int err;
struct cgroup_subsys *ss;

/* First clear out any existing files */
cgroup_clear_directory(cgrp->dentry);

err = cgroup_add_files(cgrp, NULL, files, ARRAY_SIZE(files));
if (err < 0)
return err;
Expand Down

0 comments on commit ff4c8d5

Please sign in to comment.