diff options
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 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) diff --git a/libglusterfs/src/inode.h b/libglusterfs/src/inode.h index 5d373fcaec9..f5d011a5028 100644 --- a/libglusterfs/src/inode.h +++ b/libglusterfs/src/inode.h @@ -257,4 +257,7 @@ __inode_table_set_lru_limit (inode_table_t *table, uint32_t lru_limit); void inode_table_set_lru_limit (inode_table_t *table, uint32_t lru_limit); +int +inode_is_linked (inode_t *inode); + #endif /* _INODE_H */ |
