Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / msg / xio / XioSubmit.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 /*
4  * Ceph - scalable distributed file system
5  *
6  * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
7  * Portions Copyright (C) 2013 CohortFS, LLC
8  *
9  * This is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License version 2.1, as published by the Free Software
12  * Foundation.  See file COPYING.
13  *
14  */
15
16 #ifndef XIO_SUBMIT_H
17 #define XIO_SUBMIT_H
18
19 #include <boost/intrusive/list.hpp>
20 #include "msg/SimplePolicyMessenger.h"
21 extern "C" {
22 #include "libxio.h"
23 }
24 #include "XioConnection.h"
25 #include "msg/msg_types.h"
26 #include "XioPool.h"
27
28 namespace bi = boost::intrusive;
29
30 class XioConnection;
31
32 struct XioSubmit
33 {
34 public:
35   enum submit_type
36   {
37     OUTGOING_MSG,
38     INCOMING_MSG_RELEASE
39   };
40   enum submit_type type;
41   bi::list_member_hook<> submit_list;
42   XioConnection *xcon;
43   ZTracer::Trace trace;
44
45   XioSubmit(enum submit_type _type, XioConnection *_xcon) :
46     type(_type), xcon(_xcon)
47     {}
48
49   typedef bi::list< XioSubmit,
50                     bi::member_hook< XioSubmit,
51                                      bi::list_member_hook<>,
52                                      &XioSubmit::submit_list >
53                     > Queue;
54   virtual ~XioSubmit(){
55   }
56 };
57
58 #endif /* XIO_SUBMIT_H */