Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 339322
b: refs/heads/master
c: a863803
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed Nov 9, 2012
1 parent 3aaf6f7 commit 024f932
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 316eb661f125397d46f16f94e3c81ad3dc4c1233
refs/heads/master: a8638030f668884720b8f4456448d0ce33952b05
1 change: 1 addition & 0 deletions trunk/include/linux/cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ int cgroup_taskset_size(struct cgroup_taskset *tset);

struct cgroup_subsys {
struct cgroup_subsys_state *(*create)(struct cgroup *cgrp);
void (*post_create)(struct cgroup *cgrp);
void (*pre_destroy)(struct cgroup *cgrp);
void (*destroy)(struct cgroup *cgrp);
int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
Expand Down
15 changes: 13 additions & 2 deletions trunk/kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -4059,10 +4059,15 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
if (err < 0)
goto err_remove;

/* each css holds a ref to the cgroup's dentry */
for_each_subsys(root, ss)
for_each_subsys(root, ss) {
/* each css holds a ref to the cgroup's dentry */
dget(dentry);

/* creation succeeded, notify subsystems */
if (ss->post_create)
ss->post_create(cgrp);
}

/* The cgroup directory was pre-locked for us */
BUG_ON(!mutex_is_locked(&cgrp->dentry->d_inode->i_mutex));

Expand Down Expand Up @@ -4280,6 +4285,9 @@ static void __init cgroup_init_subsys(struct cgroup_subsys *ss)

ss->active = 1;

if (ss->post_create)
ss->post_create(&ss->root->top_cgroup);

/* this function shouldn't be used with modular subsystems, since they
* need to register a subsys_id, among other things */
BUG_ON(ss->module);
Expand Down Expand Up @@ -4389,6 +4397,9 @@ int __init_or_module cgroup_load_subsys(struct cgroup_subsys *ss)

ss->active = 1;

if (ss->post_create)
ss->post_create(&ss->root->top_cgroup);

/* success! */
mutex_unlock(&cgroup_mutex);
return 0;
Expand Down

0 comments on commit 024f932

Please sign in to comment.