summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/glusterfs.h
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2015-07-09 15:06:49 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-04-21 03:01:38 -0700
commit63918789fbb5f3a2d381e0f960f2dcbaf1b7ff72 (patch)
tree885377e1dcb957a2215c73ef7e908f726e2109ae /libglusterfs/src/glusterfs.h
parente964dd74fa805124005a5b2cb031ecbc34198b9a (diff)
core: add lease fop
Change-Id: Ia27d66b1061b0377857827515590eb89b18515c9 BUG: 1319992 Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/11596 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Smoke: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'libglusterfs/src/glusterfs.h')
-rw-r--r--libglusterfs/src/glusterfs.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index 3ffdeac1808..bcd84952f78 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -321,6 +321,7 @@ typedef enum {
GF_FOP_ZEROFILL,
GF_FOP_IPC,
GF_FOP_SEEK,
+ GF_FOP_LEASE,
GF_FOP_MAXVALUE,
} glusterfs_fop_t;
@@ -358,6 +359,23 @@ typedef enum {
GF_LK_EOL,
} glusterfs_lk_types_t;
+/* Lease Types */
+enum gf_lease_types {
+ NONE = 0,
+ GF_RD_LEASE = 1,
+ GF_RW_LEASE = 2,
+ GF_LEASE_MAX_TYPE,
+};
+typedef enum gf_lease_types gf_lease_types_t;
+
+/* Lease cmds */
+enum gf_lease_cmds {
+ GF_GET_LEASE = 1,
+ GF_SET_LEASE = 2,
+ GF_UNLK_LEASE = 3,
+};
+typedef enum gf_lease_cmds gf_lease_cmds_t;
+
typedef enum {
F_RESLK_LCK = 200,
F_RESLK_LCKW,
@@ -640,6 +658,14 @@ typedef enum {
GF_EVENT_MAXVAL,
} glusterfs_event_t;
+#define LEASE_ID_SIZE 16 /* 128bits */
+struct gf_lease {
+ gf_lease_cmds_t cmd;
+ gf_lease_types_t lease_type;
+ char lease_id[LEASE_ID_SIZE];
+ unsigned int lease_flags;
+};
+
struct gf_flock {
short l_type;
short l_whence;