diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2015-06-24 08:02:51 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-06-24 17:11:00 -0700 |
commit | 4c751009f668910a734cd400c10e8b3bdd6360a1 (patch) | |
tree | 9fa6f4e5b679073f6b4d61f4114d56b7ba4c4652 /libglusterfs/src | |
parent | 2f0d36d16c241365760aaa6d857b7a4d438e1042 (diff) |
cluster/afr: Pick gfid from poststat during fresh lookup for read child calculation
Change-Id: I12c1e4f67f4ec4affbe13d7daf871044a8a2a12e
BUG: 1235216
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/11373
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r-- | libglusterfs/src/inode.c | 22 | ||||
-rw-r--r-- | libglusterfs/src/inode.h | 3 |
2 files changed, 25 insertions, 0 deletions
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) diff --git a/libglusterfs/src/inode.h b/libglusterfs/src/inode.h index 83646ebda5a..3a7aa063920 100644 --- a/libglusterfs/src/inode.h +++ b/libglusterfs/src/inode.h @@ -264,4 +264,7 @@ inode_table_set_lru_limit (inode_table_t *table, uint32_t lru_limit); void inode_ctx_merge (fd_t *fd, inode_t *inode, inode_t *linked_inode); +int +inode_is_linked (inode_t *inode); + #endif /* _INODE_H */ |