]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: rename must_delay_request to op_must_wait_for_map, make static
authorSamuel Just <sam.just@inktank.com>
Wed, 8 May 2013 23:02:24 +0000 (16:02 -0700)
committerSamuel Just <sam.just@inktank.com>
Thu, 9 May 2013 02:47:32 +0000 (19:47 -0700)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.cc
src/osd/PG.h

index a7083728404fb218a27e38f52a332811ca45b5d4..208d6cc21069292ddb425a814a49155607f5d2f5 100644 (file)
@@ -1757,7 +1757,7 @@ void PG::do_request(OpRequestRef op)
     osd->reply_op_error(op, -EPERM);
     return;
   }
-  if (must_delay_request(op)) {
+  if (op_must_wait_for_map(get_osdmap(), op)) {
     dout(20) << " waiting for map on " << op << dendl;
     waiting_for_map.push_back(op);
     return;
@@ -5361,27 +5361,32 @@ bool PG::split_request(OpRequestRef op, unsigned match, unsigned bits)
   return false;
 }
 
-bool PG::must_delay_request(OpRequestRef op)
+bool PG::op_must_wait_for_map(OSDMapRef curmap, OpRequestRef op)
 {
   switch (op->request->get_type()) {
   case CEPH_MSG_OSD_OP:
     return !have_same_or_newer_map(
+      curmap,
       static_cast<MOSDOp*>(op->request)->get_map_epoch());
 
   case MSG_OSD_SUBOP:
     return !have_same_or_newer_map(
+      curmap,
       static_cast<MOSDSubOp*>(op->request)->map_epoch);
 
   case MSG_OSD_SUBOPREPLY:
     return !have_same_or_newer_map(
+      curmap,
       static_cast<MOSDSubOpReply*>(op->request)->map_epoch);
 
   case MSG_OSD_PG_SCAN:
     return !have_same_or_newer_map(
+      curmap,
       static_cast<MOSDPGScan*>(op->request)->map_epoch);
 
   case MSG_OSD_PG_BACKFILL:
     return !have_same_or_newer_map(
+      curmap,
       static_cast<MOSDPGBackfill*>(op->request)->map_epoch);
   }
   assert(0);
index 686b31e343ce2a8618e738a332a4870873b23808..1a4767b29f4d7bfc5645775e13bc1663bf9cefac 100644 (file)
@@ -1932,7 +1932,7 @@ public:
   bool can_discard_backfill(OpRequestRef op);
   bool can_discard_request(OpRequestRef op);
 
-  bool must_delay_request(OpRequestRef op);
+  static bool op_must_wait_for_map(OSDMapRef curmap, OpRequestRef op);
 
   static bool split_request(OpRequestRef op, unsigned match, unsigned bits);
 
@@ -1940,6 +1940,9 @@ public:
   bool old_peering_evt(CephPeeringEvtRef evt) {
     return old_peering_msg(evt->get_epoch_sent(), evt->get_epoch_requested());
   }
+  static bool have_same_or_newer_map(OSDMapRef osdmap, epoch_t e) {
+    return e <= osdmap->get_epoch();
+  }
   bool have_same_or_newer_map(epoch_t e) {
     return e <= get_osdmap()->get_epoch();
   }