osd: include pg pool in pg to placement seed mapping

This prevents different pools from overlaying on top of each other.
This commit is contained in:
Sage Weil 2009-06-16 15:07:26 -07:00
parent cb719ac3eb
commit bc7d48fff5

View File

@ -528,13 +528,15 @@ struct pg_pool_t {
}
/*
* map raw pg (full precision ps) into a placement ps
* map raw pg (full precision ps) into a placement seed. include
* pool id in that value so that different pools don't use the same
* seeds.
*/
ps_t raw_pg_to_pps(pg_t pg) const {
if (pg.preferred() >= 0 && v.lpgp_num)
return ceph_stable_mod(pg.ps(), v.lpgp_num, lpgp_num_mask);
return ceph_stable_mod(pg.ps() + pg.pool(), v.lpgp_num, lpgp_num_mask);
else
return ceph_stable_mod(pg.ps(), v.pgp_num, pgp_num_mask);
return ceph_stable_mod(pg.ps() + pg.pool(), v.pgp_num, pgp_num_mask);
}
void encode(bufferlist& bl) const {