Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54244
b: refs/heads/master
c: 4ab688c
h: refs/heads/master
v: v3
  • Loading branch information
Akinobu Mita authored and Linus Torvalds committed May 7, 2007
1 parent a10ed6b commit fab93dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 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: 5bc98594d59672303c4c9c07262ecc373dc374da
refs/heads/master: 4ab688c51226188f2d4ad4f789032c107944ef89
15 changes: 3 additions & 12 deletions trunk/mm/slob.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,6 @@ static void slob_free(void *block, int size)
spin_unlock_irqrestore(&slob_lock, flags);
}

static int FASTCALL(find_order(int size));
static int fastcall find_order(int size)
{
int order = 0;
for ( ; size > 4096 ; size >>=1)
order++;
return order;
}

void *__kmalloc(size_t size, gfp_t gfp)
{
slob_t *m;
Expand All @@ -174,7 +165,7 @@ void *__kmalloc(size_t size, gfp_t gfp)
if (!bb)
return 0;

bb->order = find_order(size);
bb->order = get_order(size);
bb->pages = (void *)__get_free_pages(gfp, bb->order);

if (bb->pages) {
Expand Down Expand Up @@ -318,7 +309,7 @@ void *kmem_cache_alloc(struct kmem_cache *c, gfp_t flags)
if (c->size < PAGE_SIZE)
b = slob_alloc(c->size, flags, c->align);
else
b = (void *)__get_free_pages(flags, find_order(c->size));
b = (void *)__get_free_pages(flags, get_order(c->size));

if (c->ctor)
c->ctor(b, c, SLAB_CTOR_CONSTRUCTOR);
Expand All @@ -345,7 +336,7 @@ void kmem_cache_free(struct kmem_cache *c, void *b)
if (c->size < PAGE_SIZE)
slob_free(b, c->size);
else
free_pages((unsigned long)b, find_order(c->size));
free_pages((unsigned long)b, get_order(c->size));
}
EXPORT_SYMBOL(kmem_cache_free);

Expand Down

0 comments on commit fab93dd

Please sign in to comment.