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;
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;
/* 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;
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);