diff options
Diffstat (limited to 'xlators/mount')
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 8 | ||||
-rw-r--r-- | xlators/mount/fuse/src/fuse-helpers.c | 20 |
2 files changed, 15 insertions, 13 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 54d09e6b2..0c91dd787 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -247,8 +247,8 @@ fuse_lookup_resume (fuse_state_t *state) if (state->loc.inode) { gf_log ("glusterfs-fuse", GF_LOG_TRACE, - "%"PRIu64": LOOKUP %s(%"PRId64")", state->finh->unique, - state->loc.path, state->loc.inode->ino); + "%"PRIu64": LOOKUP %s(%s)", state->finh->unique, + state->loc.path, uuid_utoa (state->loc.inode->gfid)); state->is_revalidate = 1; } else { gf_log ("glusterfs-fuse", GF_LOG_TRACE, @@ -1000,8 +1000,8 @@ void fuse_readlink_resume (fuse_state_t *state) { gf_log ("glusterfs-fuse", GF_LOG_TRACE, - "%"PRIu64" READLINK %s/%"PRId64, state->finh->unique, - state->loc.path, state->loc.inode->ino); + "%"PRIu64" READLINK %s/%s", state->finh->unique, + state->loc.path, uuid_utoa (state->loc.inode->gfid)); FUSE_FOP (state, fuse_readlink_cbk, GF_FOP_READLINK, readlink, &state->loc, 4096); diff --git a/xlators/mount/fuse/src/fuse-helpers.c b/xlators/mount/fuse/src/fuse-helpers.c index f40d1d6a5..f0e9fb602 100644 --- a/xlators/mount/fuse/src/fuse-helpers.c +++ b/xlators/mount/fuse/src/fuse-helpers.c @@ -244,7 +244,7 @@ fuse_ino_to_inode (uint64_t ino, xlator_t *fuse) uint64_t inode_to_fuse_nodeid (inode_t *inode) { - if (!inode || inode->ino == 1) + if (!inode || __is_root_gfid (inode->gfid)) return 1; return (unsigned long) inode; @@ -259,6 +259,7 @@ fuse_loc_fill (loc_t *loc, fuse_state_t *state, ino_t ino, inode_t *parent = NULL; int32_t ret = -1; char *path = NULL; + uuid_t null_gfid = {0,}; /* resistance against multiple invocation of loc_fill not to get reference leaks via inode_search() */ @@ -279,8 +280,8 @@ fuse_loc_fill (loc_t *loc, fuse_state_t *state, ino_t ino, ret = inode_path (parent, name, &path); if (ret <= 0) { gf_log ("glusterfs-fuse", GF_LOG_DEBUG, - "inode_path failed for %"PRId64"/%s", - (parent)?parent->ino:0, name); + "inode_path failed for %s/%s", + (parent)?uuid_utoa (parent->gfid):"0", name); goto fail; } loc->path = path; @@ -293,23 +294,24 @@ fuse_loc_fill (loc_t *loc, fuse_state_t *state, ino_t ino, parent = loc->parent; if (!parent) { - parent = inode_parent (inode, par, name); + parent = fuse_ino_to_inode (par, state->this); + if (!parent) { + parent = inode_parent (inode, null_gfid, NULL); + } + loc->parent = parent; } ret = inode_path (inode, NULL, &path); if (ret <= 0) { gf_log ("glusterfs-fuse", GF_LOG_DEBUG, - "inode_path failed for %"PRId64, - (inode)?inode->ino:0); + "inode_path failed for %s", + (inode) ? uuid_utoa (inode->gfid) : "0"); goto fail; } loc->path = path; } - if (inode) - loc->ino = inode->ino; - if (loc->path) { loc->name = strrchr (loc->path, '/'); if (loc->name) |