diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2014-06-13 11:45:53 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-03-08 08:24:39 -0700 |
commit | a25cdf135f01ebeb64a4497df1bb5146bfdc6620 (patch) | |
tree | 2e97626b7b00da7865514de86b1d712e7c372580 /api | |
parent | adef0c8860f57c8137382d848244009e9a584497 (diff) |
Use common loc-touchup in fuse/server/gfapi
Change-Id: Id41fb29480bb6d22c34469339163da05b98c1a98
BUG: 1115907
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8226
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'api')
-rw-r--r-- | api/src/glfs-resolve.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c index 9aeac57b75e..3c69d78e487 100644 --- a/api/src/glfs-resolve.c +++ b/api/src/glfs-resolve.c @@ -139,30 +139,15 @@ __glfs_refresh_inode (struct glfs *fs, xlator_t *subvol, inode_t *inode) int priv_glfs_loc_touchup (loc_t *loc) { - char *path = NULL; - int ret = -1; - char *bn = NULL; + int ret = 0; - if (loc->parent) - ret = inode_path (loc->parent, loc->name, &path); - else - ret = inode_path (loc->inode, 0, &path); - - loc->path = path; - - if (ret < 0 || !path) { - ret = -1; - errno = ENOMEM; - goto out; - } + ret = loc_touchup (loc, loc->name); + if (ret < 0) { + errno = -ret; + ret = -1; + } - bn = strrchr (path, '/'); - if (bn) - bn++; - loc->name = bn; - ret = 0; -out: - return ret; + return ret; } GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_loc_touchup, 3.4.0); |