summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-inode-write.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/afr/src/afr-inode-write.c')
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c57
1 files changed, 43 insertions, 14 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index 97397f986b5..f0231b71113 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -507,6 +507,7 @@ afr_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
{
afr_local_t *local = NULL;
int op_errno = ENOMEM;
+ int ret = -1;
local = AFR_FRAME_INIT (frame, op_errno);
if (!local)
@@ -529,7 +530,9 @@ afr_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
goto out;
local->fd = fd_ref (fd);
- local->inode = inode_ref (fd->inode);
+ ret = afr_set_inode_local (this, local, fd->inode);
+ if (ret)
+ goto out;
if (dict_set_uint32 (local->xdata_req, GLUSTERFS_OPEN_FD_COUNT, 4)) {
op_errno = ENOMEM;
@@ -654,7 +657,9 @@ afr_truncate (call_frame_t *frame, xlator_t *this,
local->transaction.unwind = afr_truncate_unwind;
loc_copy (&local->loc, loc);
- local->inode = inode_ref (loc->inode);
+ ret = afr_set_inode_local (this, local, loc->inode);
+ if (ret)
+ goto out;
local->op = GF_FOP_TRUNCATE;
@@ -768,7 +773,9 @@ afr_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
goto out;
local->fd = fd_ref (fd);
- local->inode = inode_ref (fd->inode);
+ ret = afr_set_inode_local (this, local, fd->inode);
+ if (ret)
+ goto out;
local->op = GF_FOP_FTRUNCATE;
@@ -886,7 +893,9 @@ afr_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *buf,
local->transaction.unwind = afr_setattr_unwind;
loc_copy (&local->loc, loc);
- local->inode = inode_ref (loc->inode);
+ ret = afr_set_inode_local (this, local, loc->inode);
+ if (ret)
+ goto out;
local->op = GF_FOP_SETATTR;
@@ -991,7 +1000,9 @@ afr_fsetattr (call_frame_t *frame, xlator_t *this,
local->transaction.unwind = afr_fsetattr_unwind;
local->fd = fd_ref (fd);
- local->inode = inode_ref (fd->inode);
+ ret = afr_set_inode_local (this, local, fd->inode);
+ if (ret)
+ goto out;
local->op = GF_FOP_FSETATTR;
@@ -1633,7 +1644,9 @@ afr_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
local->transaction.unwind = afr_setxattr_unwind;
loc_copy (&local->loc, loc);
- local->inode = inode_ref (loc->inode);
+ ret = afr_set_inode_local (this, local, loc->inode);
+ if (ret)
+ goto out;
local->transaction.main_frame = frame;
local->transaction.start = LLONG_MAX - 1;
@@ -1745,7 +1758,9 @@ afr_fsetxattr (call_frame_t *frame, xlator_t *this,
local->transaction.unwind = afr_fsetxattr_unwind;
local->fd = fd_ref (fd);
- local->inode = inode_ref (fd->inode);
+ ret = afr_set_inode_local (this, local, fd->inode);
+ if (ret)
+ goto out;
local->op = GF_FOP_FSETXATTR;
@@ -1858,7 +1873,9 @@ afr_removexattr (call_frame_t *frame, xlator_t *this,
local->transaction.unwind = afr_removexattr_unwind;
loc_copy (&local->loc, loc);
- local->inode = inode_ref (loc->inode);
+ ret = afr_set_inode_local (this, local, loc->inode);
+ if (ret)
+ goto out;
local->op = GF_FOP_REMOVEXATTR;
@@ -1965,7 +1982,9 @@ afr_fremovexattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
local->transaction.unwind = afr_fremovexattr_unwind;
local->fd = fd_ref (fd);
- local->inode = inode_ref (fd->inode);
+ ret = afr_set_inode_local (this, local, fd->inode);
+ if (ret)
+ goto out;
local->op = GF_FOP_FREMOVEXATTR;
@@ -2060,7 +2079,9 @@ afr_fallocate (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode,
local->cont.fallocate.len = len;
local->fd = fd_ref (fd);
- local->inode = inode_ref (fd->inode);
+ ret = afr_set_inode_local (this, local, fd->inode);
+ if (ret)
+ goto out;
if (xdata)
local->xdata_req = dict_copy_with_ref (xdata, NULL);
@@ -2172,7 +2193,9 @@ afr_discard (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
local->cont.discard.len = len;
local->fd = fd_ref (fd);
- local->inode = inode_ref (fd->inode);
+ ret = afr_set_inode_local (this, local, fd->inode);
+ if (ret)
+ goto out;
if (xdata)
local->xdata_req = dict_copy_with_ref (xdata, NULL);
@@ -2281,7 +2304,9 @@ afr_zerofill (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
local->cont.zerofill.len = len;
local->fd = fd_ref (fd);
- local->inode = inode_ref (fd->inode);
+ ret = afr_set_inode_local (this, local, fd->inode);
+ if (ret)
+ goto out;
if (xdata)
local->xdata_req = dict_copy_with_ref (xdata, NULL);
@@ -2393,7 +2418,9 @@ afr_xattrop (call_frame_t *frame, xlator_t *this, loc_t *loc,
local->transaction.unwind = afr_xattrop_unwind;
loc_copy (&local->loc, loc);
- local->inode = inode_ref (loc->inode);
+ ret = afr_set_inode_local (this, local, loc->inode);
+ if (ret)
+ goto out;
local->op = GF_FOP_XATTROP;
@@ -2487,7 +2514,9 @@ afr_fxattrop (call_frame_t *frame, xlator_t *this, fd_t *fd,
local->transaction.unwind = afr_fxattrop_unwind;
local->fd = fd_ref (fd);
- local->inode = inode_ref (fd->inode);
+ ret = afr_set_inode_local (this, local, fd->inode);
+ if (ret)
+ goto out;
local->op = GF_FOP_FXATTROP;