new helper: end_writeback()

Essentially, the minimal variant of ->evict_inode().  It's
a trimmed-down clear_inode(), sans any fs callbacks.  Once
it returns we know that no async writeback will be happening;
every ->evict_inode() instance should do that once and do that
before doing anything ->write_inode() could interfere with
(e.g. freeing the on-disk inode).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro
2010-06-04 20:55:25 -04:00
parent 661074e91b
commit b0683aa638
3 changed files with 14 additions and 1 deletions

View File

@@ -294,6 +294,18 @@ void __iget(struct inode *inode)
inodes_stat.nr_unused--;
}
void end_writeback(struct inode *inode)
{
might_sleep();
BUG_ON(inode->i_data.nrpages);
BUG_ON(!list_empty(&inode->i_data.private_list));
BUG_ON(!(inode->i_state & I_FREEING));
BUG_ON(inode->i_state & I_CLEAR);
inode_sync_wait(inode);
inode->i_state = I_FREEING | I_CLEAR;
}
EXPORT_SYMBOL(end_writeback);
/**
* clear_inode - clear an inode
* @inode: inode to clear