Whamcloud - gitweb
EX-7601 osc: rename pages_in_chunk
authorPatrick Farrell <pfarrell@whamcloud.com>
Thu, 16 Nov 2023 20:37:57 +0000 (15:37 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 27 Nov 2023 18:37:40 +0000 (18:37 +0000)
Chunks can have variable numbers of pages in them.

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: If199d777367569e62c21305f6e4b9f3e4cce6d06
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53158
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Artem Blagodarenko <ablagodarenko@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/osc/osc_compress.c

index ea6bda2..ebe1487 100644 (file)
@@ -244,7 +244,7 @@ int decompress_request(struct osc_brw_async_args *aa, int page_count)
        struct crypto_comp *cc;
        unsigned int src_size;
        unsigned int dst_size;
-       int pages_in_chunk;
+       int pages_per_chunk;
        int pages_left;
        char *src = NULL;
        char *dst = NULL;
@@ -266,7 +266,7 @@ int decompress_request(struct osc_brw_async_args *aa, int page_count)
        chunk_bits = cl_page_compr_bits(clpage);
        chunk_size = 1 << chunk_bits;
        buf_bits = chunk_bits + 1;
-       pages_in_chunk = chunk_size / PAGE_SIZE;
+       pages_per_chunk = chunk_size / PAGE_SIZE;
 
        rc = alloc_compr(obd_name, &type, lvl, &cc, true);
        if (rc)
@@ -293,7 +293,7 @@ int decompress_request(struct osc_brw_async_args *aa, int page_count)
               i, oap->oap_obj_off);
 
        /* i is the first chunk aligned page in the RPC */
-       for (; i < page_count; i+=pages_in_chunk) {
+       for (; i < page_count; i+=pages_per_chunk) {
                if (!is_chunk_start(pga[i]->pg, &llch))
                        continue;
 
@@ -313,8 +313,8 @@ int decompress_request(struct osc_brw_async_args *aa, int page_count)
                                GOTO(out, rc = -EIO);
                        }
 
-                       CDEBUG(D_SEC, "chunk_size: %i, pages_in_chunk: %i\n",
-                               chunk_size, pages_in_chunk);
+                       CDEBUG(D_SEC, "chunk_size: %i, pages_per_chunk: %i\n",
+                               chunk_size, pages_per_chunk);
 
                        sptlrpc_pool_get_pages((void **)&src,
                                buf_bits);
@@ -323,7 +323,7 @@ int decompress_request(struct osc_brw_async_args *aa, int page_count)
                        if (src == NULL || dst == NULL)
                                GOTO(out, rc = -ENOMEM);
                }
-               pages_left = min_t(int, pages_in_chunk, page_count - i);
+               pages_left = min_t(int, pages_per_chunk, page_count - i);
 
                CDEBUG(D_SEC, "Merge chunk [%i, %i], src: %px\n", i,
                       i + pages_left - 1, src);