]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: direct enumerate request at hash, not pg
authorSage Weil <sage@redhat.com>
Mon, 17 Aug 2015 18:53:37 +0000 (14:53 -0400)
committerJohn Spray <john.spray@redhat.com>
Thu, 3 Dec 2015 14:57:39 +0000 (14:57 +0000)
The existing request machinery already maps the hash to a pg; use
it.  Among other things, it means that a split will make us
recalculate and resend using existing code paths.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osdc/Objecter.cc

index 852ec6ab0ed2f50905b378a7f8c8ec1d1c2df4e5..cbf4e685d3e4d8ee9496466f37b4a7604a6efc37 100644 (file)
@@ -4778,7 +4778,6 @@ void Objecter::enumerate_objects(
     return;
   }
 
-  // Map `start` to a PG
   rwlock.get_read();
   assert(osdmap->get_epoch());
   if (!osdmap->test_flag(CEPH_OSDMAP_SORTBITWISE)) {
@@ -4788,19 +4787,16 @@ void Objecter::enumerate_objects(
     return;
   }
   const pg_pool_t *p = osdmap->get_pg_pool(pool_id);
-  int pg_num;
   if (!p) {
     lderr(cct) << __func__ << ": pool " << pool_id << " DNE in"
                      "osd epoch " << osdmap->get_epoch() << dendl;
     rwlock.unlock();
     on_finish->complete(-ENOENT);
   } else {
-    pg_num = p->raw_hash_to_pg(start.get_hash());
     rwlock.unlock();
   }
 
-  ldout(cct, 20) << __func__ << ": start=" << start << " end=" << end
-                << " to pg " << pg_num << dendl;
+  ldout(cct, 20) << __func__ << ": start=" << start << " end=" << end << dendl;
 
   // Stash completion state
   C_EnumerateReply *on_ack = new C_EnumerateReply(
@@ -4814,7 +4810,7 @@ void Objecter::enumerate_objects(
 
   // Issue.  See you later in _enumerate_reply
   object_locator_t oloc(pool_id, ns);
-  pg_read(pg_num, oloc, op,
+  pg_read(start.get_hash(), oloc, op,
          &on_ack->bl, 0, on_ack, &on_ack->epoch, &on_ack->budget);
 }