From 7908142647c3c4681984fe973d2d50ac0b56b699 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 15 Sep 2017 22:58:15 -0400 Subject: [PATCH] osd/PG: add dump_pgstate_history() to public interface Signed-off-by: Sage Weil --- src/osd/OSD.cc | 4 +--- src/osd/PG.cc | 7 +++++++ src/osd/PG.h | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index de97baf1a43..9a4143943b6 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2238,9 +2238,7 @@ will start to track new ops received afterwards."; PG *pg = it->second; f->dump_stream("pg") << pg->pg_id; - pg->lock(); - pg->pgstate_history.dump(f); - pg->unlock(); + pg->dump_pgstate_history(f); } f->close_section(); } else if (admin_command == "compact") { diff --git a/src/osd/PG.cc b/src/osd/PG.cc index f04e5c39fdc..56d055a077a 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -8134,3 +8134,10 @@ ostream& operator<<(ostream& out, const PG::BackfillInterval& bi) out << ")"; return out; } + +void PG::dump_pgstate_history(Formatter *f) +{ + lock(); + pgstate_history.dump(f); + unlock(); +} diff --git a/src/osd/PG.h b/src/osd/PG.h index 391061cccc8..28f3739a576 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -382,6 +382,8 @@ public: virtual void get_watchers(std::list *ls) = 0; + void dump_pgstate_history(Formatter *f); + virtual void do_request( OpRequestRef& op, ThreadPool::TPHandle &handle -- 2.39.5