From: Patrick Donnelly Date: Fri, 4 Nov 2022 01:43:10 +0000 (-0400) Subject: mds: use base Context class for generalization X-Git-Tag: v19.0.0~760^2~22 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dbcd3688840c0e7d1b5fb3d98d0df6931fb5dbf3;p=ceph.git mds: use base Context class for generalization No reason to specialize to MDSContext. Signed-off-by: Patrick Donnelly --- diff --git a/src/mds/MDLog.cc b/src/mds/MDLog.cc index b870ce0398cd0..024b564c151d9 100644 --- a/src/mds/MDLog.cc +++ b/src/mds/MDLog.cc @@ -350,7 +350,7 @@ class C_MDL_Flushed : public MDSLogContextBase { protected: MDLog *mdlog; MDSRank *get_mds() override {return mdlog->mds;} - MDSContext *wrapped; + Context *wrapped; void finish(int r) override { if (wrapped) @@ -358,7 +358,7 @@ protected: } public: - C_MDL_Flushed(MDLog *m, MDSContext *w) + C_MDL_Flushed(MDLog *m, Context *w) : mdlog(m), wrapped(w) {} C_MDL_Flushed(MDLog *m, uint64_t wp) : mdlog(m), wrapped(NULL) { set_write_pos(wp); @@ -434,8 +434,7 @@ void MDLog::_submit_thread() delete le; } else { if (data.fin) { - MDSContext* fin = - dynamic_cast(data.fin); + Context* fin = dynamic_cast(data.fin); ceph_assert(fin); C_MDL_Flushed *fin2 = new C_MDL_Flushed(this, fin); fin2->set_write_pos(journaler->get_write_pos()); @@ -453,7 +452,7 @@ void MDLog::_submit_thread() } } -void MDLog::wait_for_safe(MDSContext *c) +void MDLog::wait_for_safe(Context* c) { submit_mutex.lock(); diff --git a/src/mds/MDLog.h b/src/mds/MDLog.h index 5967cd57b501f..eb15e08f5f28c 100644 --- a/src/mds/MDLog.h +++ b/src/mds/MDLog.h @@ -156,7 +156,7 @@ public: } bool entry_is_open() const { return cur_event != NULL; } - void wait_for_safe( MDSContext *c ); + void wait_for_safe(Context* c); void flush(); bool is_flushed() const { return unflushed == 0; @@ -184,9 +184,9 @@ public: protected: struct PendingEvent { - PendingEvent(LogEvent *e, MDSContext *c, bool f=false) : le(e), fin(c), flush(f) {} + PendingEvent(LogEvent *e, Context* c, bool f=false) : le(e), fin(c), flush(f) {} LogEvent *le; - MDSContext *fin; + Context* fin; bool flush; }; diff --git a/src/mds/MDSContext.h b/src/mds/MDSContext.h index 319af50d35426..66faef1cbebd0 100644 --- a/src/mds/MDSContext.h +++ b/src/mds/MDSContext.h @@ -181,13 +181,13 @@ class C_IO_Wrapper : public MDSIOContext { protected: bool async; - MDSContext *wrapped; + Context *wrapped; void finish(int r) override { wrapped->complete(r); wrapped = nullptr; } public: - C_IO_Wrapper(MDSRank *mds_, MDSContext *wrapped_) : + C_IO_Wrapper(MDSRank *mds_, Context *wrapped_) : MDSIOContext(mds_), async(true), wrapped(wrapped_) { ceph_assert(wrapped != NULL); }