]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: use const ref instead of large pass-by-value
authorSage Weil <sage@inktank.com>
Fri, 19 Oct 2012 16:11:55 +0000 (09:11 -0700)
committerSage Weil <sage@inktank.com>
Fri, 19 Oct 2012 16:11:55 +0000 (09:11 -0700)
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 <sage@inktank.com>
src/mds/SessionMap.h
src/mds/events/ESession.h

index 4735fed4a097bfa974b76fd437595b22b7f1a506..759454b1873c91d71e60dff2c34084236a908c27 100644 (file)
@@ -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];
index e68e2ef3462c062fc04199220a759cb2c476dac9..1580d1234f91d89bdf262aae6abf78a9de7e75a5 100644 (file)
@@ -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<inodeno_t>& i, version_t iv) :
     LogEvent(EVENT_SESSION),
     client_inst(inst),