From fa4710bb8fbc852971d763d8727e3755436ea9c8 Mon Sep 17 00:00:00 2001 From: Soumya Koduri Date: Wed, 10 Oct 2018 21:37:07 +0530 Subject: gfapi: Bug fixes in leases processing code-path This patch fixes below issues in gfapi lease code-path * 'glfs_setfsleasid' should allow NULL input to be able to reset leaseid * Applications should be allowed to (un)register for upcall notifications of type GLFS_EVENT_LEASE_RECALL * APIs added to read contents of GLFS_EVENT_LEASE_RECALL argument which is of type "struct glfs_upcall_lease" This is backport of below mainline path - https://review.gluster.org/#/c/glusterfs/+/21391 Change-Id: I3320ddf235cc82fad561e13b9457ebd64db6c76b updates: #350 Signed-off-by: Soumya Koduri --- api/src/glfs-handles.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'api/src/glfs-handles.h') diff --git a/api/src/glfs-handles.h b/api/src/glfs-handles.h index 58ef85a9f47..6dfb027a9a4 100644 --- a/api/src/glfs-handles.h +++ b/api/src/glfs-handles.h @@ -337,6 +337,26 @@ struct glfs_object * glfs_h_find_handle (struct glfs *fs, unsigned char *handle, int len) __THROW GFAPI_PUBLIC(glfs_h_lease, 4.0.0); + +/* Functions for getting details about the glfs_upcall_lease + * + * None of the pointers returned by the below functions should be free()'d, + * glfs_free()'d or glfs_h_close()'d by the application. + * + * Releasing of the structures is done by passing the glfs_upcall pointer + * to glfs_free(). + */ +struct glfs_upcall_lease; +typedef struct glfs_upcall_lease glfs_upcall_lease_t; + +glfs_object_t * +glfs_upcall_lease_get_object(glfs_upcall_lease_t *arg) __THROW + GFAPI_PUBLIC(glfs_upcall_lease_get_object, 4.1.6); + +uint32_t +glfs_upcall_lease_get_lease_type(glfs_upcall_lease_t *arg) __THROW + GFAPI_PUBLIC(glfs_upcall_lease_get_lease_type, 4.1.6); + __END_DECLS #endif /* !_GLFS_HANDLES_H */ -- cgit