summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr.h
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/afr/src/afr.h')
-rw-r--r--xlators/cluster/afr/src/afr.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index b2f3af136bd..129670517f3 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -113,6 +113,7 @@ typedef struct _afr_private {
gf_boolean_t metadata_splitbrain_forced_heal; /* on/off */
int read_child; /* read-subvolume */
unsigned int hash_mode; /* for when read_child is not set */
+ gf_atomic_t *pending_reads; /*No. of pending read cbks per child.*/
int favorite_child; /* subvolume to be preferred in resolving
split-brain cases */
@@ -425,6 +426,8 @@ typedef struct _afr_local {
unsigned char *readable;
unsigned char *readable2; /*For rename transaction*/
+ int read_subvol; /* Current read subvolume */
+
afr_inode_refresh_cbk_t refreshfn;
/* @refreshinode:
@@ -974,6 +977,8 @@ afr_cleanup_fd_ctx (xlator_t *this, fd_t *fd);
__this = frame->this; \
afr_handle_inconsistent_fop (frame, &__op_ret,\
&__op_errno);\
+ if (__local && __local->is_read_txn) \
+ afr_pending_read_decrement (__this->private, __local->read_subvol); \
frame->local = NULL; \
} \
\