summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/xlator.c
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2012-02-28 09:27:32 +0530
committerVijay Bellur <vijay@gluster.com>2012-02-29 02:47:19 -0800
commit72eda6a45b52e98458e4efa3e9819a8a3a25faef (patch)
tree81fbfb3518d84286ed9c4e46d05b922501ae9372 /libglusterfs/src/xlator.c
parent15141a7660b1e4430513c8a96a498da652023894 (diff)
libglusterfs: Handle loc_copy for nameless loc
BUG: 787671 Change-Id: I7601f482ae753ead83be16d1df33c2187e76dc5c Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/2825 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'libglusterfs/src/xlator.c')
-rw-r--r--libglusterfs/src/xlator.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
index ec20029591e..bbd6df683a2 100644
--- a/libglusterfs/src/xlator.c
+++ b/libglusterfs/src/xlator.c
@@ -570,25 +570,21 @@ loc_copy (loc_t *dst, loc_t *src)
if (src->parent)
dst->parent = inode_ref (src->parent);
- if (src->path)
+ if (src->path) {
dst->path = gf_strdup (src->path);
- if (!dst->path)
- goto out;
+ if (!dst->path)
+ goto out;
- dst->name = strrchr (dst->path, '/');
- if (dst->name)
- dst->name++;
+ dst->name = strrchr (dst->path, '/');
+ if (dst->name)
+ dst->name++;
+ }
ret = 0;
out:
- if (ret == -1) {
- if (dst->inode)
- inode_unref (dst->inode);
-
- if (dst->parent)
- inode_unref (dst->parent);
- }
+ if (ret == -1)
+ loc_wipe (dst);
err:
return ret;