return mds;
}
+MDS *MDSInternalContextWrapper::get_mds()
+{
+ return mds;
+}
+
+void MDSInternalContextWrapper::finish(int r)
+{
+ fin->complete(r);
+}
+
void MDSIOContextBase::complete(int r) {
MDS *mds = get_mds();
return mds;
}
+MDS *MDSIOContextWrapper::get_mds() {
+ return mds;
+}
+
+void MDSIOContextWrapper::finish(int r)
+{
+ fin->complete(r);
+}
+
MDS *MDSInternalContextGather::get_mds()
{
derr << "Forbidden call to MDSInternalContextGather::get_mds by " << typeid(*this).name() << dendl;
}
};
+/**
+ * Wrap a regular Context up as an Internal context. Useful
+ * if you're trying to work with one of our more generic frameworks.
+ */
+class MDSInternalContextWrapper : public MDSInternalContextBase
+{
+protected:
+ MDS *mds;
+ Context *fin;
+ MDS *get_mds();
+public:
+ MDSInternalContextWrapper(MDS *m, Context *c) : mds(m), fin(c) {}
+ void finish(int r);
+};
class MDSIOContextBase : public MDSContext
{
}
};
+/**
+ * Wrap a regular Context up as an IO Context. Useful
+ * if you're trying to work with one of our more generic frameworks.
+ */
+class MDSIOContextWrapper : public MDSIOContextBase
+{
+protected:
+ MDS *mds;
+ Context *fin;
+ MDS *get_mds();
+public:
+ MDSIOContextWrapper(MDS *m, Context *c) : mds(m), fin(c) {}
+ void finish(int r);
+};
/**
* No-op for callers expecting MDSInternalContextBase