#include "osc_compress.h"
#include <lustre_compr.h>
-enum cpga_fill_bits {
- CPGA_FILL_DIRECTIO = 0x0001,
- CPGA_FILL_ENCRYPTED = 0x0002,
-};
-
void free_cpga(struct brw_page **cpga, u32 page_count)
{
int i;
}
int fill_cpga(struct brw_page **cpga, struct brw_page **pga,
- char *dst, int src_from, int dst_from, size_t dst_size,
- enum cpga_fill_bits fill_bits)
+ char *dst, int src_from, int dst_from, size_t dst_size)
{
+ struct brw_page *pg;
int chunk_offset;
int dst_page;
int src_page;
- struct brw_page *pg;
- struct cl_page *clpage;
for (chunk_offset = 0, dst_page = dst_from, src_page = src_from;
chunk_offset < dst_size;
* flag to set to all pages
*/
pg->flag = pga[src_from]->flag | OBD_BRW_COMPRESSED;
-
- if (fill_bits & CPGA_FILL_ENCRYPTED) {
- if (fill_bits & CPGA_FILL_DIRECTIO) {
- clpage = oap2cl_page(
- brw_page2oap(pga[src_page]));
- pg->pg->index = clpage->cp_page_index;
- } else {
- pg->pg->index = pga[src_page]->pg->index;
- }
- }
+ 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);
{
struct cl_page *clpage;
unsigned int applied_type = LL_COMPR_TYPE_UNCHANGED;
- enum cpga_fill_bits fill_bits = 0;
unsigned int src_size;
unsigned int dst_size;
int chunk_start = 0;
chunk_size = (1 << chunk_bits);
pages_in_chunk = chunk_size / PAGE_SIZE;
- if (clpage->cp_type == CPT_TRANSIENT)
- fill_bits |= CPGA_FILL_DIRECTIO;
- if (clpage->cp_inode && IS_ENCRYPTED(clpage->cp_inode))
- fill_bits |= CPGA_FILL_ENCRYPTED;
-
OBD_ALLOC(*cpga, *page_count * sizeof(**cpga));
src_buf_bits = chunk_bits;
dest_buf_bits = chunk_bits + 1;
}
rc = fill_cpga(*cpga, pga, done ? dst : NULL,
- chunk_start, cpga_i, dst_size,
- fill_bits);
+ chunk_start, cpga_i, dst_size);
if (!done) {
sptlrpc_pool_put_pages(&dst, dest_buf_bits);