From 5b3c5bbf49c02c11de620e0f6e8753ada86b0a83 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Sat, 3 Feb 2018 17:12:48 +0100 Subject: [PATCH] osd: remove the PGLog::prefix_provider as it's always nullptr. Signed-off-by: Radoslaw Zarzynski --- src/osd/PGLog.h | 9 +++------ src/test/osd/TestPGLog.cc | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h index 372fd9e3044..73c58499b69 100644 --- a/src/osd/PGLog.h +++ b/src/osd/PGLog.h @@ -34,13 +34,11 @@ constexpr auto PGLOG_INDEXED_ALL = PGLOG_INDEXED_OBJECTS class CephContext; struct PGLog : DoutPrefixProvider { - DoutPrefixProvider *prefix_provider; string gen_prefix() const override { - return prefix_provider ? prefix_provider->gen_prefix() : ""; + return ""; } unsigned get_subsys() const override { - return prefix_provider ? prefix_provider->get_subsys() : - (unsigned)ceph_subsys_osd; + return static_cast(ceph_subsys_osd); } CephContext *get_cct() const override { return cct; @@ -646,8 +644,7 @@ protected: public: // cppcheck-suppress noExplicitConstructor - PGLog(CephContext *cct, DoutPrefixProvider *dpp = nullptr) : - prefix_provider(dpp), + PGLog(CephContext *cct) : dirty_from(eversion_t::max()), writeout_from(eversion_t::max()), dirty_from_dups(eversion_t::max()), diff --git a/src/test/osd/TestPGLog.cc b/src/test/osd/TestPGLog.cc index f26af817da5..704bbb52a0f 100644 --- a/src/test/osd/TestPGLog.cc +++ b/src/test/osd/TestPGLog.cc @@ -2294,7 +2294,7 @@ TEST_F(PGLogTest, split_into_preserves_may_include_deletes) { { rebuilt_missing_with_deletes = false; missing.may_include_deletes = true; - PGLog child_log(cct, prefix_provider); + PGLog child_log(cct); pg_t child_pg; split_into(child_pg, 6, &child_log); ASSERT_TRUE(child_log.get_missing().may_include_deletes); @@ -2304,7 +2304,7 @@ TEST_F(PGLogTest, split_into_preserves_may_include_deletes) { { rebuilt_missing_with_deletes = false; missing.may_include_deletes = false; - PGLog child_log(cct, prefix_provider); + PGLog child_log(cct); pg_t child_pg; split_into(child_pg, 6, &child_log); ASSERT_FALSE(child_log.get_missing().may_include_deletes); -- 2.39.5