unsigned int ppp_waitqlen; /* wait queue length */
unsigned long ppp_pages_short; /* # of pages wanted of in-q users */
unsigned int ppp_growing:1; /* during adding pages */
- unsigned int ppp_index; /* pool array index, used to determine
- * pool element size */
+ unsigned int ppp_order; /* page pool order and index in pools
+ * array (element size is 2^order pages),
+ */
/*
* indicating how idle the pools are, from 0 to MAX_IDLE_IDX
static int element_size(struct ptlrpc_page_pool *pool)
{
- return 1 << pool->ppp_index;
+ return 1 << pool->ppp_order;
}
/*
LASSERT(pool->ppp_pools[p_idx]);
LASSERT(pool->ppp_pools[p_idx][g_idx] != NULL);
- if (pool->ppp_index == PAGES_POOL)
+ if (pool->ppp_order == PAGES_POOL)
__free_page(pool->ppp_pools[p_idx][g_idx]);
else
OBD_FREE_LARGE(pool->ppp_pools[p_idx][g_idx],
if (pools[i]) {
for (j = 0; j < PAGES_PER_POOL; j++) {
if (pools[i][j]) {
- if (pool->ppp_index == PAGES_POOL) {
+ if (pool->ppp_order == PAGES_POOL) {
__free_page(pools[i][j]);
} else {
OBD_FREE_LARGE(pools[i][j],
void ***pools;
int npools, alloced = 0;
int i, j, rc = -ENOMEM;
- unsigned int pool_order = page_pool->ppp_index;
+ unsigned int pool_order = page_pool->ppp_order;
if (npages < POOL_INIT_SIZE / element_size(page_pool))
npages = POOL_INIT_SIZE / element_size(page_pool);
/* the pool of single pages is grown a large amount on
* first use
*/
- if (pool->ppp_index == PAGES_POOL &&
+ if (pool->ppp_order == PAGES_POOL &&
pool->ppp_total_pages == 0)
to_add = PTLRPC_MAX_BRW_PAGES * 2;
else /* otherwise, we add requested or at least 8 items */
CDEBUG(D_SEC,
"pool %d is %lu elements (size %d bytes), growing by %d items\n",
- pool->ppp_index, pool->ppp_pages_short,
+ pool->ppp_order, pool->ppp_pages_short,
element_size(pool), to_add);
/* we can't hold a spinlock over page allocation */
rc = pool_add_pages(to_add, pool);
pool->ppp_st_max_wait = ktime_set(0, 0);
pool_alloc(pool);
- pool->ppp_index = pool_order;
+ pool->ppp_order = pool_order;
CDEBUG(D_SEC, "Allocated pool %i\n", pool_order);
if (pool->ppp_pools == NULL)
GOTO(fail, rc = -ENOMEM);