diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2015-02-25 11:37:57 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-02-27 01:28:35 -0800 |
commit | d5624b2d4baf509ad8d6037a0d9cabf9cd5ab1c5 (patch) | |
tree | a5f257e370606282a1f9c98418e48c466077e5f3 /xlators/storage/posix | |
parent | 6a77db6d19dba5367c02cbf2a5883ac49cef94e2 (diff) |
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 <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/9740
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-by: Anuradha Talur <atalur@redhat.com>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/storage/posix')
-rw-r--r-- | xlators/storage/posix/src/posix.c | 12 |
1 files changed, 9 insertions, 3 deletions
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; } |