]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: csum_block -> csum_chunk
authorSage Weil <sage@redhat.com>
Mon, 6 Jun 2016 18:53:22 +0000 (14:53 -0400)
committerSage Weil <sage@redhat.com>
Wed, 15 Jun 2016 19:25:30 +0000 (15:25 -0400)
Be consistent with terminology.

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

index 743bbfd93336b783ebcd1bc69c5927850e4c39a8..e53cff5ea8a61cfeb04349bb97a7d12e63413b1b 100644 (file)
@@ -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;
index 1425bf401329959116f95a06664ac39fbed05be5..7a6494069449b3396ffdf7f0d00e54d47ebf2db0 100644 (file)
@@ -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<bluestore_blob_t*>& 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<Checksummer::xxhash32>(
-      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<Checksummer::xxhash64>(
-      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<Checksummer::crc32c>(
-      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<Checksummer::xxhash32>(
-      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<Checksummer::xxhash64>(
-      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<Checksummer::crc32c>(
-      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;
index afecf8d5d144585ce8f5bee532297989c62b5323..0527645f367a76e0c13c6a52414c2744e127358f 100644 (file)
@@ -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<<block_order bytes
+  uint8_t csum_chunk_order;        ///< csum block size is 1<<block_order bytes
 
   bluestore_extent_ref_map_t ref_map; ///< references (empty when in onode)
   interval_set<uint32_t> 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();
   }