From: Patrick Farrell Date: Sat, 16 Sep 2023 03:24:51 +0000 (-0400) Subject: EX-8270 ptlrpc: rename 'size_bits' to 'order' X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=e45285874e1fd6c056e3bbfaa0f489c0f2169286;p=fs%2Flustre-release.git EX-8270 ptlrpc: rename 'size_bits' to 'order' The kernel uses 'order' to refer to page allocations of a certain 'order', meaning 2^order pages. That's what our 'size bits' is - an allocation of a certain 'order'. Test-Parameters: trivial Signed-off-by: Patrick Farrell Change-Id: I38b184239814a0f692b644566075c798ed16f816 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/52427 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lustre/include/lustre_sec.h b/lustre/include/lustre_sec.h index 39c6e4f..f0950e4 100644 --- a/lustre/include/lustre_sec.h +++ b/lustre/include/lustre_sec.h @@ -1168,10 +1168,10 @@ int sptlrpc_enc_pool_add_user(void); int sptlrpc_enc_pool_del_user(void); int sptlrpc_enc_pool_get_pages(struct ptlrpc_bulk_desc *desc); int sptlrpc_enc_pool_get_pages_array(struct page **pa, unsigned int count); -int sptlrpc_enc_pool_get_buf(void **buf, unsigned int size_bits); +int sptlrpc_enc_pool_get_buf(void **buf, unsigned int order); void sptlrpc_enc_pool_put_pages(struct ptlrpc_bulk_desc *desc); void sptlrpc_enc_pool_put_pages_array(struct page **pa, unsigned int count); -void sptlrpc_enc_pool_put_buf(void *buf, unsigned int size_bits); +void sptlrpc_enc_pool_put_buf(void *buf, unsigned int order); int sptlrpc_enc_pool_get_free_pages(unsigned int pool); int pool_is_at_full_capacity(void); diff --git a/lustre/ptlrpc/sec_bulk.c b/lustre/ptlrpc/sec_bulk.c index 6d3c31d..7911ce7a 100644 --- a/lustre/ptlrpc/sec_bulk.c +++ b/lustre/ptlrpc/sec_bulk.c @@ -52,7 +52,7 @@ #define PPOOL_MIN_CHUNK_BITS 16 /* 2^16 bytes = 64KiB */ #define PPOOL_MAX_CHUNK_BITS PTLRPC_MAX_BRW_BITS #define POOLS_COUNT (PPOOL_MAX_CHUNK_BITS - PPOOL_MIN_CHUNK_BITS + 1) -#define PPOOL_SIZE_TO_INDEX(bits) ((bits) - PPOOL_MIN_CHUNK_BITS + 1) +#define PPOOL_ORDER_TO_INDEX(bits) ((bits) - PPOOL_MIN_CHUNK_BITS + 1) #define POOL_BITS(pool) ((pool) + PPOOL_MIN_CHUNK_BITS - 1) #define ELEMENT_SIZE(pool) (1 << (PPOOL_MIN_CHUNK_BITS + (pool) - 1)) #define mult (20 - PAGE_SHIFT) @@ -832,10 +832,10 @@ int sptlrpc_enc_pool_get_pages_array(struct page **pa, unsigned int count) } EXPORT_SYMBOL(sptlrpc_enc_pool_get_pages_array); -int sptlrpc_enc_pool_get_buf(void **buf, unsigned int size_bits) +int sptlrpc_enc_pool_get_buf(void **buf, unsigned int order) { return __sptlrpc_enc_pool_get_pages((void *)buf, 0, - PPOOL_SIZE_TO_INDEX(size_bits), + PPOOL_ORDER_TO_INDEX(order), page_from_bufarray); } EXPORT_SYMBOL(sptlrpc_enc_pool_get_buf); @@ -920,12 +920,12 @@ void sptlrpc_enc_pool_put_pages_array(struct page **pa, unsigned int count) } EXPORT_SYMBOL(sptlrpc_enc_pool_put_pages_array); -void sptlrpc_enc_pool_put_buf(void *buf, unsigned int size_bits) +void sptlrpc_enc_pool_put_buf(void *buf, unsigned int order) { int rc; rc = __sptlrpc_enc_pool_put_pages(buf, 1, - PPOOL_SIZE_TO_INDEX(size_bits), + PPOOL_ORDER_TO_INDEX(order), page_from_bufarray); if (rc) CDEBUG(D_SEC, "error putting pages in enc pool: %d\n", rc);