static void dentry_free(struct dentry *dentry)
{
- WARN_ON(!hlist_unhashed(&dentry->d_alias));
+ WARN_ON(d_really_is_positive(dentry));
if (unlikely(dname_external(dentry))) {
struct external_name *p = external_name(dentry);
if (likely(atomic_dec_and_test(&p->count))) {
void d_instantiate(struct dentry *entry, struct inode * inode)
{
- BUG_ON(!hlist_unhashed(&entry->d_alias));
+ BUG_ON(d_really_is_positive(entry));
if (inode) {
security_d_instantiate(entry, inode);
spin_lock(&inode->i_lock);
*/
void d_instantiate_new(struct dentry *entry, struct inode *inode)
{
- BUG_ON(!hlist_unhashed(&entry->d_alias));
+ BUG_ON(d_really_is_positive(entry));
BUG_ON(!inode);
lockdep_annotate_inode_mutex_key(inode);
security_d_instantiate(entry, inode);
struct dentry *d_make_persistent(struct dentry *dentry, struct inode *inode)
{
- WARN_ON(!hlist_unhashed(&dentry->d_alias));
+ WARN_ON(d_really_is_positive(dentry));
WARN_ON(!inode);
security_d_instantiate(dentry, inode);
spin_lock(&inode->i_lock);
struct dentry *dentry = file->f_path.dentry;
BUG_ON(dname_external(dentry) ||
- !hlist_unhashed(&dentry->d_alias) ||
+ d_really_is_positive(dentry) ||
!d_unlinked(dentry));
spin_lock(&dentry->d_parent->d_lock);
spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);