diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fs-writeback.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 1fcce8345da3..6f9c9f6f5157 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -990,8 +990,10 @@ void sb_mark_inode_writeback(struct inode *inode) if (list_empty(&inode->i_wb_list)) { spin_lock_irqsave(&sb->s_inode_wblist_lock, flags); - if (list_empty(&inode->i_wb_list)) + if (list_empty(&inode->i_wb_list)) { list_add_tail(&inode->i_wb_list, &sb->s_inodes_wb); + trace_sb_mark_inode_writeback(inode); + } spin_unlock_irqrestore(&sb->s_inode_wblist_lock, flags); } } @@ -1006,7 +1008,10 @@ void sb_clear_inode_writeback(struct inode *inode) if (!list_empty(&inode->i_wb_list)) { spin_lock_irqsave(&sb->s_inode_wblist_lock, flags); - list_del_init(&inode->i_wb_list); + if (!list_empty(&inode->i_wb_list)) { + list_del_init(&inode->i_wb_list); + trace_sb_clear_inode_writeback(inode); + } spin_unlock_irqrestore(&sb->s_inode_wblist_lock, flags); } } |