diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2015-06-24 08:02:51 +0530 |
---|---|---|
committer | Raghavendra Bhat <raghavendra@redhat.com> | 2015-07-17 00:05:36 -0700 |
commit | f9b3ba22f105772e268765d80adfeffd8f6f2776 (patch) | |
tree | 4e9326624892429c1308a8b0aea610654356c74c /libglusterfs/src/inode.c | |
parent | 50b0c7baad43dcd378a5740f154b38ec0ffe0f00 (diff) |
cluster/afr: Pick gfid from poststat during fresh lookup for read child calculation
Backport of : http://review.gluster.org/11373
Change-Id: I03f11af082a0decf4ea084480b67e9e156964c76
BUG: 1235601
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/11408
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'libglusterfs/src/inode.c')
-rw-r--r-- | libglusterfs/src/inode.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c index 3b1e05077e8..36f16094bc6 100644 --- a/libglusterfs/src/inode.c +++ b/libglusterfs/src/inode.c @@ -1862,6 +1862,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_log_callingfn (THIS->name, GF_LOG_WARNING, + "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) |