]>
git.proxmox.com Git - ceph.git/blob - ceph/src/librbd/exclusive_lock/PreReleaseRequest.h
98e3a1e9dac73cc467910603ff0baa2aa8c888de
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_EXCLUSIVE_LOCK_PRE_RELEASE_REQUEST_H
5 #define CEPH_LIBRBD_EXCLUSIVE_LOCK_PRE_RELEASE_REQUEST_H
7 #include "librbd/ImageCtx.h"
16 namespace exclusive_lock
{
18 template <typename ImageCtxT
= ImageCtx
>
19 class PreReleaseRequest
{
21 static PreReleaseRequest
* create(ImageCtxT
&image_ctx
, bool shutting_down
,
46 * FLUSH_NOTIFIES . . . . . . . . . . . . . .
50 * | (journal disabled, .
51 * v object map enabled) .
52 * CLOSE_OBJECT_MAP < . . . . . . . . . . . .
54 * v (object map disabled) .
55 * <finish> < . . . . . . . . . . . . . . . . .
60 PreReleaseRequest(ImageCtxT
&image_ctx
, bool shutting_down
,
63 ImageCtxT
&m_image_ctx
;
69 decltype(m_image_ctx
.object_map
) m_object_map
;
70 decltype(m_image_ctx
.journal
) m_journal
;
72 void send_prepare_lock();
73 void handle_prepare_lock(int r
);
75 void send_cancel_op_requests();
76 void handle_cancel_op_requests(int r
);
78 void send_block_writes();
79 void handle_block_writes(int r
);
81 void send_invalidate_cache(bool purge_on_error
);
82 void handle_invalidate_cache(int r
);
84 void send_flush_notifies();
85 void handle_flush_notifies(int r
);
87 void send_close_journal();
88 void handle_close_journal(int r
);
90 void send_close_object_map();
91 void handle_close_object_map(int r
);
97 void save_result(int result
) {
98 if (m_error_result
== 0 && result
< 0) {
99 m_error_result
= result
;
105 } // namespace exclusive_lock
106 } // namespace librbd
108 #endif // CEPH_LIBRBD_EXCLUSIVE_LOCK_PRE_RELEASE_REQUEST_H