summaryrefslogtreecommitdiffstats
path: root/src/mds/MDSContext.h
diff options
context:
space:
mode:
authorGreg Farnum <greg@inktank.com>2014-08-28 02:37:28 +0200
committerGreg Farnum <gfarnum@redhat.com>2014-11-07 20:48:00 +0100
commit80fac9e627362f18136cea3c390e7c1ab9298e66 (patch)
treee55568fd9f7b32ab70d17c51a70157d4f8846e10 /src/mds/MDSContext.h
parentMerge pull request #2707 from ceph/wip-9731 (diff)
downloadceph-80fac9e627362f18136cea3c390e7c1ab9298e66.tar.xz
ceph-80fac9e627362f18136cea3c390e7c1ab9298e66.zip
mds: add an MDSInternalContextWrapper and MDSIOContextWrapper
These let us wrap generic function tooling up inside of the appropriate type-checking, and verify we haven't done anything too stupid. Signed-off-by: Greg Farnum <greg@inktank.com>
Diffstat (limited to 'src/mds/MDSContext.h')
-rw-r--r--src/mds/MDSContext.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mds/MDSContext.h b/src/mds/MDSContext.h
index 9da667403e3..34633093675 100644
--- a/src/mds/MDSContext.h
+++ b/src/mds/MDSContext.h
@@ -60,6 +60,20 @@ public:
}
};
+/**
+ * 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
{
@@ -82,6 +96,20 @@ public:
}
};
+/**
+ * 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