mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
ceph-dencoder: pg_t
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
This commit is contained in:
parent
8791cb98fe
commit
8bf08abc6a
@ -78,6 +78,21 @@ bool pg_t::parse(const char *s)
|
||||
return true;
|
||||
}
|
||||
|
||||
void pg_t::dump(Formatter *f) const
|
||||
{
|
||||
f->dump_unsigned("pool", m_pool);
|
||||
f->dump_unsigned("seed", m_seed);
|
||||
f->dump_int("preferred_osd", m_preferred);
|
||||
}
|
||||
|
||||
void pg_t::generate_test_instances(list<pg_t*>& o)
|
||||
{
|
||||
o.push_back(new pg_t);
|
||||
o.push_back(new pg_t(1, 2, -1));
|
||||
o.push_back(new pg_t(13123, 3, -1));
|
||||
o.push_back(new pg_t(131223, 4, 23));
|
||||
}
|
||||
|
||||
ostream& operator<<(ostream& out, const pg_t &pg)
|
||||
{
|
||||
out << pg.pool() << '.';
|
||||
|
@ -193,6 +193,8 @@ struct pg_t {
|
||||
::decode(opg, bl);
|
||||
*this = opg;
|
||||
}
|
||||
void dump(Formatter *f) const;
|
||||
static void generate_test_instances(list<pg_t*>& o);
|
||||
};
|
||||
WRITE_CLASS_ENCODER(pg_t)
|
||||
|
||||
|
@ -21,6 +21,7 @@ TYPE(PG::Interval)
|
||||
TYPE(PG::OndiskLog)
|
||||
|
||||
#include "osd/osd_types.h"
|
||||
TYPE(pg_t)
|
||||
TYPE(osd_stat_t)
|
||||
TYPE(OSDSuperblock)
|
||||
TYPE(pool_snap_info_t)
|
||||
|
Loading…
Reference in New Issue
Block a user