1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef CEPH_LIBRBD_JOURNAL_REMOVE_REQUEST_H
5 #define CEPH_LIBRBD_JOURNAL_REMOVE_REQUEST_H
7 #include "include/int_types.h"
8 #include "include/buffer.h"
9 #include "include/rados/librados.hpp"
10 #include "include/rbd/librbd.hpp"
11 #include "common/Mutex.h"
12 #include "librbd/ImageCtx.h"
13 #include "journal/Journaler.h"
14 #include "librbd/journal/TypeTraits.h"
16 using librados::IoCtx;
17 using journal::Journaler;
33 template<typename ImageCtxT = ImageCtx>
36 static RemoveRequest *create(IoCtx &ioctx, const std::string &image_id,
37 const std::string &client_id,
38 ContextWQ *op_work_queue, Context *on_finish) {
39 return new RemoveRequest(ioctx, image_id, client_id,
40 op_work_queue, on_finish);
46 typedef typename TypeTraits<ImageCtxT>::Journaler Journaler;
48 RemoveRequest(IoCtx &ioctx, const std::string &image_id,
49 const std::string &client_id,
50 ContextWQ *op_work_queue, Context *on_finish);
53 std::string m_image_id;
54 std::string m_image_client_id;
55 ContextWQ *m_op_work_queue;
59 Journaler *m_journaler;
65 Context *handle_stat_journal(int *result);
67 void init_journaler();
68 Context *handle_init_journaler(int *result);
70 void remove_journal();
71 Context *handle_remove_journal(int *result);
73 void shut_down_journaler(int r);
74 Context *handle_journaler_shutdown(int *result);
77 } // namespace journal
80 extern template class librbd::journal::RemoveRequest<librbd::ImageCtx>;
82 #endif // CEPH_LIBRBD_JOURNAL_REMOVE_REQUEST_H