Skip to content

Commit c1ca6f4

Browse files
committed
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 <[email protected]>
1 parent 9aacbd1 commit c1ca6f4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/osd/ECTypes.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,14 @@ struct ec_align_t {
2121
uint64_t offset;
2222
uint64_t size;
2323
uint32_t flags;
24-
friend std::ostream &operator<<(std::ostream &lhs, const ec_align_t &rhs) {
25-
return lhs << rhs.offset << ","
26-
<< rhs.size << ","
27-
<< rhs.flags;
28-
}
2924
ec_align_t(std::pair<uint64_t, uint64_t> p, uint32_t flags)
3025
: offset(p.first), size(p.second), flags(flags) {}
3126
ec_align_t(uint64_t offset, uint64_t size, uint32_t flags)
3227
: offset(offset), size(size), flags(flags) {}
3328
bool operator==(const ec_align_t &other) const;
29+
void print(std::ostream &os) const {
30+
os << offset << "," << size << "," << flags;
31+
}
3432
};
3533

3634
struct raw_shard_id_t {

0 commit comments

Comments
 (0)