Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107000
b: refs/heads/master
c: 3655343
h: refs/heads/master
v: v3
  • Loading branch information
Li Zefan authored and Linus Torvalds committed Jul 30, 2008
1 parent 6153336 commit 30406d9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 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: 5a3eb9f6b7c598529f832b8baa6458ab1cbab2c6
refs/heads/master: 36553434f475a84b653e25e74490ee8df43b86d5
30 changes: 12 additions & 18 deletions trunk/kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,17 @@ static struct css_set *find_existing_css_set(
return NULL;
}

static void free_cg_links(struct list_head *tmp)
{
struct cg_cgroup_link *link;
struct cg_cgroup_link *saved_link;

list_for_each_entry_safe(link, saved_link, tmp, cgrp_link_list) {
list_del(&link->cgrp_link_list);
kfree(link);
}
}

/*
* allocate_cg_links() allocates "count" cg_cgroup_link structures
* and chains them on tmp through their cgrp_link_list fields. Returns 0 on
Expand All @@ -363,35 +374,19 @@ static struct css_set *find_existing_css_set(
static int allocate_cg_links(int count, struct list_head *tmp)
{
struct cg_cgroup_link *link;
struct cg_cgroup_link *saved_link;
int i;
INIT_LIST_HEAD(tmp);
for (i = 0; i < count; i++) {
link = kmalloc(sizeof(*link), GFP_KERNEL);
if (!link) {
list_for_each_entry_safe(link, saved_link, tmp,
cgrp_link_list) {
list_del(&link->cgrp_link_list);
kfree(link);
}
free_cg_links(tmp);
return -ENOMEM;
}
list_add(&link->cgrp_link_list, tmp);
}
return 0;
}

static void free_cg_links(struct list_head *tmp)
{
struct cg_cgroup_link *link;
struct cg_cgroup_link *saved_link;

list_for_each_entry_safe(link, saved_link, tmp, cgrp_link_list) {
list_del(&link->cgrp_link_list);
kfree(link);
}
}

/*
* find_css_set() takes an existing cgroup group and a
* cgroup object, and returns a css_set object that's
Expand Down Expand Up @@ -956,7 +951,6 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
struct super_block *sb;
struct cgroupfs_root *root;
struct list_head tmp_cg_links;
INIT_LIST_HEAD(&tmp_cg_links);

/* First find the desired set of subsystems */
ret = parse_cgroupfs_options(data, &opts);
Expand Down

0 comments on commit 30406d9

Please sign in to comment.