diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-28 12:54:45 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-28 12:54:45 -0400 |
| commit | 90324cc1b11a211e37eabd8cb863e1a1561d6b1d (patch) | |
| tree | c8b79c6850420a114ca6660c1b44fc486b1ba86d | |
| parent | fb8b00675eb6462aacab56bca31ed6107bda5314 (diff) | |
| parent | 169ebd90131b2ffca74bb2dbe7eeacd39fb83714 (diff) | |
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
56 files changed, 319 insertions, 220 deletions
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting index 74acd9618819..8c91d1057d9a 100644 --- a/Documentation/filesystems/porting +++ b/Documentation/filesystems/porting | |||
| @@ -297,7 +297,8 @@ in the beginning of ->setattr unconditionally. | |||
| 297 | be used instead. It gets called whenever the inode is evicted, whether it has | 297 | be used instead. It gets called whenever the inode is evicted, whether it has |
| 298 | remaining links or not. Caller does *not* evict the pagecache or inode-associated | 298 | remaining links or not. Caller does *not* evict the pagecache or inode-associated |
| 299 | metadata buffers; getting rid of those is responsibility of method, as it had | 299 | metadata buffers; getting rid of those is responsibility of method, as it had |
| 300 | been for ->delete_inode(). | 300 | been for ->delete_inode(). Caller makes sure async writeback cannot be running |
| 301 | for the inode while (or after) ->evict_inode() is called. | ||
| 301 | 302 | ||
| 302 | ->drop_inode() returns int now; it's called on final iput() with | 303 | ->drop_inode() returns int now; it's called on final iput() with |
| 303 | inode->i_lock held and it returns true if filesystems wants the inode to be | 304 | inode->i_lock held and it returns true if filesystems wants the inode to be |
| @@ -306,14 +307,11 @@ updated appropriately. generic_delete_inode() is also alive and it consists | |||
| 306 | simply of return 1. Note that all actual eviction work is done by caller after | 307 | simply of return 1. Note that all actual eviction work is done by caller after |
| 307 | ->drop_inode() returns. | 308 | ->drop_inode() returns. |
| 308 | 309 | ||
| 309 | clear_inode() is gone; use end_writeback() instead. As before, it must | 310 | As before, clear_inode() must be called exactly once on each call of |
| 310 | be called exactly once on each call of ->evict_inode() (as it used to be for | 311 | ->evict_inode() (as it used to be for each call of ->delete_inode()). Unlike |
| 311 | each call of ->delete_inode()). Unlike before, if you are using inode-associated | 312 | before, if you are using inode-associated metadata buffers (i.e. |
| 312 | metadata buffers (i.e. mark_buffer_dirty_inode()), it's your responsibility to | 313 | mark_buffer_dirty_inode()), it's your responsibility to call |
| 313 | call invalidate_inode_buffers() before end_writeback(). | 314 | invalidate_inode_buffers() before clear_inode(). |
| 314 | No async writeback (and thus no calls of ->write_inode()) will happen | ||
| 315 | after end_writeback() returns, so actions that should not overlap with ->write_inode() | ||
| 316 | (e.g. freeing on-disk inode if i_nlink is 0) ought to be done after that call. | ||
| 317 | 315 | ||
| 318 | NOTE: checking i_nlink in the beginning of ->write_inode() and bailing out | 316 | NOTE: checking i_nlink in the beginning of ->write_inode() and bailing out |
| 319 | if it's zero is not *and* *never* *had* *been* enough. Final unlink() and iput() | 317 | if it's zero is not *and* *never* *had* *been* enough. Final unlink() and iput() |
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 1d75c92ea8fb..66519d263da7 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
| @@ -151,7 +151,7 @@ static void | |||
| 151 | spufs_evict_inode(struct inode *inode) | 151 | spufs_evict_inode(struct inode *inode) |
| 152 | { | 152 | { |
| 153 | struct spufs_inode_info *ei = SPUFS_I(inode); | 153 | struct spufs_inode_info *ei = SPUFS_I(inode); |
| 154 | end_writeback(inode); | 154 | clear_inode(inode); |
| 155 | if (ei->i_ctx) | 155 | if (ei->i_ctx) |
| 156 | put_spu_context(ei->i_ctx); | 156 | put_spu_context(ei->i_ctx); |
| 157 | if (ei->i_gang) | 157 | if (ei->i_gang) |
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index 6a2cb560e968..73dae8b9b77a 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c | |||
| @@ -115,7 +115,7 @@ static struct inode *hypfs_make_inode(struct super_block *sb, umode_t mode) | |||
| 115 | 115 | ||
| 116 | static void hypfs_evict_inode(struct inode *inode) | 116 | static void hypfs_evict_inode(struct inode *inode) |
| 117 | { | 117 | { |
| 118 | end_writeback(inode); | 118 | clear_inode(inode); |
| 119 | kfree(inode->i_private); | 119 | kfree(inode->i_private); |
| 120 | } | 120 | } |
| 121 | 121 | ||
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 014c8dd62962..57ccb7537dae 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
| @@ -448,7 +448,7 @@ void v9fs_evict_inode(struct inode *inode) | |||
| 448 | struct v9fs_inode *v9inode = V9FS_I(inode); | 448 | struct v9fs_inode *v9inode = V9FS_I(inode); |
| 449 | 449 | ||
| 450 | truncate_inode_pages(inode->i_mapping, 0); | 450 | truncate_inode_pages(inode->i_mapping, 0); |
| 451 | end_writeback(inode); | 451 | clear_inode(inode); |
| 452 | filemap_fdatawrite(inode->i_mapping); | 452 | filemap_fdatawrite(inode->i_mapping); |
| 453 | 453 | ||
| 454 | #ifdef CONFIG_9P_FSCACHE | 454 | #ifdef CONFIG_9P_FSCACHE |
diff --git a/fs/affs/inode.c b/fs/affs/inode.c index 88a4b0b50058..8bc4a59f4e7e 100644 --- a/fs/affs/inode.c +++ b/fs/affs/inode.c | |||
| @@ -264,7 +264,7 @@ affs_evict_inode(struct inode *inode) | |||
| 264 | } | 264 | } |
| 265 | 265 | ||
| 266 | invalidate_inode_buffers(inode); | 266 | invalidate_inode_buffers(inode); |
| 267 | end_writeback(inode); | 267 | clear_inode(inode); |
| 268 | affs_free_prealloc(inode); | 268 | affs_free_prealloc(inode); |
| 269 | cache_page = (unsigned long)AFFS_I(inode)->i_lc; | 269 | cache_page = (unsigned long)AFFS_I(inode)->i_lc; |
| 270 | if (cache_page) { | 270 | if (cache_page) { |
diff --git a/fs/afs/inode.c b/fs/afs/inode.c index d890ae3b2ce6..95cffd38239f 100644 --- a/fs/afs/inode.c +++ b/fs/afs/inode.c | |||
| @@ -423,7 +423,7 @@ void afs_evict_inode(struct inode *inode) | |||
| 423 | ASSERTCMP(inode->i_ino, ==, vnode->fid.vnode); | 423 | ASSERTCMP(inode->i_ino, ==, vnode->fid.vnode); |
| 424 | 424 | ||
| 425 | truncate_inode_pages(&inode->i_data, 0); | 425 | truncate_inode_pages(&inode->i_data, 0); |
| 426 | end_writeback(inode); | 426 | clear_inode(inode); |
| 427 | 427 | ||
| 428 | afs_give_up_callback(vnode); | 428 | afs_give_up_callback(vnode); |
| 429 | 429 | ||
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index 6e488ebe7784..8a4fed8ead30 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c | |||
| @@ -100,7 +100,7 @@ static int autofs4_show_options(struct seq_file *m, struct dentry *root) | |||
| 100 | 100 | ||
| 101 | static void autofs4_evict_inode(struct inode *inode) | 101 | static void autofs4_evict_inode(struct inode *inode) |
| 102 | { | 102 | { |
| 103 | end_writeback(inode); | 103 | clear_inode(inode); |
| 104 | kfree(inode->i_private); | 104 | kfree(inode->i_private); |
| 105 | } | 105 | } |
| 106 | 106 | ||
diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index e23dc7c8b884..9870417c26e7 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c | |||
| @@ -174,7 +174,7 @@ static void bfs_evict_inode(struct inode *inode) | |||
| 174 | 174 | ||
