From 1f655aed1e439935c24da86fa70f19fd9151e7e8 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Wed, 25 Mar 2015 15:32:42 +0530 Subject: cluster/ec: Use fd when appropriate for updating size/version Change-Id: I5d3aca101c8cdda406d31d06c40404fa6a2b7170 BUG: 1192378 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/9995 Tested-by: Gluster Build System Reviewed-by: Kaleb KEITHLEY Reviewed-by: Dan Lambright --- xlators/cluster/ec/src/ec-common.c | 12 +++++++++--- 1 file 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; -- cgit