Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71456
b: refs/heads/master
c: c9c5d92
h: refs/heads/master
v: v3
  • Loading branch information
Sukadev Bhattiprolu authored and Linus Torvalds committed Oct 19, 2007
1 parent 33084fd commit 30a06d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 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: 6f4e643353aea52d80f33960bd88954a7c074f0f
refs/heads/master: c9c5d92211883e9ae22394d1f157ab0d3a7ec895
9 changes: 6 additions & 3 deletions trunk/kernel/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
static struct hlist_head *pid_hash;
static int pidhash_shift;
struct pid init_struct_pid = INIT_STRUCT_PID;
static struct kmem_cache *pid_ns_cachep;

int pid_max = PID_MAX_DEFAULT;

Expand Down Expand Up @@ -486,7 +487,7 @@ static struct pid_namespace *create_pid_namespace(int level)
struct pid_namespace *ns;
int i;

ns = kmalloc(sizeof(struct pid_namespace), GFP_KERNEL);
ns = kmem_cache_alloc(pid_ns_cachep, GFP_KERNEL);
if (ns == NULL)
goto out;

Expand Down Expand Up @@ -516,7 +517,7 @@ static struct pid_namespace *create_pid_namespace(int level)
out_free_map:
kfree(ns->pidmap[0].page);
out_free:
kfree(ns);
kmem_cache_free(pid_ns_cachep, ns);
out:
return ERR_PTR(-ENOMEM);
}
Expand All @@ -527,7 +528,7 @@ static void destroy_pid_namespace(struct pid_namespace *ns)

for (i = 0; i < PIDMAP_ENTRIES; i++)
kfree(ns->pidmap[i].page);
kfree(ns);
kmem_cache_free(pid_ns_cachep, ns);
}

struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *old_ns)
Expand Down Expand Up @@ -601,4 +602,6 @@ void __init pidmap_init(void)
init_pid_ns.pid_cachep = create_pid_cachep(1);
if (init_pid_ns.pid_cachep == NULL)
panic("Can't create pid_1 cachep\n");

pid_ns_cachep = KMEM_CACHE(pid_namespace, SLAB_PANIC);
}

0 comments on commit 30a06d0

Please sign in to comment.