]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: simplify pgid translation
authorSage Weil <sage@redhat.com>
Fri, 10 Feb 2017 04:03:10 +0000 (23:03 -0500)
committerSage Weil <sage@redhat.com>
Tue, 14 Feb 2017 04:03:52 +0000 (23:03 -0500)
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 <sage@redhat.com>
src/osdc/Objecter.cc

index 2567b990894050917de3311abd0384188fa91c6f..b7c11e30b8732a1f7b5090966ad0b9fcd5b19386 100644 (file)
@@ -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);