From: Sage Weil Date: Tue, 10 May 2016 00:34:26 +0000 (-0400) Subject: os/bluestore: instantiate a Checksummer X-Git-Tag: v11.0.0~359^2~110 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e52fc77f379bfd6de9f87368d49c7c8e4d26e94b;p=ceph.git os/bluestore: instantiate a Checksummer Signed-off-by: Sage Weil --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 142d456fe287..a3ee4647d858 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -949,6 +949,10 @@ OPTION(bluestore_block_wal_path, OPT_STR, "") OPTION(bluestore_block_wal_size, OPT_U64, 96 * 1024*1024) // rocksdb wal OPTION(bluestore_block_wal_create, OPT_BOOL, false) OPTION(bluestore_block_preallocate_file, OPT_BOOL, false) //whether preallocate space if block/db_path/wal_path is file rather that block device. +OPTION(bluestore_csum, OPT_BOOL, true) +OPTION(bluestore_csum_type, OPT_STR, "crc32c") +OPTION(bluestore_min_csum_block, OPT_U32, 4096) +OPTION(bluestore_max_csum_block, OPT_U32, 64*1024) OPTION(bluestore_min_alloc_size, OPT_U32, 64*1024) OPTION(bluestore_onode_map_size, OPT_U32, 1024) // onodes per collection OPTION(bluestore_cache_tails, OPT_BOOL, true) // cache tail blocks in Onode diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 139c42d152e0..b59d2411a738 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -769,7 +769,8 @@ BlueStore::BlueStore(CephContext *cct, const string& path) finisher(cct), kv_sync_thread(this), kv_stop(false), - logger(NULL) + logger(NULL), + checksummer(new Checksummer) { _init_logger(); } @@ -781,6 +782,7 @@ BlueStore::~BlueStore() assert(db == NULL); assert(bluefs == NULL); assert(fsid_fd < 0); + delete checksummer; } void BlueStore::_init_logger() diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index e28e103ceaeb..5a827d4084ec 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -38,6 +38,7 @@ class Allocator; class FreelistManager; class BlueFS; +class Checksummer; enum { l_bluestore_first = 732430, @@ -584,6 +585,7 @@ private: std::mutex reap_lock; list removed_collections; + Checksummer *checksummer; // -------------------------------------------------------- // private methods