From d2f07cc49399b205720e55e3ca88b922db2d2cd4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 21 Oct 2012 15:31:17 -0700 Subject: [PATCH] mon: pass by ref CID 717044: Big parameter passed by value (PASS_BY_VALUE) Passing parameter to of type entity_inst_t (size 152 bytes) by value. CID 717045: Big parameter passed by value (PASS_BY_VALUE) Passing parameter a of type entity_addr_t (size 136 bytes) by value. Signed-off-by: Sage Weil --- src/mon/Monitor.cc | 2 +- src/mon/Monitor.h | 2 +- src/mon/OSDMonitor.cc | 2 +- src/mon/OSDMonitor.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 62650f0d2f4fa..872644cce3811 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -1685,7 +1685,7 @@ void Monitor::handle_forward(MForward *m) m->put(); } -void Monitor::try_send_message(Message *m, entity_inst_t to) +void Monitor::try_send_message(Message *m, const entity_inst_t& to) { dout(10) << "try_send_message " << *m << " to " << to << dendl; diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index 49605fd4aa94d..7476c2c77c603 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -368,7 +368,7 @@ public: void forward_request_leader(PaxosServiceMessage *req); void handle_forward(MForward *m); - void try_send_message(Message *m, entity_inst_t to); + void try_send_message(Message *m, const entity_inst_t& to); void send_reply(PaxosServiceMessage *req, Message *reply); void no_reply(PaxosServiceMessage *req); void resend_routed_requests(); diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 76b6f01957bce..bbc42a0ecc54b 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -1328,7 +1328,7 @@ void OSDMonitor::send_incremental(epoch_t first, entity_inst_t& dest, bool oneti -epoch_t OSDMonitor::blacklist(entity_addr_t a, utime_t until) +epoch_t OSDMonitor::blacklist(const entity_addr_t& a, utime_t until) { dout(10) << "blacklist " << a << " until " << until << dendl; pending_inc.new_blacklist[a] = until; diff --git a/src/mon/OSDMonitor.h b/src/mon/OSDMonitor.h index c58636666b705..4992e7a8a41c2 100644 --- a/src/mon/OSDMonitor.h +++ b/src/mon/OSDMonitor.h @@ -279,7 +279,7 @@ private: send_incremental(m, start); } - epoch_t blacklist(entity_addr_t a, utime_t until); + epoch_t blacklist(const entity_addr_t& a, utime_t until); void dump_info(Formatter *f); -- 2.39.5