From e9dbe483fa54850f43015fc9f8458cade4c5ae44 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 9 Feb 2017 23:03:10 -0500 Subject: [PATCH] osdc/Objecter: simplify pgid translation All callers now pass in an explicit pgid, including pg listing. Since we resend ops on split, there is not need to do any translation here, even for the jewel and kraken osds that can handle a full hash value. Signed-off-by: Sage Weil --- src/osdc/Objecter.cc | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 2567b990894..b7c11e30b87 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -2704,21 +2704,8 @@ int Objecter::_calc_target(op_target_t *t, Connection *con, bool any_change) pg_t pgid; if (t->precalc_pgid) { assert(t->base_oid.name.empty()); // make sure this is a listing op - ldout(cct, 10) << __func__ << " have " << t->base_pgid << " pool " - << osdmap->have_pg_pool(t->base_pgid.pool()) << dendl; - if (!osdmap->have_pg_pool(t->base_pgid.pool())) { - t->osd = -1; - return RECALC_OP_TARGET_POOL_DNE; - } - if (osdmap->test_flag(CEPH_OSDMAP_SORTBITWISE)) { - // if the SORTBITWISE flag is set, we know all OSDs are running - // jewel+. - pgid = t->base_pgid; - } else { - // legacy behavior. pre-jewel OSDs will fail if we send a - // full-hash pgid value. - pgid = osdmap->raw_pg_to_pg(t->base_pgid); - } + assert(t->base_oloc.pool == (int64_t)t->base_pgid.pool()); + pgid = t->base_pgid; } else { int ret = osdmap->object_locator_to_pg(t->target_oid, t->target_oloc, pgid); -- 2.39.5