aboutsummaryrefslogtreecommitdiffstats
path: root/fs/inode.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-06-04 20:55:25 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-08-09 16:47:49 -0400
commitb0683aa638b3326c6fc22e5290dfa75e08bd83f5 (patch)
tree8287f1eff3c76dc7cf6c42208efebb1510b075b2 /fs/inode.c
parent661074e91b1da1ee262dfde6dd836deacccb9def (diff)
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>
Diffstat (limited to 'fs/inode.c')
-rw-r--r--fs/inode.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/inode.c b/fs/inode.c
index 9aff7deaf816..93e7a5ecbc26 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -294,6 +294,18 @@ void __iget(struct inode *inode)
294 inodes_stat.nr_unused--; 294 inodes_stat.nr_unused--;
295} 295}
296 296
297void end_writeback(struct inode *inode)
298{
299 might_sleep();
300 BUG_ON(inode->i_data.nrpages);
301 BUG_ON(!list_empty(&inode->i_data.private_list));
302 BUG_ON(!(inode->i_state & I_FREEING));
303 BUG_ON(inode->i_state & I_CLEAR);
304 inode_sync_wait(inode);
305 inode->i_state = I_FREEING | I_CLEAR;
306}
307EXPORT_SYMBOL(end_writeback);
308
297/** 309/**
298 * clear_inode - clear an inode 310 * clear_inode - clear an inode
299 * @inode: inode to clear 311 * @inode: inode to clear