提交 661074e9 编写于 作者: A Al Viro

Take ->i_bdev/->i_cdev handling out of clear_inode()

All call chains to clear_inode() pass through evict_inode() and
clear_inode() should be called by evict_inode() exactly once.
So we can pull i_bdev/i_cdev detaching up to evict_inode() itself.
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 c6287315
...@@ -313,10 +313,6 @@ void clear_inode(struct inode *inode) ...@@ -313,10 +313,6 @@ void clear_inode(struct inode *inode)
inode_sync_wait(inode); inode_sync_wait(inode);
if (inode->i_sb->s_op->clear_inode) if (inode->i_sb->s_op->clear_inode)
inode->i_sb->s_op->clear_inode(inode); inode->i_sb->s_op->clear_inode(inode);
if (S_ISBLK(inode->i_mode) && inode->i_bdev)
bd_forget(inode);
if (S_ISCHR(inode->i_mode) && inode->i_cdev)
cd_forget(inode);
inode->i_state = I_FREEING | I_CLEAR; inode->i_state = I_FREEING | I_CLEAR;
} }
EXPORT_SYMBOL(clear_inode); EXPORT_SYMBOL(clear_inode);
...@@ -334,6 +330,10 @@ static void evict(struct inode *inode, int delete) ...@@ -334,6 +330,10 @@ static void evict(struct inode *inode, int delete)
truncate_inode_pages(&inode->i_data, 0); truncate_inode_pages(&inode->i_data, 0);
clear_inode(inode); clear_inode(inode);
} }
if (S_ISBLK(inode->i_mode) && inode->i_bdev)
bd_forget(inode);
if (S_ISCHR(inode->i_mode) && inode->i_cdev)
cd_forget(inode);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册