From 14f4e023822a22e0a4902acfd28c8f5ea8c94ccd Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 16 Nov 2011 15:39:29 +0530 Subject: core: remove 'ino' variable from 'inode_t' structure Change-Id: I0f078d1753db65d2f2e0380d1b0450c114cf40dd BUG: 3518 Reviewed-on: http://review.gluster.com/522 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/mount/fuse/src/fuse-bridge.c | 8 ++++---- xlators/mount/fuse/src/fuse-helpers.c | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) (limited to 'xlators/mount/fuse') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 54d09e6b260..0c91dd78797 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 f40d1d6a50e..f0e9fb60296 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) -- cgit