summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2015-03-25 15:32:42 +0530
committerVijay Bellur <vbellur@redhat.com>2015-03-27 05:19:17 -0700
commit1f655aed1e439935c24da86fa70f19fd9151e7e8 (patch)
tree391884fd580be806c553cd4f25d6465181a8db45 /xlators
parent764ce1e2f627d398dac9cc95b3f12dbb243a8770 (diff)
cluster/ec: Use fd when appropriate for updating size/version
Change-Id: I5d3aca101c8cdda406d31d06c40404fa6a2b7170 BUG: 1192378 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9995 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/ec/src/ec-common.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c
index 92f7657cd75..1cae44fd0c9 100644
--- a/xlators/cluster/ec/src/ec-common.c
+++ b/xlators/cluster/ec/src/ec-common.c
@@ -1394,9 +1394,15 @@ void ec_update_size_version(ec_fop_data_t *fop, loc_t *loc, uint64_t version,
fop->frame->root->uid = 0;
fop->frame->root->gid = 0;
- ec_xattrop(fop->frame, fop->xl, fop->mask, EC_MINIMUM_MIN,
- ec_update_size_version_done, lock, loc,
- GF_XATTROP_ADD_ARRAY64, dict, NULL);
+ if (fop->use_fd) {
+ ec_fxattrop(fop->frame, fop->xl, fop->mask, EC_MINIMUM_MIN,
+ ec_update_size_version_done, lock, fop->fd,
+ GF_XATTROP_ADD_ARRAY64, dict, NULL);
+ } else {
+ ec_xattrop(fop->frame, fop->xl, fop->mask, EC_MINIMUM_MIN,
+ ec_update_size_version_done, lock, loc,
+ GF_XATTROP_ADD_ARRAY64, dict, NULL);
+ }
fop->frame->root->uid = uid;
fop->frame->root->gid = gid;