From 252fe523e2932e83a98f203f71678f391eee6b22 Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Tue, 12 Jan 2016 15:04:46 +0530 Subject: gfapi: send lookup if inode_ctx is not set During resolving of an entry or inode, if inode ctx was not set, we will send a lookup to pupulate inode ctx for every xlators This patch also make sure that inode_ctx will be created after every inode_link. We will store inode_ctx value as LOOKUP_NEEDED if the inode is liked via readdirp, in all other case we will store inode_ctx value as LOOKUP_NOT_NEEDED. Change-Id: I3a10c298944200fa3862127187ae8988e582d352 BUG: 1297311 Signed-off-by: Mohammed Rafi KC Reviewed-on: http://review.gluster.org/13226 Reviewed-by: Poornima G Tested-by: NetBSD Build System Reviewed-by: Shyamsundar Ranganathan Reviewed-by: Dan Lambright Tested-by: Dan Lambright --- api/src/glfs-fops.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'api/src/glfs-fops.c') diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index e57ad3f4a1..c120c950a1 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -77,6 +77,7 @@ glfs_loc_link (loc_t *loc, struct iatt *iatt) { int ret = -1; inode_t *old_inode = NULL; + uint64_t ctx_value = LOOKUP_NOT_NEEDED; if (!loc->inode) { errno = EINVAL; @@ -91,6 +92,7 @@ glfs_loc_link (loc_t *loc, struct iatt *iatt) */ loc->inode = inode_link (loc->inode, loc->parent, loc->name, iatt); if (loc->inode) { + inode_ctx_set (loc->inode, THIS, &ctx_value); inode_lookup (loc->inode); inode_unref (old_inode); ret = 0; -- cgit