Whamcloud - gitweb
EX-7601 osc: variable cleanup in decompress_req
authorPatrick Farrell <pfarrell@whamcloud.com>
Mon, 13 Nov 2023 04:13:10 +0000 (23:13 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 24 Nov 2023 09:29:21 +0000 (09:29 +0000)
Use type and lvl variables in decompress_request.

Remove an unused variable and an assert which can never
fire.

Test-Parameters: trivial
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: Ieff57411a2a41215fd368d731614801bd0f43e38
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53107
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/osc/osc_compress.c

index 7cc2d97..a99741c 100644 (file)
@@ -230,6 +230,8 @@ int decompress_request(struct osc_brw_async_args *aa, int page_count)
        struct brw_page **pga = aa->aa_ppga;
        struct osc_async_page *oap = NULL;
        struct ll_compr_hdr *llch = NULL;
+       char *obd_name = aa->aa_cli->cl_import->imp_obd->obd_name;
+       enum ll_compr_type type;
        struct cl_page *clpage;
        unsigned int src_size;
        unsigned int dst_size;
@@ -243,12 +245,14 @@ int decompress_request(struct osc_brw_async_args *aa, int page_count)
        int buf_bits;
        int rc = 0;
        int i = 0;
-       char *obd_name = aa->aa_cli->cl_import->imp_obd->obd_name;
+       int lvl;
        ENTRY;
 
        clpage = oap2cl_page(brw_page2oap(pga[0]));
+       lvl = clpage->cp_comp_level;
+       type = clpage->cp_comp_type;
        /* no compression */
-       if (clpage->cp_comp_type == LL_COMPR_TYPE_NONE)
+       if (type == LL_COMPR_TYPE_NONE)
                RETURN(0);
        chunk_bits = cl_page_compr_bits(clpage);
        chunk_size = 1 << chunk_bits;
@@ -278,14 +282,9 @@ int decompress_request(struct osc_brw_async_args *aa, int page_count)
 
        /* i is the first chunk aligned page in the RPC */
        for (; i < page_count; i+=pages_in_chunk) {
-               struct cl_page *cl_page =
-                               oap2cl_page(brw_page2oap(pga[i]));
-
                if (!is_chunk_start(pga[i]->pg, &llch))
                        continue;
 
-               LASSERT(cl_page->cp_comp_type != LL_COMPR_TYPE_NONE);
-
                if (!src) { /* get chunk size once */
                        int rpc_chunk_bits;
 
@@ -313,15 +312,11 @@ int decompress_request(struct osc_brw_async_args *aa, int page_count)
                LASSERT(src_size <= chunk_size);
                dst_size = 2 * chunk_size;
                CDEBUG(D_SEC, "Compressed size %lu, type %i\n",
-                      llch->llch_compr_size + sizeof(*llch),
-                      llch->llch_compr_type);
-
-               rc = decompress_chunk(obd_name,
-                                       src + llch->llch_header_size,
-                                       llch->llch_compr_size,
-                                       dst, &dst_size,
-                                       llch->llch_compr_type,
-                                       llch->llch_compr_level);
+                      llch->llch_compr_size + sizeof(*llch), type);
+
+               rc = decompress_chunk(obd_name, src + llch->llch_header_size,
+                                     llch->llch_compr_size, dst, &dst_size,
+                                     type, lvl);
                if (rc)
                        GOTO(out, rc);