]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: use base Context class for generalization
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 4 Nov 2022 01:43:10 +0000 (21:43 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 1 Aug 2023 15:16:00 +0000 (11:16 -0400)
No reason to specialize to MDSContext.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/MDLog.cc
src/mds/MDLog.h
src/mds/MDSContext.h

index b870ce0398cd03479c10775734cdcdfb984f736e..024b564c151d9db0ce72b30c2bac710f52578215 100644 (file)
@@ -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<MDSContext*>(data.fin);
+       Context* fin = dynamic_cast<Context*>(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();
 
index 5967cd57b501f0e46afa21b5daacadbfc41164d0..eb15e08f5f28cb0446c4c4c354eefc75253374c2 100644 (file)
@@ -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;
   };
 
index 319af50d35426edf29de74df10afa77bdd0e86ce..66faef1cbebd0ab3ae092fddf8ae2fb830274a94 100644 (file)
@@ -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);
   }