1f66241cbSDouglas Fuller #ifndef _LINUX_CEPH_CLS_LOCK_CLIENT_H 2f66241cbSDouglas Fuller #define _LINUX_CEPH_CLS_LOCK_CLIENT_H 3f66241cbSDouglas Fuller 4f66241cbSDouglas Fuller #include <linux/ceph/osd_client.h> 5f66241cbSDouglas Fuller 6f66241cbSDouglas Fuller enum ceph_cls_lock_type { 7f66241cbSDouglas Fuller CEPH_CLS_LOCK_NONE = 0, 8f66241cbSDouglas Fuller CEPH_CLS_LOCK_EXCLUSIVE = 1, 9f66241cbSDouglas Fuller CEPH_CLS_LOCK_SHARED = 2, 10f66241cbSDouglas Fuller }; 11f66241cbSDouglas Fuller 12*d4ed4a53SDouglas Fuller struct ceph_locker_id { 13*d4ed4a53SDouglas Fuller struct ceph_entity_name name; /* locker's client name */ 14*d4ed4a53SDouglas Fuller char *cookie; /* locker's cookie */ 15*d4ed4a53SDouglas Fuller }; 16*d4ed4a53SDouglas Fuller 17*d4ed4a53SDouglas Fuller struct ceph_locker_info { 18*d4ed4a53SDouglas Fuller struct ceph_entity_addr addr; /* locker's address */ 19*d4ed4a53SDouglas Fuller }; 20*d4ed4a53SDouglas Fuller 21*d4ed4a53SDouglas Fuller struct ceph_locker { 22*d4ed4a53SDouglas Fuller struct ceph_locker_id id; 23*d4ed4a53SDouglas Fuller struct ceph_locker_info info; 24*d4ed4a53SDouglas Fuller }; 25*d4ed4a53SDouglas Fuller 26f66241cbSDouglas Fuller int ceph_cls_lock(struct ceph_osd_client *osdc, 27f66241cbSDouglas Fuller struct ceph_object_id *oid, 28f66241cbSDouglas Fuller struct ceph_object_locator *oloc, 29f66241cbSDouglas Fuller char *lock_name, u8 type, char *cookie, 30f66241cbSDouglas Fuller char *tag, char *desc, u8 flags); 31f66241cbSDouglas Fuller int ceph_cls_unlock(struct ceph_osd_client *osdc, 32f66241cbSDouglas Fuller struct ceph_object_id *oid, 33f66241cbSDouglas Fuller struct ceph_object_locator *oloc, 34f66241cbSDouglas Fuller char *lock_name, char *cookie); 35f66241cbSDouglas Fuller int ceph_cls_break_lock(struct ceph_osd_client *osdc, 36f66241cbSDouglas Fuller struct ceph_object_id *oid, 37f66241cbSDouglas Fuller struct ceph_object_locator *oloc, 38f66241cbSDouglas Fuller char *lock_name, char *cookie, 39f66241cbSDouglas Fuller struct ceph_entity_name *locker); 40f66241cbSDouglas Fuller 41*d4ed4a53SDouglas Fuller void ceph_free_lockers(struct ceph_locker *lockers, u32 num_lockers); 42*d4ed4a53SDouglas Fuller 43*d4ed4a53SDouglas Fuller int ceph_cls_lock_info(struct ceph_osd_client *osdc, 44*d4ed4a53SDouglas Fuller struct ceph_object_id *oid, 45*d4ed4a53SDouglas Fuller struct ceph_object_locator *oloc, 46*d4ed4a53SDouglas Fuller char *lock_name, u8 *type, char **tag, 47*d4ed4a53SDouglas Fuller struct ceph_locker **lockers, u32 *num_lockers); 48*d4ed4a53SDouglas Fuller 49f66241cbSDouglas Fuller #endif 50