From 9ec821f9e67848b3527f6b7dc776cb9ba440610b Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Thu, 16 Aug 2018 17:28:54 +0530 Subject: afr: common thin-arbiter functions ...that can be used by client and self-heal daemon, namely: afr_ta_post_op_lock() afr_ta_post_op_unlock() Note: These are not yet consumed. They will be used in the write txn changes patch which will introduce 2 domain locking. updates: bz#1579788 Change-Id: I636d50f8fde00736665060e8f9ee4510d5f38795 Signed-off-by: Ravishankar N --- xlators/cluster/afr/src/afr.h | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'xlators/cluster/afr/src/afr.h') diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 68087e0ea20..d32ff5f8d85 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -36,7 +36,8 @@ #define ARBITER_BRICK_INDEX 2 #define THIN_ARBITER_BRICK_INDEX 2 -#define THIN_ARBITER_DOM1 "afr.ta.domain-1" +#define AFR_TA_DOM_NOTIFY "afr.ta.dom-notify" +#define AFR_TA_DOM_MODIFY "afr.ta.dom-modify" #define AFR_HALO_MAX_LATENCY 99999 typedef int (*afr_lock_cbk_t) (call_frame_t *frame, xlator_t *this); @@ -73,6 +74,12 @@ typedef enum { AFR_FAV_CHILD_POLICY_MAX, } afr_favorite_child_policy; +typedef enum { + AFR_CHILD_UNKNOWN = -1, + AFR_CHILD_ZERO, + AFR_CHILD_ONE, +} afr_child_index; + struct afr_nfsd { gf_boolean_t iamnfsd; uint32_t halo_max_latency_msec; @@ -83,12 +90,16 @@ typedef struct _afr_private { unsigned int child_count; /* total number of children */ unsigned int arbiter_count; /*subset of child_count. Has to be 0 or 1.*/ - unsigned int thin_arbiter_count; /* 0 or 1 at the moment.*/ xlator_t **children; inode_t *root_inode; - uuid_t ta_gfid; /*For thin arbiter.*/ + + /* For thin-arbiter. */ + unsigned int thin_arbiter_count; /* 0 or 1 at the moment.*/ + uuid_t ta_gfid; + int ta_bad_child_index; + off_t ta_notify_dom_lock_offset; unsigned char *child_up; int64_t *child_latency; @@ -1229,4 +1240,13 @@ afr_write_subvol_reset (call_frame_t *frame, xlator_t *this); int afr_set_inode_local (xlator_t *this, afr_local_t *local, inode_t *inode); + +int +afr_fill_ta_loc (xlator_t *this, loc_t *loc); + +int +afr_ta_post_op_lock (xlator_t *this, loc_t *loc); + +int +afr_ta_post_op_unlock (xlator_t *this, loc_t *loc); #endif /* __AFR_H__ */ -- cgit