summaryrefslogtreecommitdiffstats
path: root/xlators/mount
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-11-16 15:39:29 +0530
committerVijay Bellur <vijay@gluster.com>2011-11-16 03:44:32 -0800
commit14f4e023822a22e0a4902acfd28c8f5ea8c94ccd (patch)
tree580ae84b87adf7f7ce83d6a409c303aa49ba4220 /xlators/mount
parent217842180858afff79d06c24389752299c5ed716 (diff)
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 <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mount')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c8
-rw-r--r--xlators/mount/fuse/src/fuse-helpers.c20
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 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)