Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304556
b: refs/heads/master
c: 2e3b615
h: refs/heads/master
v: v3
  • Loading branch information
Minchan Kim authored and Greg Kroah-Hartman committed May 9, 2012
1 parent 20381d6 commit 76559d6
Show file tree
Hide file tree
Showing 3 changed files with 9 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: 71a30f68c608084fd53a3de5fe5614e24fe6729e
refs/heads/master: 2e3b61547191a5934ff6c789aaa4d7e9a9e52f5a
14 changes: 7 additions & 7 deletions trunk/drivers/staging/zsmalloc/zsmalloc-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static enum fullness_group fix_fullness_group(struct zs_pool *pool,
* link together 3 PAGE_SIZE sized pages to form a zspage
* since then we can perfectly fit in 8 such objects.
*/
static int get_zspage_order(int class_size)
static int get_pages_per_zspage(int class_size)
{
int i, max_usedpc = 0;
/* zspage order which gives maximum used size per KB */
Expand Down Expand Up @@ -368,7 +368,7 @@ static struct page *alloc_zspage(struct size_class *class, gfp_t flags)
* identify the last page.
*/
error = -ENOMEM;
for (i = 0; i < class->zspage_order; i++) {
for (i = 0; i < class->pages_per_zspage; i++) {
struct page *page, *prev_page;

page = alloc_page(flags);
Expand All @@ -388,7 +388,7 @@ static struct page *alloc_zspage(struct size_class *class, gfp_t flags)
page->first_page = first_page;
if (i >= 2)
list_add(&page->lru, &prev_page->lru);
if (i == class->zspage_order - 1) /* last page */
if (i == class->pages_per_zspage - 1) /* last page */
SetPagePrivate2(page);
prev_page = page;
}
Expand All @@ -397,7 +397,7 @@ static struct page *alloc_zspage(struct size_class *class, gfp_t flags)

first_page->freelist = obj_location_to_handle(first_page, 0);
/* Maximum number of objects we can store in this zspage */
first_page->objects = class->zspage_order * PAGE_SIZE / class->size;
first_page->objects = class->pages_per_zspage * PAGE_SIZE / class->size;

error = 0; /* Success */

Expand Down Expand Up @@ -512,7 +512,7 @@ struct zs_pool *zs_create_pool(const char *name, gfp_t flags)
class->size = size;
class->index = i;
spin_lock_init(&class->lock);
class->zspage_order = get_zspage_order(size);
class->pages_per_zspage = get_pages_per_zspage(size);

}

Expand Down Expand Up @@ -603,7 +603,7 @@ void *zs_malloc(struct zs_pool *pool, size_t size)

set_zspage_mapping(first_page, class->index, ZS_EMPTY);
spin_lock(&class->lock);
class->pages_allocated += class->zspage_order;
class->pages_allocated += class->pages_per_zspage;
}

obj = first_page->freelist;
Expand Down Expand Up @@ -658,7 +658,7 @@ void zs_free(struct zs_pool *pool, void *obj)
fullness = fix_fullness_group(pool, first_page);

if (fullness == ZS_EMPTY)
class->pages_allocated -= class->zspage_order;
class->pages_allocated -= class->pages_per_zspage;

spin_unlock(&class->lock);

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/zsmalloc/zsmalloc_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ struct size_class {
unsigned int index;

/* Number of PAGE_SIZE sized pages to combine to form a 'zspage' */
int zspage_order;
int pages_per_zspage;

spinlock_t lock;

Expand Down

0 comments on commit 76559d6

Please sign in to comment.