summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse/src/fuse-helpers.c
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/fuse/src/fuse-helpers.c
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/fuse/src/fuse-helpers.c')
-rw-r--r--xlators/mount/fuse/src/fuse-helpers.c20
1 files changed, 11 insertions, 9 deletions
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)