summaryrefslogtreecommitdiffstats
path: root/api/src/glfs.h
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2018-10-10 21:37:07 +0530
committerSoumya Koduri <skoduri@redhat.com>2018-10-22 22:06:03 +0530
commitfa4710bb8fbc852971d763d8727e3755436ea9c8 (patch)
treeae1a24de2d7afd5fdef30e188a3c82515be44ee9 /api/src/glfs.h
parentb63dfd84fc8b3e08e3f005f71bf493c633452612 (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" This is backport of below mainline path - https://review.gluster.org/#/c/glusterfs/+/21391 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.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/api/src/glfs.h b/api/src/glfs.h
index 16eae642906..dd6142757d6 100644
--- a/api/src/glfs.h
+++ b/api/src/glfs.h
@@ -960,7 +960,8 @@ glfs_upcall_get_fs (struct glfs_upcall *arg) __THROW
enum glfs_upcall_reason {
GLFS_UPCALL_EVENT_NULL = 0,
- GLFS_UPCALL_INODE_INVALIDATE, /* invalidate cache entry */
+ GLFS_UPCALL_INODE_INVALIDATE, /* invalidate cache entry */
+ GLFS_UPCALL_RECALL_LEASE, /* recall lease */
};
enum glfs_upcall_reason
@@ -980,6 +981,7 @@ glfs_upcall_get_reason (struct glfs_upcall *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.
@@ -1012,8 +1014,9 @@ typedef void (*glfs_upcall_cbk) (struct glfs_upcall *up_arg, void *data);
/*
* List of upcall events supported by gluster/gfapi
*/
-#define GLFS_EVENT_INODE_INVALIDATE 0x00000001 /* invalidate cache entry */
-#define GLFS_EVENT_ANY 0xffffffff /* for all the above events */
+#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 */
/*
* SYNOPSIS
@@ -1037,7 +1040,8 @@ typedef void (*glfs_upcall_cbk) (struct glfs_upcall *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 incase of any upcall received
* @data: Any opaque pointer provided by caller which shall be using while
@@ -1071,7 +1075,8 @@ glfs_upcall_register (struct glfs *fs, uint32_t event_list,
*
* @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
@@ -1082,6 +1087,7 @@ glfs_upcall_unregister (struct glfs *fs, uint32_t event_list) __THROW
/* Lease Types */
enum glfs_lease_types {
+ GLFS_LEASE_NONE = 0,
GLFS_RD_LEASE = 1,
GLFS_RW_LEASE = 2,
};