From 4c751009f668910a734cd400c10e8b3bdd6360a1 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Wed, 24 Jun 2015 08:02:51 +0530 Subject: cluster/afr: Pick gfid from poststat during fresh lookup for read child calculation Change-Id: I12c1e4f67f4ec4affbe13d7daf871044a8a2a12e BUG: 1235216 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/11373 Reviewed-by: Pranith Kumar Karampuri Tested-by: NetBSD Build System --- libglusterfs/src/inode.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'libglusterfs/src/inode.c') diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c index f0bb5238d56..f3dd48653df 100644 --- a/libglusterfs/src/inode.c +++ b/libglusterfs/src/inode.c @@ -2169,6 +2169,28 @@ inode_ctx_reset0 (inode_t *inode, xlator_t *xlator, uint64_t *value1_p) return ret; } +int +inode_is_linked (inode_t *inode) +{ + int ret = 0; + inode_table_t *table = NULL; + + if (!inode) { + gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0, + LG_MSG_INODE_NOT_FOUND, "inode not found"); + return 0; + } + + table = inode->table; + + pthread_mutex_lock (&table->lock); + { + ret = __is_inode_hashed (inode); + } + pthread_mutex_unlock (&table->lock); + + return ret; +} void inode_dump (inode_t *inode, char *prefix) -- cgit