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_OBJECT_MAP_LOCK_REQUEST_H
5 #define CEPH_LIBRBD_OBJECT_MAP_LOCK_REQUEST_H
7 #include "include/buffer.h"
8 #include "cls/lock/cls_lock_types.h"
17 namespace object_map {
19 template <typename ImageCtxT = ImageCtx>
22 static LockRequest* create(ImageCtxT &image_ctx, Context *on_finish) {
23 return new LockRequest(image_ctx, on_finish);
25 LockRequest(ImageCtxT &image_ctx, Context *on_finish);
33 * <start> /------------------------------------- BREAK_LOCKS * * *
37 * | v (EBUSY && !broke_lock) | *
38 * \---------> LOCK_OBJECT_MAP * * * * * * * * * * * > GET_LOCK_INFO * *
42 * | * * * * * * * * * * * * * * * * * *
44 * | * (other errors) *
46 * v v (other errors) *
47 * <finish> < * * * * * * * * * * * * * * * * * * * * * * * *
52 ImageCtxT &m_image_ctx;
56 std::map<rados::cls::lock::locker_id_t,
57 rados::cls::lock::locker_info_t> m_lockers;
61 Context *handle_lock(int *ret_val);
63 void send_get_lock_info();
64 Context *handle_get_lock_info(int *ret_val);
66 void send_break_locks();
67 Context *handle_break_locks(int *ret_val);
70 } // namespace object_map
73 extern template class librbd::object_map::LockRequest<librbd::ImageCtx>;
75 #endif // CEPH_LIBRBD_OBJECT_MAP_LOCK_REQUEST_H