unsigned int src_size;
unsigned int dst_size;
int pages_per_chunk;
- int pages_left;
char *src = NULL;
char *dst = NULL;
int chunk_bits;
int chunk_size;
+ int pages_left;
int count = 0;
int buf_bits;
int rc = 0;
rc = alloc_compr(obd_name, &type, lvl, &cc, true);
if (rc)
GOTO(out, rc);
- /* the RPC may not start on a chunk boundary, find the first chunk
- * boundary, then start iterating by chunk_size at that point (in the
- * next loop)
- */
+
for (i = 0; i < page_count; i++) {
oap = brw_page2oap(pga[i]);
+ CDEBUG(D_SEC, "checking page %d, offset %llu\n",
+ i, oap->oap_obj_off);
- /* aligned to chunk size */
- if (!(oap->oap_obj_off & (chunk_size - 1)))
- break;
- }
-
- /* no chunk aligned pages in the RPC, no possibility of a compressed
- * chunk
- */
- if (i == page_count)
- GOTO(out, rc = 0);
-
- CDEBUG(D_SEC, "starting decompression at page %d, offset %llu\n",
- i, oap->oap_obj_off);
+ /* not aligned to chunk size, so can't be the start of a
+ * compressed chunk - continue
+ */
+ if (oap->oap_obj_off & (chunk_size - 1))
+ continue;
- /* i is the first chunk aligned page in the RPC */
- for (; i < page_count; i+=pages_per_chunk) {
if (!is_chunk_start(pga[i]->pg, &llch))
continue;