diff mbox

[RFC,01/10] fs: Use lockdep_assert_held() instead of comments

Message ID 20170224162043.922049726@infradead.org (mailing list archive)
State New, archived
Headers show

Commit Message

Peter Zijlstra Feb. 24, 2017, 3:43 p.m. UTC
Because nobody reads comments...

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 fs/inode.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff mbox

Patch

--- a/fs/inode.c
+++ b/fs/inode.c
@@ -384,11 +384,9 @@  static void init_once(void *foo)
 	inode_init_once(inode);
 }
 
-/*
- * inode->i_lock must be held
- */
 void __iget(struct inode *inode)
 {
+	lockdep_assert_held(&inode->i_lock);
 	atomic_inc(&inode->i_count);
 }
 
@@ -409,11 +407,10 @@  static void inode_lru_list_add(struct in
 
 /*
  * Add inode to LRU if needed (inode is unused and clean).
- *
- * Needs inode->i_lock held.
  */
 void inode_add_lru(struct inode *inode)
 {
+	lockdep_assert_held(&inode->i_lock);
 	if (!(inode->i_state & (I_DIRTY_ALL | I_SYNC |
 				I_FREEING | I_WILL_FREE)) &&
 	    !atomic_read(&inode->i_count) && inode->i_sb->s_flags & MS_ACTIVE)