We used approx_size() because std::list::size() used to be O(n) instead of O(1),
but it is constant now in C++11.
Also counting the precise number of current log entries here is much more
meaningful.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
PG_STATE_BACKFILL_TOOFULL))
return;
- if (pg_log.get_log().approx_size() <
+ if (pg_log.get_log().log.size() <
cct->_conf->osd_max_pg_log_entries *
cct->_conf->osd_force_recovery_pg_log_entries_factor)
return;
return head.version == 0 && head.epoch == 0;
}
- size_t approx_size() const {
- return head.version - tail.version;
- }
-
static void filter_log(spg_t import_pgid, const OSDMap &curmap,
const string &hit_set_namespace, const pg_log_t &in,
pg_log_t &out, pg_log_t &reject);