summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/src/glfs-resolve.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c
index 181d1788875..f7754d2019b 100644
--- a/api/src/glfs-resolve.c
+++ b/api/src/glfs-resolve.c
@@ -109,6 +109,28 @@ out:
}
+void
+glfs_resolve_base (struct glfs *fs, xlator_t *subvol, inode_t *inode,
+ struct iatt *iatt)
+{
+ loc_t loc = {0, };
+ int ret = -1;
+ char *path = NULL;
+
+ loc.inode = inode_ref (inode);
+ uuid_copy (loc.gfid, inode->gfid);
+
+ ret = inode_path (loc.inode, NULL, &path);
+ loc.path = path;
+ if (ret < 0)
+ goto out;
+
+ ret = syncop_lookup (subvol, &loc, NULL, iatt, NULL, NULL);
+out:
+ loc_wipe (&loc);
+}
+
+
inode_t *
glfs_resolve_component (struct glfs *fs, xlator_t *subvol, inode_t *parent,
const char *component, struct iatt *iatt)
@@ -208,14 +230,17 @@ glfs_resolve_at (struct glfs *fs, xlator_t *subvol, inode_t *at,
}
parent = NULL;
- if (at && path[0] != '/')
+ if (at && path[0] != '/') {
/* A relative resolution of a path which starts with '/'
is equal to an absolute path resolution.
*/
inode = inode_ref (at);
- else
+ } else {
inode = inode_ref (subvol->itable->root);
+ glfs_resolve_base (fs, subvol, inode, &ciatt);
+ }
+
for (component = strtok_r (path, "/", &saveptr);
component; component = next_component) {