]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: EC optimizations: additional types for EC
authorBill Scales <bill_scales@uk.ibm.com>
Sun, 23 Mar 2025 14:20:33 +0000 (14:20 +0000)
committerBill Scales <bill_scales@uk.ibm.com>
Mon, 7 Apr 2025 14:00:55 +0000 (15:00 +0100)
Add some extra types required by the EC optimizations code:

raw_shard_id_t is an equivalent type to shard_id_t but is used
for storing raw shards. Strong typing prevents bugs where code
forgets to translate between the two types.

shard_id_map is a mini_flat_map indexed by shard_id_t which will
be used by the EC optimizations I/O path to track updates to
each shard.

shard_id_set is a bitset_set of shard_id_t which is a compact
and fast way of storing a set of shards involved in an EC
operation.

Signed-off-by: Bill Scales <bill_scales@uk.ibm.com>
src/osd/ECTypes.h

index 932d6424ed21b150fd0ad68ffdcf8d3ec4afb557..325ac5428a19b3af882c1dd14b093f0ee9e92982 100644 (file)
@@ -21,16 +21,14 @@ struct ec_align_t {
   uint64_t offset;
   uint64_t size;
   uint32_t flags;
-  friend std::ostream &operator<<(std::ostream &lhs, const ec_align_t &rhs) {
-    return lhs << rhs.offset << ","
-               << rhs.size << ","
-               << rhs.flags;
-  }
   ec_align_t(std::pair<uint64_t, uint64_t> p, uint32_t flags)
     : offset(p.first), size(p.second), flags(flags) {}
   ec_align_t(uint64_t offset, uint64_t size, uint32_t flags)
     : offset(offset), size(size), flags(flags) {}
   bool operator==(const ec_align_t &other) const;
+  void print(std::ostream &os) const {
+    os << offset << "," << size << "," << flags;
+  }
 };
 
 struct raw_shard_id_t {