From: Kefu Chai Date: Thu, 12 Feb 2015 02:32:34 +0000 (+0800) Subject: osd/OpRequest: pass string by const& X-Git-Tag: v0.93~49^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F3713%2Fhead;p=ceph.git osd/OpRequest: pass string by const& Signed-off-by: Kefu Chai --- diff --git a/src/osd/OpRequest.cc b/src/osd/OpRequest.cc index c455c7cde2a..12963342feb 100644 --- a/src/osd/OpRequest.cc +++ b/src/osd/OpRequest.cc @@ -119,7 +119,7 @@ void OpRequest::set_pg_op() { set_rmw_flags(CEPH_OSD_RMW_FLAG_PGOP); } void OpRequest::set_cache() { set_rmw_flags(CEPH_OSD_RMW_FLAG_CACHE); } void OpRequest::set_promote() { set_rmw_flags(CEPH_OSD_RMW_FLAG_PROMOTE); } -void OpRequest::mark_flag_point(uint8_t flag, string s) { +void OpRequest::mark_flag_point(uint8_t flag, const string& s) { #ifdef WITH_LTTNG uint8_t old_flags = hit_flag_points; #endif diff --git a/src/osd/OpRequest.h b/src/osd/OpRequest.h index 1835563470f..88a2704d5fa 100644 --- a/src/osd/OpRequest.h +++ b/src/osd/OpRequest.h @@ -138,13 +138,13 @@ public: void mark_reached_pg() { mark_flag_point(flag_reached_pg, "reached_pg"); } - void mark_delayed(string s) { + void mark_delayed(const string& s) { mark_flag_point(flag_delayed, s); } void mark_started() { mark_flag_point(flag_started, "started"); } - void mark_sub_op_sent(string s) { + void mark_sub_op_sent(const string& s) { mark_flag_point(flag_sub_op_sent, s); } void mark_commit_sent() { @@ -166,7 +166,7 @@ public: private: void set_rmw_flags(int flags); - void mark_flag_point(uint8_t flag, string s); + void mark_flag_point(uint8_t flag, const string& s); }; typedef OpRequest::Ref OpRequestRef;