History

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.

Tejun Heo committed 14 years ago

Commit ff4c8d51 parent 8b5a5a91 file · +2 −4Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/cgroup.c+2−4
@@ -1313,7 +1313,8 @@ static int cgroup_remount(struct super_block *sb, int *flags, char *data) · 1312 unmodified lines
13131313 goto out_unlock;
13141314 }
13151315
1316− /* (re)populate subsystem files */
1316+ /* clear out any existing files and repopulate subsystem files */
1317+ cgroup_clear_directory(cgrp->dentry);
13171318 cgroup_populate_dir(cgrp);
13181319
13191320 if (opts.release_agent)
@@ -3644,9 +3645,6 @@ static int cgroup_populate_dir(struct cgroup *cgrp) · 2324 unmodified lines
36443645 int err;
36453646 struct cgroup_subsys *ss;
36463647
3647− /* First clear out any existing files */
3648− cgroup_clear_directory(cgrp->dentry);
3649−
36503648 err = cgroup_add_files(cgrp, NULL, files, ARRAY_SIZE(files));
36513649 if (err < 0)
36523650 return err;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t