diff options
author | Pranith Kumar K <pranithk@gluster.com> | 2011-10-26 12:30:29 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-11-23 09:56:30 -0800 |
commit | 9ac21b5a3e1b0d4afba1afb04ec62ce75e302a5e (patch) | |
tree | 41a00756551772ca5fd7bf7e590ee4c9e3e05ba2 /xlators/cluster/afr/src/afr-lk-common.c | |
parent | 0413d46873d082bbd3ee41aced3db01e444422d9 (diff) |
cluster/afr: Remove treating sh_frame as special loop_frame
Change-Id: I0d87f06f989b2d4b971967c52d4898331693a801
BUG: 3675
Reviewed-on: http://review.gluster.com/735
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-lk-common.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-lk-common.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr-lk-common.c b/xlators/cluster/afr/src/afr-lk-common.c index 82b9427caeb..0680f59c294 100644 --- a/xlators/cluster/afr/src/afr-lk-common.c +++ b/xlators/cluster/afr/src/afr-lk-common.c @@ -2233,3 +2233,28 @@ afr_attempt_lock_recovery (xlator_t *this, int32_t child_index) out: return ret; } + +void +afr_lk_transfer_datalock (call_frame_t *dst, call_frame_t *src, + unsigned int child_count) +{ + afr_local_t *dst_local = NULL; + afr_local_t *src_local = NULL; + afr_internal_lock_t *dst_lock = NULL; + afr_internal_lock_t *src_lock = NULL; + + dst_local = dst->local; + dst_lock = &dst_local->internal_lock; + src_local = src->local; + src_lock = &src_local->internal_lock; + if (src_lock->inode_locked_nodes) { + memcpy (dst_lock->inode_locked_nodes, + src_lock->inode_locked_nodes, + sizeof (*dst_lock->inode_locked_nodes) * child_count); + memset (src_lock->inode_locked_nodes, 0, + sizeof (*src_lock->inode_locked_nodes) * child_count); + } + + dst_lock->inodelk_lock_count = src_lock->inodelk_lock_count; + src_lock->inodelk_lock_count = 0; +} |