From: Patrick Farrell Date: Thu, 21 Sep 2023 15:08:21 +0000 (-0400) Subject: EX-8270 ptlrpc: rename ppp_index to ppp_order X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=b2841bc1687d0e1b2cb41a17df63a2a3023ac8fd;p=fs%2Flustre-release.git EX-8270 ptlrpc: rename ppp_index to ppp_order Rename ppp_index to ppp_order. Other renames will be in a subsequent patch, to keep these as simple as possible. Test-Parameters: trivial Signed-off-by: Patrick Farrell Change-Id: I96559e27a67b7cc4e56e06378e5686370438850c Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/52454 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lustre/ptlrpc/sec_bulk.c b/lustre/ptlrpc/sec_bulk.c index 0d29821..ee40a65 100644 --- a/lustre/ptlrpc/sec_bulk.c +++ b/lustre/ptlrpc/sec_bulk.c @@ -88,8 +88,9 @@ static struct ptlrpc_page_pool { 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 @@ -133,7 +134,7 @@ static struct ptlrpc_page_pool { static int element_size(struct ptlrpc_page_pool *pool) { - return 1 << pool->ppp_index; + return 1 << pool->ppp_order; } /* @@ -278,7 +279,7 @@ static void pool_release_free_pages(long npages, struct ptlrpc_page_pool *pool) 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], @@ -403,7 +404,7 @@ static unsigned long pool_cleanup(void ***pools, int npools, 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], @@ -528,7 +529,7 @@ static int pool_add_pages(int npages, struct ptlrpc_page_pool *page_pool) 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); @@ -944,7 +945,7 @@ static bool __grow_pool_try(int needed, struct ptlrpc_page_pool *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 */ @@ -953,7 +954,7 @@ static bool __grow_pool_try(int needed, struct ptlrpc_page_pool *pool) 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); @@ -1055,7 +1056,7 @@ int sptlrpc_pool_init(void) 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);