From 1fcd3fbdef09b41bc058343cb85bad2ffcb2bc5e Mon Sep 17 00:00:00 2001 From: David Zafman Date: Thu, 26 Mar 2015 15:49:16 -0700 Subject: [PATCH] osd: Create a filter_log for PGLog This could be tested as a way to test pg_log_t::filter_log() Signed-off-by: David Zafman --- src/osd/PGLog.cc | 11 +++++++++++ src/osd/PGLog.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/osd/PGLog.cc b/src/osd/PGLog.cc index f7cdf6ae6bd02..8c02309779649 100644 --- a/src/osd/PGLog.cc +++ b/src/osd/PGLog.cc @@ -45,6 +45,17 @@ void PGLog::IndexedLog::advance_rollback_info_trimmed_to( } } +void PGLog::IndexedLog::filter_log(spg_t pgid, const OSDMap &map, const string &hit_set_namespace) +{ + IndexedLog out; + pg_log_t reject; + + pg_log_t::filter_log(pgid, map, hit_set_namespace, *this, out, reject); + + *this = out; + index(); +} + void PGLog::IndexedLog::split_into( pg_t child_pgid, unsigned split_bits, diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h index ecfd1a1a37171..dcb966b7de93c 100644 --- a/src/osd/PGLog.h +++ b/src/osd/PGLog.h @@ -292,6 +292,8 @@ struct PGLog { set *trimmed); ostream& print(ostream& out) const; + + void filter_log(spg_t pgid, const OSDMap &map, const string &hit_set_namespace); }; -- 2.39.5