]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD::_share_map_incoming: pass osdmap in explicitly
authorSamuel Just <sam.just@inktank.com>
Fri, 8 Nov 2013 20:41:08 +0000 (12:41 -0800)
committerGreg Farnum <greg@inktank.com>
Mon, 5 May 2014 22:29:17 +0000 (15:29 -0700)
We'll want to be able to use this method without the osd_lock. Note
that we can't do so yet -- we call send_incremental_map, which is not
safe to call unlocked.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/osd/OSD.cc
src/osd/OSD.h

index 50b077f1c11025abda04297f7027b0e31038bab9..760ba073b53e9b41ae1797a98cdbaebfec8ea9c2 100644 (file)
@@ -4638,7 +4638,12 @@ void OSD::forget_peer_epoch(int peer, epoch_t as_of)
 }
 
 
-bool OSD::_share_map_incoming(entity_name_t name, Connection *con, epoch_t epoch, Session* session)
+bool OSD::_share_map_incoming(
+  entity_name_t name,
+  Connection *con,
+  epoch_t epoch,
+  OSDMapRef osdmap,
+  Session* session)
 {
   bool shared = false;
   dout(20) << "_share_map_incoming "
@@ -7401,9 +7406,14 @@ void OSD::handle_op(OpRequestRef op, OSDMapRef osdmap)
     service.reply_op_error(op, -EBLACKLISTED);
     return;
   }
+
   // share our map with sender, if they're old
-  _share_map_incoming(m->get_source(), m->get_connection().get(), m->get_map_epoch(),
-                     static_cast<Session *>(m->get_connection()->get_priv()));
+  _share_map_incoming(
+    m->get_source(),
+    m->get_connection().get(),
+    m->get_map_epoch(),
+    osdmap,
+    static_cast<Session *>(m->get_connection()->get_priv()));
 
   if (op->rmw_flags == 0) {
     int r = init_op_flags(op);
@@ -7536,8 +7546,10 @@ void OSD::handle_replica_op(OpRequestRef op, OSDMapRef osdmap)
     return;
 
   // share our map with sender, if they're old
-  _share_map_incoming(m->get_source(), m->get_connection().get(), m->map_epoch,
-                     static_cast<Session*>(m->get_connection()->get_priv()));
+  _share_map_incoming(
+    m->get_source(), m->get_connection().get(), m->map_epoch,
+    osdmap,
+    static_cast<Session*>(m->get_connection()->get_priv()));
 
   // make sure we have the pg
   const spg_t pgid = m->pgid;
index b09d8a795d985fe3eb8c06dd182987758aa0551d..25a24e7fc60feffb1d751f424048fded644116bf 100644 (file)
@@ -1338,6 +1338,7 @@ private:
   void forget_peer_epoch(int p, epoch_t e);
 
   bool _share_map_incoming(entity_name_t name, Connection *con, epoch_t epoch,
+                          OSDMapRef osdmap,
                           Session *session = 0);
   void _share_map_outgoing(int peer, Connection *con,
                           OSDMapRef map = OSDMapRef());