aboutsummaryrefslogtreecommitdiffstats
path: root/fs/inode.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2007-10-16 00:47:54 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 13:01:50 -0400
commit1e89a5e15a2c88b3fd1ed3fa17fd767efe44727a (patch)
tree840cb2badbbd568c44fa0ed2b3a467d3143381ea /fs/inode.c
parente744fdea546abf7a794898a99a26f85c63a83648 (diff)
lockdep: fixup the inode dir annotation
A slight oversight tripped lockdep debugging code, each lockdep class should have but a single init site. Rearange the code to make this true. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/inode.c')
-rw-r--r--fs/inode.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/inode.c b/fs/inode.c
index f97de0aeb3b6..21dab18b2f18 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -568,16 +568,16 @@ EXPORT_SYMBOL(new_inode);
568void unlock_new_inode(struct inode *inode) 568void unlock_new_inode(struct inode *inode)
569{ 569{
570#ifdef CONFIG_DEBUG_LOCK_ALLOC 570#ifdef CONFIG_DEBUG_LOCK_ALLOC
571 struct file_system_type *type = inode->i_sb->s_type; 571 if (inode->i_mode & S_IFDIR) {
572 /* 572 struct file_system_type *type = inode->i_sb->s_type;
573 * ensure nobody is actually holding i_mutex 573
574 */ 574 /*
575 mutex_destroy(&inode->i_mutex); 575 * ensure nobody is actually holding i_mutex
576 mutex_init(&inode->i_mutex); 576 */
577 if (inode->i_mode & S_IFDIR) 577 mutex_destroy(&inode->i_mutex);
578 mutex_init(&inode->i_mutex);
578 lockdep_set_class(&inode->i_mutex, &type->i_mutex_dir_key); 579 lockdep_set_class(&inode->i_mutex, &type->i_mutex_dir_key);
579 else 580 }
580 lockdep_set_class(&inode->i_mutex, &type->i_mutex_key);
581#endif 581#endif
582 /* 582 /*
583 * This is special! We do not need the spinlock 583 * This is special! We do not need the spinlock