From d5624b2d4baf509ad8d6037a0d9cabf9cd5ab1c5 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Wed, 25 Feb 2015 11:37:57 +0530 Subject: libglusterfs: Moved common functions as utils in syncop/common-utils These will be used by both afr and ec. Moved syncop_dirfd, syncop_ftw, syncop_dir_scan functions also into syncop-utils.c Change-Id: I467253c74a346e1e292d36a8c1a035775c3aa670 BUG: 1177601 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/9740 Reviewed-by: Krutika Dhananjay Reviewed-by: Anuradha Talur Reviewed-by: Ravishankar N Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/storage/posix/src/posix.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'xlators/storage') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index ea9cb3def62..8ac3c5d4b68 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -3737,8 +3737,8 @@ posix_getxattr (call_frame_t *frame, xlator_t *this, dyn_rpath = gf_strdup (host_buf); if (!dyn_rpath) { - ret = -1; - goto done; + op_errno = ENOMEM; + goto out; } size = strlen (dyn_rpath) + 1; @@ -3749,6 +3749,8 @@ posix_getxattr (call_frame_t *frame, xlator_t *this, "could not set value (%s) in dictionary", dyn_rpath); GF_FREE (dyn_rpath); + op_errno = -ret; + goto out; } goto done; } @@ -3757,17 +3759,21 @@ posix_getxattr (call_frame_t *frame, xlator_t *this, (strcmp (name, GFID_TO_PATH_KEY) == 0)) { ret = inode_path (loc->inode, NULL, &path); if (ret < 0) { + op_errno = -ret; gf_log (this->name, GF_LOG_WARNING, "%s: could not get " "inode path", uuid_utoa (loc->inode->gfid)); - goto done; + goto out; } + size = ret; ret = dict_set_dynstr (dict, GFID_TO_PATH_KEY, path); if (ret < 0) { + op_errno = ENOMEM; gf_log (this->name, GF_LOG_WARNING, "could not set value (%s) in dictionary", host_buf); GF_FREE (path); + goto out; } goto done; } -- cgit