diff options
author | Pranith Kumar K <pranithk@gluster.com> | 2011-08-20 15:48:27 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-08-20 06:42:55 -0700 |
commit | 1af420c700fbc49b65cf7faceb3270e81cd991ce (patch) | |
tree | ee0dcfe62b4965191424b3121a4dd126e81260b8 /xlators/cluster/afr/src/afr-inode-read.c | |
parent | 2ebacdfdd3c39bf2d3139cb7d811356758a2350a (diff) |
cluster/afr: Perform self-heal without locking the whole file
Change-Id: I206571c77f2d7b3c9f9d7bb82a936366fd99ce5c
BUG: 3182
Reviewed-on: http://review.gluster.com/141
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-inode-read.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-inode-read.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c index f8157482758..1258afe09fc 100644 --- a/xlators/cluster/afr/src/afr-inode-read.c +++ b/xlators/cluster/afr/src/afr-inode-read.c @@ -44,9 +44,6 @@ #include "compat-errno.h" #include "compat.h" -#include "afr.h" - - /** * Common algorithm for inode read calls: * @@ -399,6 +396,12 @@ afr_fstat (call_frame_t *frame, xlator_t *this, local->cont.fstat.ino = fd->inode->ino; local->fd = fd_ref (fd); + op_ret = afr_open_fd_fix (frame, this, _gf_false); + if (op_ret) { + op_errno = -op_ret; + op_ret = -1; + goto out; + } STACK_WIND_COOKIE (frame, afr_fstat_cbk, (void *) (long) call_child, children[call_child], children[call_child]->fops->fstat, @@ -1036,6 +1039,12 @@ afr_readv (call_frame_t *frame, xlator_t *this, local->cont.readv.size = size; local->cont.readv.offset = offset; + op_ret = afr_open_fd_fix (frame, this, _gf_false); + if (op_ret) { + op_errno = -op_ret; + op_ret = -1; + goto out; + } STACK_WIND_COOKIE (frame, afr_readv_cbk, (void *) (long) call_child, children[call_child], |