From: Sage Weil Date: Fri, 19 Oct 2012 16:11:55 +0000 (-0700) Subject: mds: use const ref instead of large pass-by-value X-Git-Tag: v0.55~230^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cc8b9e2bc55893bd5b938443f36dbe5d9912567f;p=ceph.git mds: use const ref instead of large pass-by-value CID 717033 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE) Passing parameter inst of type entity_inst_t (size 152 bytes) by value. CID 717034 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE) Passing parameter inst of type entity_inst_t (size 152 bytes) by value. CID 717032 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE) Passing parameter i of type entity_inst_t (size 152 bytes) by value. Signed-off-by: Sage Weil --- diff --git a/src/mds/SessionMap.h b/src/mds/SessionMap.h index 4735fed4a097..759454b1873c 100644 --- a/src/mds/SessionMap.h +++ b/src/mds/SessionMap.h @@ -276,7 +276,7 @@ public: return session_map[w]; return 0; } - Session* get_or_add_session(entity_inst_t i) { + Session* get_or_add_session(const entity_inst_t& i) { Session *s; if (session_map.count(i.name)) s = session_map[i.name]; diff --git a/src/mds/events/ESession.h b/src/mds/events/ESession.h index e68e2ef3462c..1580d1234f91 100644 --- a/src/mds/events/ESession.h +++ b/src/mds/events/ESession.h @@ -31,14 +31,14 @@ class ESession : public LogEvent { public: ESession() : LogEvent(EVENT_SESSION) { } - ESession(entity_inst_t inst, bool o, version_t v) : + ESession(const entity_inst_t& inst, bool o, version_t v) : LogEvent(EVENT_SESSION), client_inst(inst), open(o), cmapv(v), inotablev(0) { } - ESession(entity_inst_t inst, bool o, version_t v, + ESession(const entity_inst_t& inst, bool o, version_t v, const interval_set& i, version_t iv) : LogEvent(EVENT_SESSION), client_inst(inst),