From: Sage Weil Date: Fri, 10 Feb 2017 04:03:10 +0000 (-0500) Subject: osdc/Objecter: simplify pgid translation X-Git-Tag: v12.0.1~383^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e9dbe483fa54850f43015fc9f8458cade4c5ae44;p=ceph.git 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 --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 2567b9908940..b7c11e30b873 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);