int64_t pool = ++pending_inc.new_pool_max;
pg_pool_t empty;
pg_pool_t *pi = pending_inc.get_new_pool(pool, &empty);
+ pi->create_time = ceph_clock_now();
pi->type = pool_type;
pi->fast_read = fread;
pi->flags = g_conf->osd_pool_default_flags;
void pg_pool_t::dump(Formatter *f) const
{
+ f->dump_stream("create_time") << get_create_time();
f->dump_unsigned("flags", get_flags());
f->dump_string("flags_names", get_flags_string());
f->dump_int("type", get_type());
return;
}
- uint8_t v = 26;
+ uint8_t v = 27;
// NOTE: any new encoding dependencies must be reflected by
// SIGNIFICANT_FEATURES
if (!(features & CEPH_FEATURE_NEW_OSDOP_ENCODING)) {
v = 21;
} else if (!HAVE_FEATURE(features, SERVER_LUMINOUS)) {
v = 24;
+ } else if (!HAVE_FEATURE(features, SERVER_MIMIC)) {
+ v = 26;
}
ENCODE_START(v, 5, bl);
if (v >= 26) {
encode(application_metadata, bl);
}
+ if (v >= 27) {
+ encode(create_time, bl);
+ }
ENCODE_FINISH(bl);
}
void pg_pool_t::decode(bufferlist::iterator& bl)
{
- DECODE_START_LEGACY_COMPAT_LEN(26, 5, 5, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(27, 5, 5, bl);
decode(type, bl);
decode(size, bl);
decode(crush_rule, bl);
if (struct_v >= 26) {
decode(application_metadata, bl);
}
+ if (struct_v >= 27) {
+ decode(create_time, bl);
+ }
DECODE_FINISH(bl);
calc_pg_masks();
calc_grade_table();
pg_pool_t a;
o.push_back(new pg_pool_t(a));
+ a.create_time = utime_t(4,5);
a.type = TYPE_REPLICATED;
a.size = 2;
a.crush_rule = 3;
}
}
+ utime_t create_time;
uint64_t flags; ///< FLAG_*
__u8 type; ///< TYPE_*
__u8 size, min_size; ///< number of osds in each pg
void dump(Formatter *f) const;
+ const utime_t &get_create_time() const { return create_time; }
uint64_t get_flags() const { return flags; }
bool has_flag(uint64_t f) const { return flags & f; }
void set_flag(uint64_t f) { flags |= f; }