From: Sage Weil Date: Tue, 10 May 2016 00:34:53 +0000 (-0400) Subject: os/bluestore: blob_t::init_csum() helper X-Git-Tag: v11.0.0~359^2~108 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3c14e29b47bf4048935097aae8be953c632578eb;p=ceph.git os/bluestore: blob_t::init_csum() helper Set up the checksum parameters and size csum_data appropriately. Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/bluestore_types.h b/src/os/bluestore/bluestore_types.h index fd64ba03714e..9bffb084c1af 100644 --- a/src/os/bluestore/bluestore_types.h +++ b/src/os/bluestore/bluestore_types.h @@ -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)