Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350323
b: refs/heads/master
c: 2739d3c
h: refs/heads/master
i:
  350321: 442f411
  350319: 1f6fdb1
v: v3
  • Loading branch information
Li Zefan authored and Tejun Heo committed Jan 23, 2013
1 parent fb69376 commit f0625b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 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: 130e3695a3edf6bf21464f2826720a79a6afdee0
refs/heads/master: 2739d3cce9816805fe26774fea2527d5b16e924d
21 changes: 12 additions & 9 deletions trunk/kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,13 +921,17 @@ static void remove_dir(struct dentry *d)
dput(parent);
}

static int cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft)
static void cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft)
{
struct cfent *cfe;

lockdep_assert_held(&cgrp->dentry->d_inode->i_mutex);
lockdep_assert_held(&cgroup_mutex);

/*
* If we're doing cleanup due to failure of cgroup_create(),
* the corresponding @cfe may not exist.
*/
list_for_each_entry(cfe, &cgrp->files, node) {
struct dentry *d = cfe->dentry;

Expand All @@ -940,9 +944,8 @@ static int cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft)
list_del_init(&cfe->node);
dput(d);

return 0;
break;
}
return -ENOENT;
}

/**
Expand Down Expand Up @@ -2758,14 +2761,14 @@ static int cgroup_addrm_files(struct cgroup *cgrp, struct cgroup_subsys *subsys,
if ((cft->flags & CFTYPE_ONLY_ON_ROOT) && cgrp->parent)
continue;

if (is_add)
if (is_add) {
err = cgroup_add_file(cgrp, subsys, cft);
else
err = cgroup_rm_file(cgrp, cft);
if (err) {
pr_warning("cgroup_addrm_files: failed to %s %s, err=%d\n",
is_add ? "add" : "remove", cft->name, err);
if (err)
pr_warn("cgroup_addrm_files: failed to add %s, err=%d\n",
cft->name, err);
ret = err;
} else {
cgroup_rm_file(cgrp, cft);
}
}
return ret;
Expand Down

0 comments on commit f0625b8

Please sign in to comment.