From: Bill Scales Date: Sun, 23 Mar 2025 14:20:33 +0000 (+0000) Subject: osd: EC optimizations: additional types for EC X-Git-Tag: v20.3.0~132^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c1ca6f485f6b874595eddb20afda839e5c2a4251;p=ceph.git osd: EC optimizations: additional types for EC 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 --- diff --git a/src/osd/ECTypes.h b/src/osd/ECTypes.h index 932d6424ed21..325ac5428a19 100644 --- a/src/osd/ECTypes.h +++ b/src/osd/ECTypes.h @@ -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 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 {