Whamcloud - gitweb
LU-241 Support crc32c with hardware accelerated instruction as one of lustre checksums
[fs/lustre-release.git] / lustre / osc / osc_request.c
index be0027b..2f876d4 100644 (file)
@@ -1488,11 +1488,8 @@ static int check_write_checksum(struct obdo *oa, const lnet_process_id_t *peer,
         if (oa->o_valid & OBD_MD_FLFLAGS && oa->o_flags & OBD_FL_MMAP)
                 return 1;
 
-        if (oa->o_valid & OBD_MD_FLFLAGS)
-                cksum_type = cksum_type_unpack(oa->o_flags);
-        else
-                cksum_type = OBD_CKSUM_CRC32;
-
+        cksum_type = cksum_type_unpack(oa->o_valid & OBD_MD_FLFLAGS ?
+                                       oa->o_flags : 0);
         new_cksum = osc_checksum_bulk(nob, page_count, pga, OST_WRITE,
                                       cksum_type);
 
@@ -1620,10 +1617,8 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc)
                 char      *router;
                 cksum_type_t cksum_type;
 
-                if (body->oa.o_valid & OBD_MD_FLFLAGS)
-                        cksum_type = cksum_type_unpack(body->oa.o_flags);
-                else
-                        cksum_type = OBD_CKSUM_CRC32;
+                cksum_type = cksum_type_unpack(body->oa.o_valid &OBD_MD_FLFLAGS?
+                                               body->oa.o_flags : 0);
                 client_cksum = osc_checksum_bulk(rc, aa->aa_page_count,
                                                  aa->aa_ppga, OST_READ,
                                                  cksum_type);