Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / librbd / operation / SnapshotLimitRequest.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_OPERATION_SNAPSHOT_LIMIT_REQUEST_H
5 #define CEPH_LIBRBD_OPERATION_SNAPSHOT_LIMIT_REQUEST_H
6
7 #include "librbd/operation/Request.h"
8 #include <iosfwd>
9 #include <string>
10
11 class Context;
12
13 namespace librbd {
14
15 class ImageCtx;
16
17 namespace operation {
18
19 template <typename ImageCtxT = ImageCtx>
20 class SnapshotLimitRequest : public Request<ImageCtxT> {
21 public:
22   SnapshotLimitRequest(ImageCtxT &image_ctx, Context *on_finish,
23                        uint64_t limit);
24
25 protected:
26   void send_op() override;
27   bool should_complete(int r) override;
28
29   journal::Event create_event(uint64_t op_tid) const override {
30     return journal::SnapLimitEvent(op_tid, m_snap_limit);
31   }
32
33 private:
34   uint64_t m_snap_limit;
35
36   void send_limit_snaps();
37 };
38
39 } // namespace operation
40 } // namespace librbd
41
42 extern template class librbd::operation::SnapshotLimitRequest<librbd::ImageCtx>;
43
44 #endif // CEPH_LIBRBD_OPERATION_SNAPSHOT_LIMIT_REQUEST_H