From: Sage Weil Date: Mon, 1 Oct 2012 03:45:15 +0000 (-0700) Subject: mon: fix large pass by value X-Git-Tag: v0.54~149 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ef393b5074e331e1593f68c572f4fdcbce8f2ff1;p=ceph.git mon: fix large pass by value CID 717046: Big parameter passed by value (PASS_BY_VALUE) At (1): Passing parameter i of type entity_inst_t (size 152 bytes) by value. CID 717047: Big parameter passed by value (PASS_BY_VALUE) At (1): Passing parameter i of type entity_inst_t (size 152 bytes) by value. Signed-off-by: Sage Weil --- diff --git a/src/mon/Session.h b/src/mon/Session.h index 0aa8a777fa8e..685fc8e8fac4 100644 --- a/src/mon/Session.h +++ b/src/mon/Session.h @@ -55,7 +55,7 @@ struct MonSession : public RefCountedObject { Connection *proxy_con; uint64_t proxy_tid; - MonSession(entity_inst_t i, Connection *c) : + MonSession(const entity_inst_t& i, Connection *c) : con(c->get()), inst(i), closed(false), item(this), global_id(0), notified_global_id(0), auth_handler(NULL), proxy_con(NULL), proxy_tid(0) { @@ -101,7 +101,7 @@ struct MonSessionMap { s->put(); } - MonSession *new_session(entity_inst_t i, Connection *c) { + MonSession *new_session(const entity_inst_t& i, Connection *c) { MonSession *s = new MonSession(i, c); sessions.push_back(&s->item); if (i.name.is_osd())