Whamcloud - gitweb
EX-8270 ptlrpc: rename 'size_bits' to 'order'
authorPatrick Farrell <pfarrell@whamcloud.com>
Sat, 16 Sep 2023 03:24:51 +0000 (23:24 -0400)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 22 Sep 2023 23:52:51 +0000 (23:52 +0000)
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 <pfarrell@whamcloud.com>
Change-Id: I38b184239814a0f692b644566075c798ed16f816
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/52427
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/include/lustre_sec.h
lustre/ptlrpc/sec_bulk.c

index 39c6e4f..f0950e4 100644 (file)
@@ -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);
 
index 6d3c31d..7911ce7 100644 (file)
@@ -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);