]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/librbd/ExclusiveLock.h
update sources to v12.1.0
[ceph.git] / ceph / src / librbd / ExclusiveLock.h
index 092f7094a6c6ffb78c5ed3e1bf4bc9ad4e479008..0aaad091ea786c74fe4be16edb8497297d2ac652 100644 (file)
@@ -5,7 +5,7 @@
 #define CEPH_LIBRBD_EXCLUSIVE_LOCK_H
 
 #include "librbd/ManagedLock.h"
-#include "librbd/ImageCtx.h"
+#include "common/AsyncOpTracker.h"
 
 namespace librbd {
 
@@ -18,7 +18,8 @@ public:
 
   ExclusiveLock(ImageCtxT &image_ctx);
 
-  bool accept_requests(int *ret_val) const;
+  bool accept_requests(int *ret_val = nullptr) const;
+  bool accept_ops() const;
 
   void block_requests(int r);
   void unblock_requests();
@@ -28,6 +29,8 @@ public:
 
   void handle_peer_notification(int r);
 
+  Context *start_op();
+
 protected:
   void shutdown_handler(int r, Context *on_finish) override;
   void pre_acquire_lock_handler(Context *on_finish) override;
@@ -36,6 +39,7 @@ protected:
                                 Context *on_finish) override;
   void post_release_lock_handler(bool shutting_down, int r,
                                  Context *on_finish) override;
+  void post_reacquire_lock_handler(int r, Context *on_finish) override;
 
 private:
 
@@ -82,11 +86,15 @@ private:
   ImageCtxT& m_image_ctx;
   Context *m_pre_post_callback = nullptr;
 
+  AsyncOpTracker m_async_op_tracker;
+
   uint32_t m_request_blocked_count = 0;
   int m_request_blocked_ret_val = 0;
 
   int m_acquire_lock_peer_ret_val = 0;
 
+  bool accept_ops(const Mutex &lock) const;
+
   void handle_init_complete(uint64_t features);
   void handle_post_acquiring_lock(int r);
   void handle_post_acquired_lock(int r);