]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add vector def for MDS contexts
authorPatrick Donnelly <pdonnell@redhat.com>
Sun, 22 Jul 2018 01:15:20 +0000 (18:15 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 25 Jul 2018 23:03:10 +0000 (16:03 -0700)
This will be used as a more allocator-efficient container for lists of
contexts. We don't actually need fast insertion/deletion at any place
in the list. We also don't need to insert at the beginning.

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

index 4e6372110aa75bb434e4c8b44ef5172ff8537baa..29952f9b3dd3edc3f0e04bb3733460599ee072d7 100644 (file)
@@ -16,6 +16,9 @@
 #ifndef MDS_CONTEXT_H
 #define MDS_CONTEXT_H
 
+#include <vector>
+#include <queue>
+
 #include "include/Context.h"
 #include "include/elist.h"
 #include "common/ceph_time.h"
@@ -44,6 +47,14 @@ protected:
 class MDSInternalContextBase : public MDSContext
 {
 public:
+    template<template<typename> class A>
+    using vec_alloc = std::vector<MDSInternalContextBase *, A<MDSInternalContextBase *>>;
+    using vec = vec_alloc<std::allocator>;
+
+    template<template<typename> class A>
+    using que_alloc = std::queue<MDSInternalContextBase *, std::deque<MDSInternalContextBase *, A<MDSInternalContextBase *>>>;
+    using que = que_alloc<std::allocator>;
+
     void complete(int r) override;
 };