]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG: kill add_interval_usage 17807/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 19 Sep 2017 10:29:44 +0000 (18:29 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 19 Sep 2017 10:29:44 +0000 (18:29 +0800)
Use inline size() member of interval_set instead, which is faster and simpler.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h

index 76ea8ac40076bf7be40eab6ce5776fd3fdca8de8..f4099c4043ba650f5f1ab73de41d07d837220d99 100644 (file)
@@ -7171,7 +7171,7 @@ void PrimaryLogPG::make_writeable(OpContext *ctx)
       interval_set<uint64_t> &newest_overlap = ctx->new_snapset.clone_overlap.rbegin()->second;
       ctx->modified_ranges.intersection_of(newest_overlap);
       // modified_ranges is still in use by the clone
-      add_interval_usage(ctx->modified_ranges, ctx->delta_stats);
+      ctx->delta_stats.num_bytes += ctx->modified_ranges.size();
       newest_overlap.subtract(ctx->modified_ranges);
     }
   }
@@ -7212,13 +7212,6 @@ void PrimaryLogPG::write_update_size_and_usage(object_stat_sum_t& delta_stats, o
   delta_stats.num_wr_kb += SHIFT_ROUND_UP(length, 10);
 }
 
-void PrimaryLogPG::add_interval_usage(interval_set<uint64_t>& s, object_stat_sum_t& delta_stats)
-{
-  for (interval_set<uint64_t>::const_iterator p = s.begin(); p != s.end(); ++p) {
-    delta_stats.num_bytes += p.get_len();
-  }
-}
-
 void PrimaryLogPG::complete_disconnect_watches(
   ObjectContextRef obc,
   const list<watch_disconnect_t> &to_disconnect)
index 18cfb49a41062595dc71156287d7400c27bc5bca..0256548474c9b20ebea7d4d3e362d0f59d4525d3 100644 (file)
@@ -1106,8 +1106,6 @@ protected:
   void write_update_size_and_usage(object_stat_sum_t& stats, object_info_t& oi,
                                   interval_set<uint64_t>& modified, uint64_t offset,
                                   uint64_t length, bool write_full=false);
-  void add_interval_usage(interval_set<uint64_t>& s, object_stat_sum_t& st);
-
 
   enum class cache_result_t {
     NOOP,