From: Samuel Just Date: Fri, 8 Nov 2013 20:41:08 +0000 (-0800) Subject: OSD::_share_map_incoming: pass osdmap in explicitly X-Git-Tag: v0.81~57^2~27 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=812c67236d517f6410bb62348a731b07ca7a912f;p=ceph.git OSD::_share_map_incoming: pass osdmap in explicitly 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 Reviewed-by: Greg Farnum --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 50b077f1c11..760ba073b53 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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(m->get_connection()->get_priv())); + _share_map_incoming( + m->get_source(), + m->get_connection().get(), + m->get_map_epoch(), + osdmap, + static_cast(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(m->get_connection()->get_priv())); + _share_map_incoming( + m->get_source(), m->get_connection().get(), m->map_epoch, + osdmap, + static_cast(m->get_connection()->get_priv())); // make sure we have the pg const spg_t pgid = m->pgid; diff --git a/src/osd/OSD.h b/src/osd/OSD.h index b09d8a795d9..25a24e7fc60 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -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());