Douglas Fuller | f66241c | 2015-06-18 13:06:10 -0700 | [diff] [blame] | 1 | #ifndef _LINUX_CEPH_CLS_LOCK_CLIENT_H |
| 2 | #define _LINUX_CEPH_CLS_LOCK_CLIENT_H |
| 3 | |
| 4 | #include <linux/ceph/osd_client.h> |
| 5 | |
| 6 | enum ceph_cls_lock_type { |
| 7 | CEPH_CLS_LOCK_NONE = 0, |
| 8 | CEPH_CLS_LOCK_EXCLUSIVE = 1, |
| 9 | CEPH_CLS_LOCK_SHARED = 2, |
| 10 | }; |
| 11 | |
Douglas Fuller | d4ed4a5 | 2015-06-29 16:55:42 -0700 | [diff] [blame] | 12 | struct ceph_locker_id { |
| 13 | struct ceph_entity_name name; /* locker's client name */ |
| 14 | char *cookie; /* locker's cookie */ |
| 15 | }; |
| 16 | |
| 17 | struct ceph_locker_info { |
| 18 | struct ceph_entity_addr addr; /* locker's address */ |
| 19 | }; |
| 20 | |
| 21 | struct ceph_locker { |
| 22 | struct ceph_locker_id id; |
| 23 | struct ceph_locker_info info; |
| 24 | }; |
| 25 | |
Douglas Fuller | f66241c | 2015-06-18 13:06:10 -0700 | [diff] [blame] | 26 | int ceph_cls_lock(struct ceph_osd_client *osdc, |
| 27 | struct ceph_object_id *oid, |
| 28 | struct ceph_object_locator *oloc, |
| 29 | char *lock_name, u8 type, char *cookie, |
| 30 | char *tag, char *desc, u8 flags); |
| 31 | int ceph_cls_unlock(struct ceph_osd_client *osdc, |
| 32 | struct ceph_object_id *oid, |
| 33 | struct ceph_object_locator *oloc, |
| 34 | char *lock_name, char *cookie); |
| 35 | int ceph_cls_break_lock(struct ceph_osd_client *osdc, |
| 36 | struct ceph_object_id *oid, |
| 37 | struct ceph_object_locator *oloc, |
| 38 | char *lock_name, char *cookie, |
| 39 | struct ceph_entity_name *locker); |
Ilya Dryomov | 14bb211 | 2017-04-13 12:17:38 +0200 | [diff] [blame] | 40 | int ceph_cls_set_cookie(struct ceph_osd_client *osdc, |
| 41 | struct ceph_object_id *oid, |
| 42 | struct ceph_object_locator *oloc, |
| 43 | char *lock_name, u8 type, char *old_cookie, |
| 44 | char *tag, char *new_cookie); |
Douglas Fuller | f66241c | 2015-06-18 13:06:10 -0700 | [diff] [blame] | 45 | |
Douglas Fuller | d4ed4a5 | 2015-06-29 16:55:42 -0700 | [diff] [blame] | 46 | void ceph_free_lockers(struct ceph_locker *lockers, u32 num_lockers); |
| 47 | |
| 48 | int ceph_cls_lock_info(struct ceph_osd_client *osdc, |
| 49 | struct ceph_object_id *oid, |
| 50 | struct ceph_object_locator *oloc, |
| 51 | char *lock_name, u8 *type, char **tag, |
| 52 | struct ceph_locker **lockers, u32 *num_lockers); |
| 53 | |
Douglas Fuller | f66241c | 2015-06-18 13:06:10 -0700 | [diff] [blame] | 54 | #endif |