]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd/rwl: correct m_perfcounter access scope 35228/head
authorChangcheng Liu <changcheng.liu@aliyun.com>
Mon, 25 May 2020 08:54:27 +0000 (16:54 +0800)
committerChangcheng Liu <changcheng.liu@aliyun.com>
Mon, 25 May 2020 13:49:18 +0000 (21:49 +0800)
There's no m_perfcounter in SyncPoint. Its scope is in
ReplicatedWriteLog.

Signed-off-by: Changcheng Liu <changcheng.liu@intel.com>
src/librbd/cache/ReplicatedWriteLog.cc
src/librbd/cache/rwl/SyncPoint.cc

index 8e27c8d9ca09976ffb3af54e5ca37cb23480b083..bc12af60dfa560f98ad946987a39375e371d56d3 100644 (file)
@@ -2385,6 +2385,9 @@ void ReplicatedWriteLog<I>::new_sync_point(DeferredContexts &later) {
    * nullptr, but m_current_sync_gen may not be zero. */
   if (old_sync_point) {
     new_sync_point->setup_earlier_sync_point(old_sync_point, m_last_op_sequence_num);
+    m_perfcounter->hinc(l_librbd_rwl_syncpoint_hist,
+                        old_sync_point->log_entry->writes,
+                        old_sync_point->log_entry->bytes);
     /* This sync point will acquire no more sub-ops. Activation needs
      * to acquire m_lock, so defer to later*/
     later.add(new LambdaContext(
index 19126acd664423ee7256f654cdc4f40b8cf71c25..cb3f3cfeebd917de9e7c4a05125a6cd9f90bd7af 100644 (file)
@@ -93,8 +93,6 @@ void SyncPoint::add_in_on_appending_ctxs(Context* ctx) {
 
 void SyncPoint::setup_earlier_sync_point(std::shared_ptr<SyncPoint> sync_point,
                                          uint64_t last_op_sequence_num) {
-    m_perfcounter->inc(l_librbd_rwl_syncpoint_hist,
-                       sync_point->log_entry->writes, sync_point->log_entry->bytes);
     earlier_sync_point = sync_point;
     log_entry->prior_sync_point_flushed = false;
     earlier_sync_point->log_entry->next_sync_point_entry = log_entry;