From 7c641ec9a73419aed4cf244f6ff60190cd0d1dcf Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Fri, 10 Nov 2023 14:07:07 -0500 Subject: [PATCH] EX-7601 osc: remove cpga fill bits cpga fill bits are not needed now that we don't support compression and encryption. Test-Parameters: trivial Signed-off-by: Patrick Farrell Change-Id: I13c2278e085e9b288bd896585947e28e2ea505ca Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53082 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Sebastien Buisson Reviewed-by: Andreas Dilger --- lustre/osc/osc_compress.c | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/lustre/osc/osc_compress.c b/lustre/osc/osc_compress.c index dfbb299..6fd717e 100644 --- a/lustre/osc/osc_compress.c +++ b/lustre/osc/osc_compress.c @@ -32,11 +32,6 @@ #include "osc_compress.h" #include -enum cpga_fill_bits { - CPGA_FILL_DIRECTIO = 0x0001, - CPGA_FILL_ENCRYPTED = 0x0002, -}; - void free_cpga(struct brw_page **cpga, u32 page_count) { int i; @@ -56,14 +51,12 @@ void free_cpga(struct brw_page **cpga, u32 page_count) } 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; @@ -111,16 +104,7 @@ int fill_cpga(struct brw_page **cpga, struct brw_page **pga, * 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); @@ -136,7 +120,6 @@ int compress_request(const char *obd_name, struct obdo *oa, { 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; @@ -160,11 +143,6 @@ int compress_request(const char *obd_name, struct obdo *oa, 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; @@ -219,8 +197,7 @@ int compress_request(const char *obd_name, struct obdo *oa, } 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); -- 1.8.3.1