summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr.h
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2016-11-07 14:47:34 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-11-26 07:34:59 -0800
commit6be7bd936eb30aa8d2b908061f60e1534e797657 (patch)
tree139a406d1bdc849ad7ad0658aca0c9b0768afafb /xlators/cluster/afr/src/afr.h
parent2fe8ba52108e94268bc816ba79074a96c4538271 (diff)
cluster/afr: Fix bugs in [f]inodelk/[f]entrylk
Problems: 1) Inodelk is not taking quorum into account 2) finodelk, [f]entrylk are not implemented correctly 3) By default afr doesn't go for non-blocking parallel locks. Fix: Implemented a common framework which can be used by [f]inodelk/[f]entrylk. Used quorum for the same. Change-Id: I239f13875a065298630d266941df10cfa3addc85 BUG: 1369077 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/15802 Tested-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Ravishankar N <ravishankar@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/cluster/afr/src/afr.h')
-rw-r--r--xlators/cluster/afr/src/afr.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index 93f4ba3dddc..9bfb5812d8a 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -347,6 +347,11 @@ typedef struct {
int readdir_subvol;
} afr_fd_ctx_t;
+typedef enum {
+ AFR_FOP_LOCK_PARALLEL,
+ AFR_FOP_LOCK_SERIAL,
+ AFR_FOP_LOCK_QUORUM_FAILED,
+} afr_fop_lock_state_t;
typedef struct _afr_local {
glusterfs_fop_t op;
@@ -664,11 +669,19 @@ typedef struct _afr_local {
struct {
char *volume;
int32_t cmd;
+ int32_t in_cmd;
+ struct gf_flock in_flock;
struct gf_flock flock;
+ void *xdata;
} inodelk;
struct {
+ char *volume;
+ char *basename;
+ entrylk_cmd in_cmd;
entrylk_cmd cmd;
+ entrylk_type type;
+ void *xdata;
} entrylk;
struct {
@@ -791,6 +804,7 @@ typedef struct _afr_local {
gf_boolean_t need_full_crawl;
gf_boolean_t compound;
+ afr_fop_lock_state_t fop_lock_state;
} afr_local_t;
@@ -1180,6 +1194,9 @@ int
afr_set_in_flight_sb_status (xlator_t *this, afr_local_t *local,
inode_t *inode);
+int32_t
+afr_quorum_errno (afr_private_t *priv);
+
gf_boolean_t
afr_is_consistent_io_possible (afr_local_t *local, afr_private_t *priv,
int32_t *op_errno);