From 3bbfcf153fdf245b10fd580197ffe6f6218c070f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 7 Nov 2016 17:47:55 -0500 Subject: [PATCH] os/fs: add aio_list_t type Signed-off-by: Sage Weil --- src/os/fs/FS.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/os/fs/FS.h b/src/os/fs/FS.h index 27b4334f364dd..18e99a20feaa6 100644 --- a/src/os/fs/FS.h +++ b/src/os/fs/FS.h @@ -28,6 +28,7 @@ #include "include/types.h" #include "common/Mutex.h" #include "common/Cond.h" +#include class FS { public: @@ -61,6 +62,8 @@ public: int rval; bufferlist bl; ///< write payload (so that it remains stable for duration) + boost::intrusive::list_member_hook<> queue_item; + aio_t(void *p, int f) : priv(p), fd(f), rval(-1000) { memset(&iocb, 0, sizeof(iocb)); } @@ -85,10 +88,18 @@ public: } }; + typedef boost::intrusive::list< + aio_t, + boost::intrusive::member_hook< + aio_t, + boost::intrusive::list_member_hook<>, + &aio_t::queue_item> > aio_list_t; + struct aio_queue_t { int max_iodepth; io_context_t ctx; + explicit aio_queue_t(unsigned max_iodepth) : max_iodepth(max_iodepth), ctx(0) { -- 2.39.5