@@ -1134,14 +1134,11 @@ ino_t iunique(struct super_block *sb, ino_t max_reserved)
}
EXPORT_SYMBOL(iunique);
-struct inode *igrab(struct inode *inode)
+struct inode *__igrab(struct inode *inode)
{
- spin_lock(&inode->i_lock);
if (!(inode->i_state & (I_FREEING|I_WILL_FREE))) {
__iget(inode);
- spin_unlock(&inode->i_lock);
} else {
- spin_unlock(&inode->i_lock);
/*
* Handle the case where s_op->clear_inode is not been
* called yet, and somebody is calling igrab
@@ -1149,6 +1146,17 @@ struct inode *igrab(struct inode *inode)
*/
inode = NULL;
}
+
+ return inode;
+}
+EXPORT_SYMBOL(__igrab);
+
+struct inode *igrab(struct inode *inode)
+{
+ spin_lock(&inode->i_lock);
+ inode = __igrab(inode);
+ spin_unlock(&inode->i_lock);
+
return inode;
}
EXPORT_SYMBOL(igrab);
@@ -2240,6 +2240,7 @@ extern void inode_init_once(struct inode *);
extern void address_space_init_once(struct address_space *mapping);
extern void ihold(struct inode * inode);
extern void iput(struct inode *);
+extern struct inode *__igrab(struct inode *inode);
extern struct inode * igrab(struct inode *);
extern ino_t iunique(struct super_block *, ino_t);
extern int inode_needs_sync(struct inode *inode);