pools[pool].object_hash = CEPH_STR_HASH_RJENKINS;
pools[pool].pg_num = poolbase << pg_bits;
pools[pool].pgp_num = poolbase << pgp_bits;
- pools[pool].lpg_num = 0;
- pools[pool].lpgp_num = 0;
pools[pool].last_change = epoch;
if (p->first == CEPH_DATA_RULE)
pools[pool].crash_replay_interval = cct->_conf->osd_default_data_pool_replay_window;
pools[pool].object_hash = CEPH_STR_HASH_RJENKINS;
pools[pool].pg_num = (maxosd + 1) << pg_bits;
pools[pool].pgp_num = (maxosd + 1) << pgp_bits;
- pools[pool].lpg_num = 0;
- pools[pool].lpgp_num = 0;
pools[pool].last_change = epoch;
if (p->first == CEPH_DATA_RULE)
pools[pool].crash_replay_interval = cct->_conf->osd_default_data_pool_replay_window;
f->dump_int("object_hash", get_object_hash());
f->dump_int("pg_num", get_pg_num());
f->dump_int("pg_placement_num", get_pgp_num());
- f->dump_int("localized_pg_num", get_lpg_num());
- f->dump_int("localized_pg_placement_num", get_lpgp_num());
f->dump_unsigned("crash_replay_interval", get_crash_replay_interval());
f->dump_stream("last_change") << get_last_change();
f->dump_unsigned("auid", get_auid());
{
pg_num_mask = (1 << calc_bits_of(pg_num-1)) - 1;
pgp_num_mask = (1 << calc_bits_of(pgp_num-1)) - 1;
- lpg_num_mask = (1 << calc_bits_of(lpg_num-1)) - 1;
- lpgp_num_mask = (1 << calc_bits_of(lpgp_num-1)) - 1;
}
/*
*/
pg_t pg_pool_t::raw_pg_to_pg(pg_t pg) const
{
- if (pg.preferred() >= 0 && lpg_num)
- pg.set_ps(ceph_stable_mod(pg.ps(), lpg_num, lpg_num_mask));
- else
- pg.set_ps(ceph_stable_mod(pg.ps(), pg_num, pg_num_mask));
+ pg.set_ps(ceph_stable_mod(pg.ps(), pg_num, pg_num_mask));
return pg;
}
*/
ps_t pg_pool_t::raw_pg_to_pps(pg_t pg) const
{
- if (pg.preferred() >= 0 && lpgp_num)
- return ceph_stable_mod(pg.ps(), lpgp_num, lpgp_num_mask) + pg.pool();
- else
- return ceph_stable_mod(pg.ps(), pgp_num, pgp_num_mask) + pg.pool();
+ return ceph_stable_mod(pg.ps(), pgp_num, pgp_num_mask) + pg.pool();
}
void pg_pool_t::encode(bufferlist& bl, uint64_t features) const
::encode(object_hash, bl);
::encode(pg_num, bl);
::encode(pgp_num, bl);
+ __u32 lpg_num = 0, lpgp_num = 0; // tell old code that there are no localized pgs.
::encode(lpg_num, bl);
::encode(lpgp_num, bl);
::encode(last_change, bl);
::encode(object_hash, bl);
::encode(pg_num, bl);
::encode(pgp_num, bl);
+ __u32 lpg_num = 0, lpgp_num = 0; // tell old code that there are no localized pgs.
::encode(lpg_num, bl);
::encode(lpgp_num, bl);
::encode(last_change, bl);
return;
}
- ENCODE_START(5, 5, bl);
+ ENCODE_START(6, 5, bl);
::encode(type, bl);
::encode(size, bl);
::encode(crush_ruleset, bl);
::encode(object_hash, bl);
::encode(pg_num, bl);
::encode(pgp_num, bl);
+ __u32 lpg_num = 0, lpgp_num = 0; // tell old code that there are no localized pgs.
::encode(lpg_num, bl);
::encode(lpgp_num, bl);
::encode(last_change, bl);
void pg_pool_t::decode(bufferlist::iterator& bl)
{
- DECODE_START_LEGACY_COMPAT_LEN(5, 5, 5, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(6, 5, 5, bl);
::decode(type, bl);
::decode(size, bl);
::decode(crush_ruleset, bl);
::decode(object_hash, bl);
::decode(pg_num, bl);
::decode(pgp_num, bl);
- ::decode(lpg_num, bl);
- ::decode(lpgp_num, bl);
+ {
+ __u32 lpg_num, lpgp_num;
+ ::decode(lpg_num, bl);
+ ::decode(lpgp_num, bl);
+ }
::decode(last_change, bl);
::decode(snap_seq, bl);
::decode(snap_epoch, bl);
a.object_hash = 4;
a.pg_num = 6;
a.pgp_num = 5;
- a.lpg_num = 8;
- a.lpgp_num = 7;
a.last_change = 9;
a.snap_seq = 10;
a.snap_epoch = 11;
<< " object_hash " << p.get_object_hash_name()
<< " pg_num " << p.get_pg_num()
<< " pgp_num " << p.get_pgp_num()
- << " lpg_num " << p.get_lpg_num()
- << " lpgp_num " << p.get_lpgp_num()
<< " last_change " << p.get_last_change()
<< " owner " << p.get_auid();
if (p.flags)
__u8 crush_ruleset; /// crush placement rule set
__u8 object_hash; /// hash mapping object name to ps
__u32 pg_num, pgp_num; /// number of pgs
- __u32 lpg_num, lpgp_num; /// number of localized pgs
epoch_t last_change; /// most recent epoch changed, exclusing snapshot changes
snapid_t snap_seq; /// seq for per-pool snapshot
epoch_t snap_epoch; /// osdmap epoch of last snap
*/
interval_set<snapid_t> removed_snaps;
- int pg_num_mask, pgp_num_mask, lpg_num_mask, lpgp_num_mask;
+ int pg_num_mask, pgp_num_mask;
pg_pool_t()
: flags(0), type(0), size(0), crush_ruleset(0), object_hash(0),
- pg_num(0), pgp_num(0), lpg_num(0), lpgp_num(0),
+ pg_num(0), pgp_num(0),
last_change(0),
snap_seq(0), snap_epoch(0),
auid(0),
crash_replay_interval(0),
- pg_num_mask(0), pgp_num_mask(0), lpg_num_mask(0), lpgp_num_mask(0) { }
+ pg_num_mask(0), pgp_num_mask(0) { }
void dump(Formatter *f) const;
unsigned get_pg_num() const { return pg_num; }
unsigned get_pgp_num() const { return pgp_num; }
- unsigned get_lpg_num() const { return lpg_num; }
- unsigned get_lpgp_num() const { return lpgp_num; }
unsigned get_pg_num_mask() const { return pg_num_mask; }
unsigned get_pgp_num_mask() const { return pgp_num_mask; }
- unsigned get_lpg_num_mask() const { return lpg_num_mask; }
- unsigned get_lpgp_num_mask() const { return lpgp_num_mask; }
static int calc_bits_of(int t);
void calc_pg_masks();