Merge tag 'writeback' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux
Pull writeback tree from Wu Fengguang: "Mainly from Jan Kara to avoid iput() in the flusher threads." * tag 'writeback' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux: writeback: Avoid iput() from flusher thread vfs: Rename end_writeback() to clear_inode() vfs: Move waiting for inode writeback from end_writeback() to evict_inode() writeback: Refactor writeback_single_inode() writeback: Remove wb->list_lock from writeback_single_inode() writeback: Separate inode requeueing after writeback writeback: Move I_DIRTY_PAGES handling writeback: Move requeueing when I_SYNC set to writeback_sb_inodes() writeback: Move clearing of I_SYNC into inode_sync_complete() writeback: initialize global_dirty_limit fs: remove 8 bytes of padding from struct writeback_control on 64 bit builds mm: page-writeback.c: local functions should not be exposed globally
This commit is contained in:
15
fs/inode.c
15
fs/inode.c
@@ -486,7 +486,7 @@ void __remove_inode_hash(struct inode *inode)
|
||||
}
|
||||
EXPORT_SYMBOL(__remove_inode_hash);
|
||||
|
||||
void end_writeback(struct inode *inode)
|
||||
void clear_inode(struct inode *inode)
|
||||
{
|
||||
might_sleep();
|
||||
/*
|
||||
@@ -500,11 +500,10 @@ void end_writeback(struct inode *inode)
|
||||
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);
|
||||
/* don't need i_lock here, no concurrent mods to i_state */
|
||||
inode->i_state = I_FREEING | I_CLEAR;
|
||||
}
|
||||
EXPORT_SYMBOL(end_writeback);
|
||||
EXPORT_SYMBOL(clear_inode);
|
||||
|
||||
/*
|
||||
* Free the inode passed in, removing it from the lists it is still connected
|
||||
@@ -531,12 +530,20 @@ static void evict(struct inode *inode)
|
||||
|
||||
inode_sb_list_del(inode);
|
||||
|
||||
/*
|
||||
* Wait for flusher thread to be done with the inode so that filesystem
|
||||
* does not start destroying it while writeback is still running. Since
|
||||
* the inode has I_FREEING set, flusher thread won't start new work on
|
||||
* the inode. We just have to wait for running writeback to finish.
|
||||
*/
|
||||
inode_wait_for_writeback(inode);
|
||||
|
||||
if (op->evict_inode) {
|
||||
op->evict_inode(inode);
|
||||
} else {
|
||||
if (inode->i_data.nrpages)
|
||||
truncate_inode_pages(&inode->i_data, 0);
|
||||
end_writeback(inode);
|
||||
clear_inode(inode);
|
||||
}
|
||||
if (S_ISBLK(inode->i_mode) && inode->i_bdev)
|
||||
bd_forget(inode);
|
||||
|
Reference in New Issue
Block a user