f->close_section(); // hit_set_params
f->dump_unsigned("hit_set_period", hit_set_period);
f->dump_unsigned("hit_set_count", hit_set_count);
+ f->dump_unsigned("stripe_width", get_stripe_width());
}
}
__u8 encode_compat = 5;
- ENCODE_START(11, encode_compat, bl);
+ ENCODE_START(12, encode_compat, bl);
::encode(type, bl);
::encode(size, bl);
::encode(crush_ruleset, bl);
::encode(hit_set_params, bl);
::encode(hit_set_period, bl);
::encode(hit_set_count, bl);
+ ::encode(stripe_width, bl);
ENCODE_FINISH_NEW_COMPAT(bl, encode_compat);
}
void pg_pool_t::decode(bufferlist::iterator& bl)
{
- DECODE_START_LEGACY_COMPAT_LEN(11, 5, 5, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(12, 5, 5, bl);
::decode(type, bl);
::decode(size, bl);
::decode(crush_ruleset, bl);
hit_set_period = def.hit_set_period;
hit_set_count = def.hit_set_count;
}
+ if (struct_v >= 12) {
+ ::decode(stripe_width, bl);
+ } else {
+ set_stripe_width(0);
+ }
DECODE_FINISH(bl);
calc_pg_masks();
}
a.hit_set_params = HitSet::Params(new BloomHitSet::Params);
a.hit_set_period = 3600;
a.hit_set_count = 8;
+ a.set_stripe_width(12345);
o.push_back(new pg_pool_t(a));
}
<< " " << p.hit_set_period << "s"
<< " x" << p.hit_set_count;
}
+ out << " stripe_width " << p.get_stripe_width();
return out;
}
uint32_t hit_set_period; ///< periodicity of HitSet segments (seconds)
uint32_t hit_set_count; ///< number of periods to retain
+ uint32_t stripe_width; ///< erasure coded stripe size in bytes
+
pg_pool_t()
: flags(0), type(0), size(0), min_size(0),
crush_ruleset(0), object_hash(0),
cache_mode(CACHEMODE_NONE),
hit_set_params(),
hit_set_period(0),
- hit_set_count(0)
+ hit_set_count(0),
+ stripe_width(0)
{ }
void dump(Formatter *f) const;
void set_snap_seq(snapid_t s) { snap_seq = s; }
void set_snap_epoch(epoch_t e) { snap_epoch = e; }
+ void set_stripe_width(uint32_t s) { stripe_width = s; }
+ uint32_t get_stripe_width() const { return stripe_width; }
+
bool is_replicated() const { return get_type() == TYPE_REPLICATED; }
bool is_erasure() const { return get_type() == TYPE_ERASURE; }