From bc7d48fff5ea18b9c97708eb5f570366c1b1e1b4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 16 Jun 2009 15:07:26 -0700 Subject: [PATCH] osd: include pg pool in pg to placement seed mapping This prevents different pools from overlaying on top of each other. --- src/osd/osd_types.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 04cc24f752d..e832a0ff158 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -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 {