diff options
author | Soumya Koduri <skoduri@redhat.com> | 2018-10-10 21:37:07 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-10-16 06:34:21 +0000 |
commit | a303cd1acc3c9ff475fe5ece643de4cbea1c1a51 (patch) | |
tree | 305ef3bebbeaf1696b5b800a74e5f3ad40088afc /api/src/glfs.h | |
parent | 593bbb28d95d1ebf11aa6f4d1f256529ed2dba88 (diff) |
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"
Change-Id: I3320ddf235cc82fad561e13b9457ebd64db6c76b
updates: #350
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Diffstat (limited to 'api/src/glfs.h')
-rw-r--r-- | api/src/glfs.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/api/src/glfs.h b/api/src/glfs.h index a007602fc8d..cd642a5ea20 100644 --- a/api/src/glfs.h +++ b/api/src/glfs.h @@ -1042,6 +1042,7 @@ glfs_upcall_get_fs(glfs_upcall_t *arg) __THROW enum glfs_upcall_reason { GLFS_UPCALL_EVENT_NULL = 0, GLFS_UPCALL_INODE_INVALIDATE, /* invalidate cache entry */ + GLFS_UPCALL_RECALL_LEASE, /* recall lease */ }; typedef enum glfs_upcall_reason glfs_upcall_reason_t; @@ -1061,6 +1062,7 @@ glfs_upcall_get_reason(glfs_upcall_t *arg) __THROW * ========================================================== * GLFS_UPCALL_EVENT_NULL - NULL * GLFS_UPCALL_INODE_INVALIDATE - struct glfs_upcall_inode + * GLFS_UPCALL_RECALL_LEASE - struct glfs_upcall_lease * * After processing upcall event, glfs_free() should be called on the * glfs_upcall. @@ -1094,6 +1096,7 @@ typedef void (*glfs_upcall_cbk)(glfs_upcall_t *up_arg, void *data); * List of upcall events supported by gluster/gfapi */ #define GLFS_EVENT_INODE_INVALIDATE 0x00000001 /* invalidate cache entry */ +#define GLFS_EVENT_RECALL_LEASE 0x00000002 /* Recall lease */ #define GLFS_EVENT_ANY 0xffffffff /* for all the above events */ /* @@ -1118,7 +1121,8 @@ typedef void (*glfs_upcall_cbk)(glfs_upcall_t *up_arg, void *data); * * @event_list: List of upcall events to be registered. * Current available values are: - * - GFAPI_UPCALL_INODE_INVALIDATE + * - GLFS_EVENT_INODE_INVALIDATE + * - GLFS_EVENT_RECALL_LEASE * * @cbk: The cbk routine to be invoked in case of any upcall received * @data: Any opaque pointer provided by caller which shall be using while @@ -1152,7 +1156,8 @@ glfs_upcall_register(glfs_t *fs, uint32_t event_list, glfs_upcall_cbk cbk, * * @event_list: List of upcall events to be unregistered. * Current available values are: - * - GFAPI_UPCALL_INODE_INVALIDATE + * - GLFS_EVENT_INODE_INVALIDATE + * - GLFS_EVENT_RECALL_LEASE * RETURN VALUE: * >0: SUCCESS (value contains the events successfully unregistered) * -1: FAILURE @@ -1163,6 +1168,7 @@ glfs_upcall_unregister(glfs_t *fs, uint32_t event_list) __THROW /* Lease Types */ enum glfs_lease_types { + GLFS_LEASE_NONE = 0, GLFS_RD_LEASE = 1, GLFS_RW_LEASE = 2, }; |