]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/fs: add aio_list_t type
authorSage Weil <sage@redhat.com>
Mon, 7 Nov 2016 22:47:55 +0000 (17:47 -0500)
committerSage Weil <sage@redhat.com>
Mon, 7 Nov 2016 22:51:17 +0000 (17:51 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/fs/FS.h

index 27b4334f364dd86412729fdeaf0b313015193cc7..18e99a20feaa696d7a46ab2ad95918548346d9bc 100644 (file)
@@ -28,6 +28,7 @@
 #include "include/types.h"
 #include "common/Mutex.h"
 #include "common/Cond.h"
+#include <boost/intrusive/list.hpp>
 
 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) {