]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: blob_t::init_csum() helper
authorSage Weil <sage@redhat.com>
Tue, 10 May 2016 00:34:53 +0000 (20:34 -0400)
committerSage Weil <sage@redhat.com>
Wed, 1 Jun 2016 15:38:45 +0000 (11:38 -0400)
Set up the checksum parameters and size csum_data appropriately.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/bluestore_types.h

index fd64ba03714e5d2bfc3df06ab4b9b851cb27c577..9bffb084c1af22d6477510eb0781549eae21473a 100644 (file)
@@ -371,6 +371,13 @@ struct bluestore_blob_t {
       assert(0 == "unrecognized csum word size");
     }
   }
+
+  void init_csum(unsigned type, unsigned order) {
+    csum_type = type;
+    csum_block_order = order;
+    csum_data.resize(get_csum_value_size() * get_ondisk_length() /
+                    get_csum_block_size());
+  }
 };
 WRITE_CLASS_ENCODER(bluestore_blob_t)