Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / librbd / object_map / UnlockRequest.h
1 // -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #ifndef CEPH_LIBRBD_OBJECT_MAP_UNLOCK_REQUEST_H
5 #define CEPH_LIBRBD_OBJECT_MAP_UNLOCK_REQUEST_H
6
7 class Context;
8
9 namespace librbd {
10
11 class ImageCtx;
12
13 namespace object_map {
14
15 template <typename ImageCtxT = ImageCtx>
16 class UnlockRequest {
17 public:
18   static UnlockRequest *create(ImageCtxT &image_ctx, Context *on_finish) {
19     return new UnlockRequest(image_ctx, on_finish);
20   }
21
22   UnlockRequest(ImageCtxT &image_ctx, Context *on_finish);
23
24   void send();
25
26 private:
27   /**
28    * @verbatim
29    *
30    * <start> ----> UNLOCK ----> <finish>
31    *
32    * @endverbatim
33    */
34
35   ImageCtxT &m_image_ctx;
36   Context *m_on_finish;
37
38   void send_unlock();
39   Context* handle_unlock(int *ret_val);
40 };
41
42 } // namespace object_map
43 } // namespace librbd
44
45 extern template class librbd::object_map::UnlockRequest<librbd::ImageCtx>;
46
47 #endif // CEPH_LIBRBD_OBJECT_MAP_UNLOCK_REQUEST_H