aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fs-writeback.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-26 15:53:20 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-26 15:53:20 -0500
commit4b89eed93e0fa40a63e3d7b1796ec1337ea7a3aa (patch)
tree7c3ad379a17df033501cb2c20921da65d0029002 /fs/fs-writeback.c
parentecdfc9787fe527491baefc22dce8b2dbd5b2908d (diff)
Write back inode data pages even when the inode itself is locked
In __writeback_single_inode(), when we find a locked inode and we're not doing a data-integrity sync, we used to just skip writing entirely, since we didn't want to wait for the inode to unlock. However, there's really no reason to skip writing the data pages, which are likely to be the the bulk of the dirty state anyway (and the main reason why writeback was started for the non-data-integrity case, of course!) Acked-by: Nick Piggin <nickpiggin@yahoo.com.au> Cc: Andrew Morton <akpm@osdl.org>, Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Hugh Dickins <hugh@veritas.com> Cc: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fs-writeback.c')
-rw-r--r--fs/fs-writeback.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index c403b66ec83c..a4b142a6a2c7 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -251,8 +251,19 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
251 WARN_ON(inode->i_state & I_WILL_FREE); 251 WARN_ON(inode->i_state & I_WILL_FREE);
252 252
253 if ((wbc->sync_mode != WB_SYNC_ALL) && (inode->i_state & I_LOCK)) { 253 if ((wbc->sync_mode != WB_SYNC_ALL) && (inode->i_state & I_LOCK)) {
254 struct address_space *mapping = inode->i_mapping;
255 int ret;
256
254 list_move(&inode->i_list, &inode->i_sb->s_dirty); 257 list_move(&inode->i_list, &inode->i_sb->s_dirty);
255 return 0; 258
259 /*
260 * Even if we don't actually write the inode itself here,
261 * we can at least start some of the data writeout..
262 */
263 spin_unlock(&inode_lock);
264 ret = do_writepages(mapping, wbc);
265 spin_lock(&inode_lock);
266 return ret;
256 } 267 }
257 268
258 /* 269 /*