From 36b102645ab66d141dcc831e67caa78966d45419 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Tue, 30 Jul 2013 18:29:15 +0530 Subject: cluster/afr: Disable eager-lock if open-fd-count > 1 Lets say mount1 has eager-lock(full-lock) and after the eager-lock is taken mount2 opened the same file, it won't be able to perform any data operations until mount1 releases eager-lock. To avoid such scenario do not enable eager-lock for transaction if open-fd-count is > 1. Delaying of changelog piggybacking is avoided in this situation. Change-Id: I51b45d6a7c216a78860aff0265a0b8dabc6423a5 BUG: 910217 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/5432 Tested-by: Gluster Build System Reviewed-by: venkatesh somyajulu Reviewed-by: Vijay Bellur --- xlators/cluster/afr/src/afr.h | 9 +++++++++ 1 file changed, 9 insertions(+) (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 c6e6913df29..49d281acae1 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -87,6 +87,7 @@ typedef struct afr_inode_ctx_ { int32_t *fresh_children;//increasing order of latency afr_spb_state_t mdata_spb; afr_spb_state_t data_spb; + uint32_t open_fd_count; } afr_inode_ctx_t; typedef enum { @@ -445,6 +446,8 @@ typedef struct _afr_local { unsigned int call_count; unsigned int success_count; unsigned int enoent_count; + uint32_t open_fd_count; + gf_boolean_t update_open_fd_count; unsigned int unhealable; @@ -1171,4 +1174,10 @@ afr_delayed_changelog_wake_resume (xlator_t *this, fd_t *fd, call_stub_t *stub); int afr_inodelk_init (afr_inodelk_t *lk, char *dom, size_t child_count); +void +afr_handle_open_fd_count (call_frame_t *frame, xlator_t *this); + +afr_inode_ctx_t* +afr_inode_ctx_get (inode_t *inode, xlator_t *this); + #endif /* __AFR_H__ */ -- cgit