From: Sage Weil Date: Mon, 6 Jun 2016 18:53:22 +0000 (-0400) Subject: os/bluestore: csum_block -> csum_chunk X-Git-Tag: v11.0.0~160^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=819dd4e57cf7cf7eac2fed19825fec8635e04a4a;p=ceph.git os/bluestore: csum_block -> csum_chunk Be consistent with terminology. Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 743bbfd93336..e53cff5ea8a6 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -3397,7 +3397,7 @@ int BlueStore::_read_extent_sparse( // enough regions together. dout(20) << __func__ << " " << *blob << " " << *extent << dendl; IOContext ioc(NULL); // FIXME? - uint64_t chunk_size = MAX(blob->get_csum_block_size(), block_size); + uint64_t chunk_size = MAX(blob->get_csum_chunk_size(), block_size); // all physical extents has to be aligned with read chunk size assert((extent->length % chunk_size) == 0); @@ -5702,7 +5702,7 @@ void BlueStore::_do_write_small( << " bstart 0x" << std::hex << bstart << std::dec << dendl; // can we pad our head/tail out with zeros? - uint64_t chunk_size = MAX(block_size, b->get_csum_block_size()); + uint64_t chunk_size = MAX(block_size, b->get_csum_chunk_size()); uint64_t head_pad = offset % chunk_size; if (head_pad && o->onode.has_any_lextents(offset - head_pad, chunk_size)) { head_pad = 0; diff --git a/src/os/bluestore/bluestore_types.cc b/src/os/bluestore/bluestore_types.cc index 1425bf401329..7a6494069449 100644 --- a/src/os/bluestore/bluestore_types.cc +++ b/src/os/bluestore/bluestore_types.cc @@ -454,7 +454,7 @@ void bluestore_blob_t::encode(bufferlist& bl) const ::encode(compressed_length, bl); ::encode(flags, bl); ::encode(csum_type, bl); - ::encode(csum_block_order, bl); + ::encode(csum_chunk_order, bl); ::encode(ref_map, bl); ::encode(unused, bl); ::encode(csum_data, bl); @@ -469,7 +469,7 @@ void bluestore_blob_t::decode(bufferlist::iterator& p) ::decode(compressed_length, p); ::decode(flags, p); ::decode(csum_type, p); - ::decode(csum_block_order, p); + ::decode(csum_chunk_order, p); ::decode(ref_map, p); ::decode(unused, p); ::decode(csum_data, p); @@ -487,7 +487,7 @@ void bluestore_blob_t::dump(Formatter *f) const f->dump_unsigned("compressed_length", compressed_length); f->dump_unsigned("flags", flags); f->dump_unsigned("csum_type", csum_type); - f->dump_unsigned("csum_block_order", csum_block_order); + f->dump_unsigned("csum_chunk_order", csum_chunk_order); f->dump_object("ref_map", ref_map); f->open_array_section("csum_data"); size_t n = get_csum_count(); @@ -511,7 +511,7 @@ void bluestore_blob_t::generate_test_instances(list& ls) ls.push_back(new bluestore_blob_t(4096, bluestore_pextent_t(111, 222), 12)); ls.push_back(new bluestore_blob_t(4096, bluestore_pextent_t(111, 222), 12)); ls.back()->csum_type = CSUM_XXHASH32; - ls.back()->csum_block_order = 16; + ls.back()->csum_chunk_order = 16; ls.back()->csum_data = buffer::claim_malloc(4, strdup("abcd")); ls.back()->ref_map.get(3, 5); ls.back()->add_unused(0, 3); @@ -528,7 +528,7 @@ ostream& operator<<(ostream& out, const bluestore_blob_t& o) } if (o.csum_type) { out << " " << o.get_csum_type_string(o.csum_type) - << "/0x" << std::hex << (1ull << o.csum_block_order) << std::dec; + << "/0x" << std::hex << (1ull << o.csum_chunk_order) << std::dec; } if (!o.ref_map.empty()) { out << " " << o.ref_map; @@ -571,8 +571,8 @@ void bluestore_blob_t::put_ref( } // we cannot release something smaller than our csum chunk size - if (has_csum_data() && get_csum_block_size() > min_release_size) { - min_release_size = get_csum_block_size(); + if (has_csum_data() && get_csum_chunk_size() > min_release_size) { + min_release_size = get_csum_chunk_size(); } // search from logical releases @@ -664,15 +664,15 @@ void bluestore_blob_t::calc_csum(uint64_t b_off, const bufferlist& bl) switch (csum_type) { case CSUM_XXHASH32: Checksummer::calculate( - get_csum_block_size(), b_off, bl.length(), bl, &csum_data); + get_csum_chunk_size(), b_off, bl.length(), bl, &csum_data); break; case CSUM_XXHASH64: Checksummer::calculate( - get_csum_block_size(), b_off, bl.length(), bl, &csum_data); + get_csum_chunk_size(), b_off, bl.length(), bl, &csum_data); break;; case CSUM_CRC32C: Checksummer::calculate( - get_csum_block_size(), b_off, bl.length(), bl, &csum_data); + get_csum_chunk_size(), b_off, bl.length(), bl, &csum_data); break; } } @@ -688,15 +688,15 @@ int bluestore_blob_t::verify_csum(uint64_t b_off, const bufferlist& bl, break; case CSUM_XXHASH32: *b_bad_off = Checksummer::verify( - get_csum_block_size(), b_off, bl.length(), bl, csum_data); + get_csum_chunk_size(), b_off, bl.length(), bl, csum_data); break; case CSUM_XXHASH64: *b_bad_off = Checksummer::verify( - get_csum_block_size(), b_off, bl.length(), bl, csum_data); + get_csum_chunk_size(), b_off, bl.length(), bl, csum_data); break; case CSUM_CRC32C: *b_bad_off = Checksummer::verify( - get_csum_block_size(), b_off, bl.length(), bl, csum_data); + get_csum_chunk_size(), b_off, bl.length(), bl, csum_data); break; default: r = -EOPNOTSUPP; diff --git a/src/os/bluestore/bluestore_types.h b/src/os/bluestore/bluestore_types.h index afecf8d5d144..0527645f367a 100644 --- a/src/os/bluestore/bluestore_types.h +++ b/src/os/bluestore/bluestore_types.h @@ -257,7 +257,7 @@ struct bluestore_blob_t { uint32_t flags; ///< FLAG_* uint8_t csum_type; ///< CSUM_* - uint8_t csum_block_order; ///< csum block size is 1< unused; ///< portion that has never been written to @@ -268,7 +268,7 @@ struct bluestore_blob_t { compressed_length(0), flags(f), csum_type(CSUM_NONE), - csum_block_order(12) { + csum_chunk_order(12) { } bluestore_blob_t(uint32_t l, const bluestore_pextent_t& ext, uint32_t f = 0) @@ -276,7 +276,7 @@ struct bluestore_blob_t { compressed_length(0), flags(f), csum_type(CSUM_NONE), - csum_block_order(12) { + csum_chunk_order(12) { extents.push_back(ext); } @@ -315,7 +315,7 @@ struct bluestore_blob_t { uint32_t pl = get_payload_length(); pl = ROUND_UP_TO(pl, block_size); if(csum_type != CSUM_NONE) { - pl = ROUND_UP_TO(pl, get_csum_block_size()); + pl = ROUND_UP_TO(pl, get_csum_chunk_size()); } return pl; } @@ -443,8 +443,8 @@ struct bluestore_blob_t { return csum_data.length() > 0; } - uint32_t get_csum_block_size() const { - return 1 << csum_block_order; + uint32_t get_csum_chunk_size() const { + return 1 << csum_chunk_order; } size_t get_csum_value_size() const { @@ -490,8 +490,8 @@ struct bluestore_blob_t { void init_csum(unsigned type, unsigned order, unsigned len) { csum_type = type; - csum_block_order = order; - csum_data = buffer::create(get_csum_value_size() * len / get_csum_block_size()); + csum_chunk_order = order; + csum_data = buffer::create(get_csum_value_size() * len / get_csum_chunk_size()); csum_data.zero(); }