Whamcloud - gitweb
EX-7601 osc: remove cpga fill bits
authorPatrick Farrell <pfarrell@whamcloud.com>
Fri, 10 Nov 2023 19:07:07 +0000 (14:07 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 24 Nov 2023 09:26:52 +0000 (09:26 +0000)
cpga fill bits are not needed now that we don't support
compression and encryption.

Test-Parameters: trivial
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I13c2278e085e9b288bd896585947e28e2ea505ca
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53082
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/osc/osc_compress.c

index dfbb299..6fd717e 100644 (file)
 #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;
@@ -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);