diff options
Diffstat (limited to 'libglusterfs/src')
-rw-r--r-- | libglusterfs/src/inode.c | 26 | ||||
-rw-r--r-- | libglusterfs/src/inode.h | 3 |
2 files changed, 29 insertions, 0 deletions
diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c index 70150536643..7f717535f39 100644 --- a/libglusterfs/src/inode.c +++ b/libglusterfs/src/inode.c @@ -1319,6 +1319,32 @@ inode_parent (inode_t *inode, uuid_t pargfid, const char *name) return parent; } +static int +__inode_has_dentry (inode_t *inode) +{ + if (!inode) { + gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0, + LG_MSG_INODE_NOT_FOUND, "inode not found"); + return 0; + } + + return !list_empty (&inode->dentry_list); +} + +int +inode_has_dentry (inode_t *inode) +{ + + int dentry_present = 0; + + LOCK (&inode->lock); + { + dentry_present = __inode_has_dentry (inode); + } + UNLOCK (&inode->lock); + + return dentry_present; +} int __inode_path (inode_t *inode, const char *name, char **bufp) diff --git a/libglusterfs/src/inode.h b/libglusterfs/src/inode.h index b8bac7932c3..a17970e8174 100644 --- a/libglusterfs/src/inode.h +++ b/libglusterfs/src/inode.h @@ -278,4 +278,7 @@ inode_set_need_lookup (inode_t *inode, xlator_t *this); gf_boolean_t inode_needs_lookup (inode_t *inode, xlator_t *this); +int +inode_has_dentry (inode_t *inode); + #endif /* _INODE_H */ |