struct ptlrpc_cli_ctx *ctx);
/* bulk security api */
-#define PAGES_POOL 0
void sptlrpc_pool_add_user(void);
void sptlrpc_pool_del_user(void);
int sptlrpc_pool_get_desc_pages(struct ptlrpc_bulk_desc *desc);
void sptlrpc_pool_put_desc_pages(struct ptlrpc_bulk_desc *desc);
void sptlrpc_pool_put_pages_array(struct page **pa, unsigned int count);
void sptlrpc_pool_put_pages(void *buf, unsigned int order);
-int sptlrpc_pool_get_free_pages(unsigned int pool);
-int pool_is_at_full_capacity(void);
+int sptlrpc_pool_get_free_pages(unsigned int order);
+int pool_is_at_full_capacity(int order);
int sptlrpc_cli_wrap_bulk(struct ptlrpc_request *req,
struct ptlrpc_bulk_desc *desc);
*/
int encrypt_page_pools_seq_show(struct seq_file *m, void *v)
{
- struct ptlrpc_page_pool *pool = page_pools[PAGES_POOL];
+ struct ptlrpc_page_pool *pool = page_pools[0];
spin_lock(&pool->ppp_lock);
seq_printf(m, "physical pages: %lu\n"
LASSERT(pool->ppp_pools[p_idx]);
LASSERT(pool->ppp_pools[p_idx][g_idx] != NULL);
- if (pool->ppp_order == PAGES_POOL)
+ if (pool->ppp_order == 0)
__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_order == PAGES_POOL) {
+ if (pool->ppp_order == 0) {
__free_page(pools[i][j]);
} else {
OBD_FREE_LARGE(pools[i][j],
goto out_pools;
for (j = 0; j < PAGES_PER_POOL && alloced < npages; j++) {
- if (pool_order == PAGES_POOL)
+ if (pool_order == 0)
pools[i][j] = alloc_page(GFP_NOFS |
__GFP_HIGHMEM);
else {
}
/*
- * Export the number of free pages in the pool
+ * Export the number of free pages in the pool of 'order'
*/
-int sptlrpc_pool_get_free_pages(unsigned int pool)
+int sptlrpc_pool_get_free_pages(unsigned int order)
{
- return page_pools[pool]->ppp_free_pages;
+ return page_pools[order]->ppp_free_pages;
}
EXPORT_SYMBOL(sptlrpc_pool_get_free_pages);
/*
* Let outside world know if pool full capacity is reached
*/
-int __pool_is_at_full_capacity(unsigned int pool)
+int pool_is_at_full_capacity(int order)
{
- return (page_pools[pool]->ppp_total_pages ==
- page_pools[pool]->ppp_max_pages);
-}
-
-/*
- * Let outside world know if pool full capacity is reached
- */
-int pool_is_at_full_capacity(void)
-{
- return __pool_is_at_full_capacity(PAGES_POOL);
+ return (page_pools[order]->ppp_total_pages ==
+ page_pools[order]->ppp_max_pages);
}
EXPORT_SYMBOL(pool_is_at_full_capacity);
int rc;
LASSERT(desc->bd_iov_count > 0);
- LASSERT(desc->bd_iov_count <= page_pools[PAGES_POOL]->ppp_max_pages);
+ LASSERT(desc->bd_iov_count <= page_pools[0]->ppp_max_pages);
/* resent bulk, enc iov might have been allocated previously */
if (desc->bd_enc_vec != NULL)
/* the pool of single pages is grown a large amount on
* first use
*/
- if (pool->ppp_order == PAGES_POOL &&
+ if (pool->ppp_order == 0 &&
pool->ppp_total_pages == 0)
to_add = PTLRPC_MAX_BRW_PAGES * 2;
else /* otherwise, we add requested or at least 8 items */
*/
void sptlrpc_pool_add_user(void)
{
- struct ptlrpc_page_pool *pool = page_pools[PAGES_POOL];
+ struct ptlrpc_page_pool *pool = page_pools[0];
/* since this is startup, no one is waiting for these pages, so we
* don't worry about sucess or failure here