Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 129694
b: refs/heads/master
c: 5b019e9
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Jan 16, 2009
1 parent 2b58408 commit 80500c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 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: 5da7f3d71e243ef5c464967581414d29c72bab75
refs/heads/master: 5b019e99016f3a692ba45bf68fba73a402d7c01a
10 changes: 2 additions & 8 deletions trunk/lib/idr.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int idr_pre_get(struct idr *idp, gfp_t gfp_mask)
{
while (idp->id_free_cnt < IDR_FREE_MAX) {
struct idr_layer *new;
new = kmem_cache_alloc(idr_layer_cache, gfp_mask);
new = kmem_cache_zalloc(idr_layer_cache, gfp_mask);
if (new == NULL)
return (0);
move_to_free_list(idp, new);
Expand Down Expand Up @@ -623,16 +623,10 @@ void *idr_replace(struct idr *idp, void *ptr, int id)
}
EXPORT_SYMBOL(idr_replace);

static void idr_cache_ctor(void *idr_layer)
{
memset(idr_layer, 0, sizeof(struct idr_layer));
}

void __init idr_init_cache(void)
{
idr_layer_cache = kmem_cache_create("idr_layer_cache",
sizeof(struct idr_layer), 0, SLAB_PANIC,
idr_cache_ctor);
sizeof(struct idr_layer), 0, SLAB_PANIC, NULL);
}

/**
Expand Down

0 comments on commit 80500c9

Please sign in to comment.