From: Sage Weil Date: Mon, 20 Feb 2017 19:20:18 +0000 (-0500) Subject: osd/PrimaryLogPG: non-const helpers where possible X-Git-Tag: v12.0.1~279^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=854eee20e8fe52415fda7ecf4ec419486ab28c2c;p=ceph.git osd/PrimaryLogPG: non-const helpers where possible Signed-off-by: Sage Weil --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 2ed79b3f3e5..2709c602a24 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -8861,9 +8861,10 @@ ObjectContextRef PrimaryLogPG::create_object_context(const object_info_t& oi, return obc; } -ObjectContextRef PrimaryLogPG::get_object_context(const hobject_t& soid, - bool can_create, - map *attrs) +ObjectContextRef PrimaryLogPG::get_object_context( + const hobject_t& soid, + bool can_create, + const map *attrs) { assert( attrs || !pg_log.get_missing().is_missing(soid) || @@ -9280,7 +9281,7 @@ void PrimaryLogPG::kick_object_context_blocked(ObjectContextRef obc) SnapSetContext *PrimaryLogPG::get_snapset_context( const hobject_t& oid, bool can_create, - map *attrs, + const map *attrs, bool oid_existed) { Mutex::Locker l(snapset_contexts_lock); diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index eb49cef3d71..f48c1610c8e 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -337,7 +337,7 @@ public: ObjectContextRef get_obc( const hobject_t &hoid, - map &attrs) override { + const map &attrs) override { return get_object_context(hoid, true, &attrs); } @@ -370,7 +370,7 @@ public: void log_operation( const vector &logv, - boost::optional &hset_history, + const boost::optional &hset_history, const eversion_t &trim_to, const eversion_t &roll_forward_to, bool transaction_applied, @@ -952,7 +952,7 @@ protected: ObjectContextRef get_object_context( const hobject_t& soid, bool can_create, - map *attrs = 0 + const map *attrs = 0 ); void context_registry_on_change(); @@ -972,7 +972,7 @@ protected: SnapSetContext *get_snapset_context( const hobject_t& oid, bool can_create, - map *attrs = 0, + const map *attrs = 0, bool oid_existed = true //indicate this oid whether exsited in backend ); void register_snapset_context(SnapSetContext *ssc) {