]> git.proxmox.com Git - ceph.git/blob - ceph/src/librbd/exclusive_lock/AutomaticPolicy.h
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / librbd / exclusive_lock / AutomaticPolicy.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_EXCLUSIVE_LOCK_AUTOMATIC_POLICY_H
5 #define CEPH_LIBRBD_EXCLUSIVE_LOCK_AUTOMATIC_POLICY_H
6
7 #include "librbd/exclusive_lock/Policy.h"
8
9 namespace librbd {
10
11 struct ImageCtx;
12
13 namespace exclusive_lock {
14
15 class AutomaticPolicy : public Policy {
16 public:
17 AutomaticPolicy(ImageCtx *image_ctx) : m_image_ctx(image_ctx) {
18 }
19
20 bool may_auto_request_lock() override {
21 return true;
22 }
23
24 int lock_requested(bool force) override;
25
26 private:
27 ImageCtx *m_image_ctx;
28
29 };
30
31 } // namespace exclusive_lock
32 } // namespace librbd
33
34 #endif // CEPH_LIBRBD_EXCLUSIVE_LOCK_AUTOMATIC_POLICY_H