From 3a93bc2d43758edf5557e638fa08216916115ced Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 3 Oct 2020 18:53:23 +0800 Subject: [PATCH] crimson/osd: mark dump_detail() private Blocker::dump_detail() is called by Blocker::dump(), the latter is a member of Blocker. so there is no need to mark dump_detail() protected or public to grant the access Blocker::dump() the access to this method. Signed-off-by: Kefu Chai --- src/crimson/osd/osd_operation.h | 25 ++++++++++++------------- src/crimson/osd/osdmap_gate.h | 1 + 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/crimson/osd/osd_operation.h b/src/crimson/osd/osd_operation.h index 94a12dc75cd..35f997ba9fa 100644 --- a/src/crimson/osd/osd_operation.h +++ b/src/crimson/osd/osd_operation.h @@ -118,40 +118,37 @@ make_exception_blocking_future(Exception&& e) { * why a particular op is not making progress. */ class Blocker { -protected: - virtual void dump_detail(ceph::Formatter *f) const = 0; - public: template blocking_future make_blocking_future(seastar::future &&f) { return blocking_future(this, std::move(f)); } - void dump(ceph::Formatter *f) const; + virtual ~Blocker() = default; +private: + virtual void dump_detail(ceph::Formatter *f) const = 0; virtual const char *get_type_name() const = 0; - - virtual ~Blocker() = default; }; template class BlockerT : public Blocker { public: + virtual ~BlockerT() = default; +private: const char *get_type_name() const final { return T::type_name; } - - virtual ~BlockerT() = default; }; class AggregateBlocker : public BlockerT { vector parent_blockers; -protected: - void dump_detail(ceph::Formatter *f) const final; public: AggregateBlocker(vector &&parent_blockers) : parent_blockers(std::move(parent_blockers)) {} static constexpr const char *type_name = "AggregateBlocker"; +private: + void dump_detail(ceph::Formatter *f) const final; }; template @@ -352,11 +349,13 @@ public: return seastar::make_ready_future<>(); }); } -protected: + +private: void dump_detail(Formatter *f) const final; const char *get_type_name() const final { return "OperationThrottler"; } + private: crimson::osd::scheduler::SchedulerRef scheduler; @@ -381,8 +380,8 @@ private: * the op ordering is preserved. */ class OrderedPipelinePhase : public Blocker { -protected: - virtual void dump_detail(ceph::Formatter *f) const final; +private: + void dump_detail(ceph::Formatter *f) const final; const char *get_type_name() const final { return name; } diff --git a/src/crimson/osd/osdmap_gate.h b/src/crimson/osd/osdmap_gate.h index 15e3d2057ab..2b73d8959d1 100644 --- a/src/crimson/osd/osdmap_gate.h +++ b/src/crimson/osd/osdmap_gate.h @@ -37,6 +37,7 @@ class OSDMapGate { seastar::shared_promise promise; void dump_detail(Formatter *f) const final; + private: const char *get_type_name() const final { return type_name; } -- 2.47.3