diff options
author | Amar Tumballi <amar@gluster.com> | 2011-11-02 17:12:52 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-11-04 08:44:50 -0700 |
commit | e7bb65ede7df803e415a32582ff644d0ef434a70 (patch) | |
tree | c528c7e18d5106fcf3361e043da4189514bf59a0 /xlators/mount/fuse/src/fuse-resolve.c | |
parent | 02b4de3c1a33dd6a37c62d0edc8307adb52638b7 (diff) |
fuse resolve: send mapping 'gfid' in lookup for deep path resolve along with inode
without which, the 1:1 mapping of inode from old graph to new graph
is not complete
Change-Id: Idea14bc65ff74aa13fc53ebe2caa50410ccefc44
BUG: 3770
Reviewed-on: http://review.gluster.com/658
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mount/fuse/src/fuse-resolve.c')
-rw-r--r-- | xlators/mount/fuse/src/fuse-resolve.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/xlators/mount/fuse/src/fuse-resolve.c b/xlators/mount/fuse/src/fuse-resolve.c index 39e10e8a2..358839e9e 100644 --- a/xlators/mount/fuse/src/fuse-resolve.c +++ b/xlators/mount/fuse/src/fuse-resolve.c @@ -224,6 +224,8 @@ fuse_resolve_deep_cbk (call_frame_t *frame, void *cookie, xlator_t *this, struct fuse_resolve_comp *components = NULL; inode_t *link_inode = NULL; int i = 0; + inode_t *old_graph_inode = NULL; + xlator_t *old_graph_xl = NULL; state = frame->root->state; resolve = state->resolve_now; @@ -261,6 +263,16 @@ fuse_resolve_deep_cbk (call_frame_t *frame, void *cookie, xlator_t *this, resolve->deep_loc.inode = inode_new (state->itable); resolve->deep_loc.name = components[i].basename; + old_graph_xl = state->old_xl; + old_graph_inode = inode_from_path (old_graph_xl->itable, + resolve->deep_loc.path); + if (old_graph_inode && !uuid_is_null (old_graph_inode->gfid)) { + uuid_copy (resolve->deep_loc.gfid, old_graph_inode->gfid); + } else { + gf_log (THIS->name, GF_LOG_WARNING, "%s: no gfid found", + resolve->deep_loc.path); + } + FUSE_FOP_COOKIE (state, state->itable->xl, fuse_resolve_deep_cbk, (void *)(long)i, GF_FOP_LOOKUP, lookup, &resolve->deep_loc, NULL); @@ -279,6 +291,8 @@ fuse_resolve_path_deep (fuse_state_t *state) struct fuse_resolve_comp *components = NULL; inode_t *inode = NULL; long i = 0; + inode_t *old_graph_inode = NULL; + xlator_t *old_graph_xl = NULL; resolve = state->resolve_now; @@ -304,6 +318,16 @@ fuse_resolve_path_deep (fuse_state_t *state) resolve->deep_loc.inode = inode_new (state->itable); resolve->deep_loc.name = components[i].basename; + old_graph_xl = state->old_xl; + old_graph_inode = inode_from_path (old_graph_xl->itable, + resolve->deep_loc.path); + if (old_graph_inode && !uuid_is_null (old_graph_inode->gfid)) { + uuid_copy (resolve->deep_loc.gfid, old_graph_inode->gfid); + } else { + gf_log (THIS->name, GF_LOG_WARNING, "%s: no gfid found", + resolve->deep_loc.path); + } + FUSE_FOP_COOKIE (state, state->itable->xl, fuse_resolve_deep_cbk, (void *)(long)i, GF_FOP_LOOKUP, lookup, &resolve->deep_loc, NULL); @@ -731,7 +755,7 @@ fuse_resolve_and_resume (fuse_state_t *state, fuse_resume_fn_t fn) /* now we have to resolve the inode to 'itable' */ state->itable = active_xl->itable; - + state->old_xl = inode_xl; fuse_resolve_all (state); return 0; |