From 2ef4e5a9913508bc7e371918a28adb3eb0eadbe4 Mon Sep 17 00:00:00 2001 From: Ajeet Jha Date: Thu, 16 Jan 2014 17:25:49 +0530 Subject: features/gfid-access: populating inode during virtual_lookup_cbk. Setting appropriate ia_type and gfid for the inode, obtained during virtual_lookup_cbk of a directory by doing an "inode_link". Change-Id: I9582570c82e70ff5f1d4e441f9e9868ef82e9dc6 BUG: 1054199 Signed-off-by: Ajeet Jha Reviewed-on: http://review.gluster.org/6723 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- xlators/features/gfid-access/src/gfid-access.c | 5 ++++- xlators/features/gfid-access/src/gfid-access.h | 6 ++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'xlators/features/gfid-access/src') diff --git a/xlators/features/gfid-access/src/gfid-access.c b/xlators/features/gfid-access/src/gfid-access.c index a2bcbb74b6b..362fdab5a74 100644 --- a/xlators/features/gfid-access/src/gfid-access.c +++ b/xlators/features/gfid-access/src/gfid-access.c @@ -263,6 +263,8 @@ ga_fill_tmp_loc (loc_t *loc, xlator_t *this, uuid_t gfid, ret = inode_ctx_get (loc->inode, this, &value); if (!ret) { parent = (void *)value; + if (uuid_is_null (parent->gfid)) + parent = loc->inode; } /* parent itself should be looked up */ @@ -627,7 +629,8 @@ ga_virtual_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, /* the inode is not present in itable, ie, the actual path is not yet looked up. Use the current inode itself for now */ - inode_ref (inode); + + inode_link (inode, NULL, NULL, buf); } else { /* 'inode_ref()' has been done in inode_find() */ inode = true_inode; diff --git a/xlators/features/gfid-access/src/gfid-access.h b/xlators/features/gfid-access/src/gfid-access.h index 3b74ce1121a..e883eca696c 100644 --- a/xlators/features/gfid-access/src/gfid-access.h +++ b/xlators/features/gfid-access/src/gfid-access.h @@ -44,8 +44,7 @@ if (ret) \ goto lbl; \ tmp_inode = (inode_t *)value; \ - unref = inode_ref (tmp_inode); \ - l->parent = tmp_inode; \ + l->parent = inode_ref (tmp_inode); \ /* if parent is virtual, no need to handle */ \ /* loc->inode */ \ break; \ @@ -59,8 +58,7 @@ if (ret) \ goto lbl; \ tmp_inode = (inode_t *)value; \ - unref = inode_ref (tmp_inode); \ - l->inode = tmp_inode; \ + l->inode = inode_ref (tmp_inode); \ } \ \ } while (0) -- cgit