Skip to content

Commit

Permalink
slab: rename slab_bufctl to slab_freelist
Browse files Browse the repository at this point in the history
Now, bufctl is not proper name to this array.
So change it.

Acked-by: Andi Kleen <[email protected]>
Signed-off-by: Joonsoo Kim <[email protected]>
Signed-off-by: Pekka Enberg <[email protected]>
  • Loading branch information
JoonsooKim authored and penberg committed Oct 24, 2013
1 parent 7ecccf9 commit e7444d9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -2550,7 +2550,7 @@ static struct freelist *alloc_slabmgmt(struct kmem_cache *cachep,
return freelist;
}

static inline unsigned int *slab_bufctl(struct page *page)
static inline unsigned int *slab_freelist(struct page *page)
{
return (unsigned int *)(page->freelist);
}
Expand Down Expand Up @@ -2597,7 +2597,7 @@ static void cache_init_objs(struct kmem_cache *cachep,
if (cachep->ctor)
cachep->ctor(objp);
#endif
slab_bufctl(page)[i] = i;
slab_freelist(page)[i] = i;
}
}

Expand All @@ -2616,7 +2616,7 @@ static void *slab_get_obj(struct kmem_cache *cachep, struct page *page,
{
void *objp;

objp = index_to_obj(cachep, page, slab_bufctl(page)[page->active]);
objp = index_to_obj(cachep, page, slab_freelist(page)[page->active]);
page->active++;
#if DEBUG
WARN_ON(page_to_nid(virt_to_page(objp)) != nodeid);
Expand All @@ -2637,15 +2637,15 @@ static void slab_put_obj(struct kmem_cache *cachep, struct page *page,

/* Verify double free bug */
for (i = page->active; i < cachep->num; i++) {
if (slab_bufctl(page)[i] == objnr) {
if (slab_freelist(page)[i] == objnr) {
printk(KERN_ERR "slab: double free detected in cache "
"'%s', objp %p\n", cachep->name, objp);
BUG();
}
}
#endif
page->active--;
slab_bufctl(page)[page->active] = objnr;
slab_freelist(page)[page->active] = objnr;
}

/*
Expand Down Expand Up @@ -4218,7 +4218,7 @@ static void handle_slab(unsigned long *n, struct kmem_cache *c,

for (j = page->active; j < c->num; j++) {
/* Skip freed item */
if (slab_bufctl(page)[j] == i) {
if (slab_freelist(page)[j] == i) {
active = false;
break;
}
Expand Down

0 comments on commit e7444d9

Please sign in to comment.