From: xie xingguo Date: Tue, 19 Sep 2017 10:29:44 +0000 (+0800) Subject: osd/PrimaryLogPG: kill add_interval_usage X-Git-Tag: v13.0.1~850^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F17807%2Fhead;p=ceph.git osd/PrimaryLogPG: kill add_interval_usage Use inline size() member of interval_set instead, which is faster and simpler. Signed-off-by: xie xingguo --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 76ea8ac40076..f4099c4043ba 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -7171,7 +7171,7 @@ void PrimaryLogPG::make_writeable(OpContext *ctx) interval_set &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& s, object_stat_sum_t& delta_stats) -{ - for (interval_set::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 &to_disconnect) diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index 18cfb49a4106..0256548474c9 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -1106,8 +1106,6 @@ protected: void write_update_size_and_usage(object_stat_sum_t& stats, object_info_t& oi, interval_set& modified, uint64_t offset, uint64_t length, bool write_full=false); - void add_interval_usage(interval_set& s, object_stat_sum_t& st); - enum class cache_result_t { NOOP,