From db0e8cf3d7b85331f3a2a35700e19e25eefdf565 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Sat, 21 Jul 2018 18:15:20 -0700 Subject: [PATCH] mds: add vector def for MDS contexts 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 --- src/mds/MDSContext.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/mds/MDSContext.h b/src/mds/MDSContext.h index 4e6372110aa75..29952f9b3dd3e 100644 --- a/src/mds/MDSContext.h +++ b/src/mds/MDSContext.h @@ -16,6 +16,9 @@ #ifndef MDS_CONTEXT_H #define MDS_CONTEXT_H +#include +#include + #include "include/Context.h" #include "include/elist.h" #include "common/ceph_time.h" @@ -44,6 +47,14 @@ protected: class MDSInternalContextBase : public MDSContext { public: + template class A> + using vec_alloc = std::vector>; + using vec = vec_alloc; + + template class A> + using que_alloc = std::queue>>; + using que = que_alloc; + void complete(int r) override; }; -- 2.47.3