]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
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_CRYPTO_SHUT_DOWN_CRYPTO_REQUEST_H | |
5 | #define CEPH_LIBRBD_CRYPTO_SHUT_DOWN_CRYPTO_REQUEST_H | |
6 | ||
1e59de90 | 7 | #include "librbd/ImageCtx.h" |
f67539c2 TL |
8 | |
9 | struct Context; | |
10 | ||
11 | namespace librbd { | |
12 | ||
13 | class ImageCtx; | |
14 | ||
15 | namespace crypto { | |
16 | ||
f67539c2 TL |
17 | template <typename I> |
18 | class ShutDownCryptoRequest { | |
19 | public: | |
20 | static ShutDownCryptoRequest* create(I* image_ctx, Context* on_finish) { | |
21 | return new ShutDownCryptoRequest(image_ctx, on_finish); | |
22 | } | |
23 | ||
24 | ShutDownCryptoRequest(I* image_ctx, Context* on_finish); | |
1e59de90 | 25 | |
f67539c2 TL |
26 | void send(); |
27 | void shut_down_object_dispatch(); | |
28 | void handle_shut_down_object_dispatch(int r); | |
29 | void shut_down_image_dispatch(); | |
30 | void handle_shut_down_image_dispatch(int r); | |
31 | void finish(int r); | |
32 | ||
33 | private: | |
34 | I* m_image_ctx; | |
35 | Context* m_on_finish; | |
f67539c2 TL |
36 | }; |
37 | ||
38 | } // namespace crypto | |
39 | } // namespace librbd | |
40 | ||
41 | extern template class librbd::crypto::ShutDownCryptoRequest<librbd::ImageCtx>; | |
42 | ||
43 | #endif // CEPH_LIBRBD_CRYPTO_SHUT_DOWN_CRYPTO_REQUEST_H |