diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2016-11-07 14:47:34 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-12-07 22:56:55 -0800 |
commit | 953917924a6298fb1deedf76feec354ee21dc373 (patch) | |
tree | f95ba8853cda5c843fe34589f0533d5b6366fc29 /xlators/cluster/afr/src/afr.h | |
parent | 15e424144228d3d769f0afc7ee753ad7612c32d4 (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>
BUG: 1402482
Change-Id: I0c5fed6ca87c6432bb20d00f76cdf5c328a52a85
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/16056
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr.h')
-rw-r--r-- | xlators/cluster/afr/src/afr.h | 17 |
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); |