* part of the incomplete pages. This is a TODO for another
* patch.
*/
- if (dst) {
+ if (dst) /* compressed page */ {
pg->count = PAGE_SIZE;
pg->pg = mem_to_page(dst + chunk_offset);
+ /* we get flags from the first page in the chunk and
+ * add COMPRESSED
+ */
+ pg->flag = pga[src_from]->flag | OBD_BRW_COMPRESSED;
} else {
pg->count = pga[src_page]->count;
pg->pg = pga[src_page]->pg;
+ pg->flag = pga[src_page]->flag;
}
- /*
- * Compressed pages, flags are lost
- * Let's choose first page in chunk
- * flag to set to all pages
- */
- pg->flag = pga[src_from]->flag | OBD_BRW_COMPRESSED;
- pg->pg->index = pga[src_page]->pg->index;
CDEBUG(D_SEC, "off 0x%llx, flag %x, pg %p, count %u\n",
pg->off, pg->flag, pg->pg, pg->count);