aboutsummaryrefslogtreecommitdiffstats
path: root/fs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/inode.c')
-rw-r--r--fs/inode.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/fs/inode.c b/fs/inode.c
index 73920d555c88..ec7924696a13 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -848,16 +848,9 @@ struct inode *new_inode(struct super_block *sb)
848} 848}
849EXPORT_SYMBOL(new_inode); 849EXPORT_SYMBOL(new_inode);
850 850
851/**
852 * unlock_new_inode - clear the I_NEW state and wake up any waiters
853 * @inode: new inode to unlock
854 *
855 * Called when the inode is fully initialised to clear the new state of the
856 * inode and wake up anyone waiting for the inode to finish initialisation.
857 */
858void unlock_new_inode(struct inode *inode)
859{
860#ifdef CONFIG_DEBUG_LOCK_ALLOC 851#ifdef CONFIG_DEBUG_LOCK_ALLOC
852void lockdep_annotate_inode_mutex_key(struct inode *inode)
853{
861 if (S_ISDIR(inode->i_mode)) { 854 if (S_ISDIR(inode->i_mode)) {
862 struct file_system_type *type = inode->i_sb->s_type; 855 struct file_system_type *type = inode->i_sb->s_type;
863 856
@@ -873,7 +866,20 @@ void unlock_new_inode(struct inode *inode)
873 &type->i_mutex_dir_key); 866 &type->i_mutex_dir_key);
874 } 867 }
875 } 868 }
869}
870EXPORT_SYMBOL(lockdep_annotate_inode_mutex_key);
876#endif 871#endif
872
873/**
874 * unlock_new_inode - clear the I_NEW state and wake up any waiters
875 * @inode: new inode to unlock
876 *
877 * Called when the inode is fully initialised to clear the new state of the
878 * inode and wake up anyone waiting for the inode to finish initialisation.
879 */
880void unlock_new_inode(struct inode *inode)
881{
882 lockdep_annotate_inode_mutex_key(inode);
877 spin_lock(&inode->i_lock); 883 spin_lock(&inode->i_lock);
878 WARN_ON(!(inode->i_state & I_NEW)); 884 WARN_ON(!(inode->i_state & I_NEW));
879 inode->i_state &= ~I_NEW; 885 inode->i_state &= ~I_NEW;