diff options
Diffstat (limited to 'fs/fs-writeback.c')
-rw-r--r-- | fs/fs-writeback.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 300324bd563c..0b3064079fa5 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -284,7 +284,17 @@ __sync_single_inode(struct inode *inode, struct writeback_control *wbc) | |||
284 | * soon as the queue becomes uncongested. | 284 | * soon as the queue becomes uncongested. |
285 | */ | 285 | */ |
286 | inode->i_state |= I_DIRTY_PAGES; | 286 | inode->i_state |= I_DIRTY_PAGES; |
287 | requeue_io(inode); | 287 | if (wbc->nr_to_write <= 0) { |
288 | /* | ||
289 | * slice used up: queue for next turn | ||
290 | */ | ||
291 | requeue_io(inode); | ||
292 | } else { | ||
293 | /* | ||
294 | * somehow blocked: retry later | ||
295 | */ | ||
296 | redirty_tail(inode); | ||
297 | } | ||
288 | } else { | 298 | } else { |
289 | /* | 299 | /* |
290 | * Otherwise fully redirty the inode so that | 300 | * Otherwise fully redirty the inode so that |
@@ -334,9 +344,6 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc) | |||
334 | WARN_ON(inode->i_state & I_WILL_FREE); | 344 | WARN_ON(inode->i_state & I_WILL_FREE); |
335 | 345 | ||
336 | if ((wbc->sync_mode != WB_SYNC_ALL) && (inode->i_state & I_SYNC)) { | 346 | if ((wbc->sync_mode != WB_SYNC_ALL) && (inode->i_state & I_SYNC)) { |
337 | struct address_space *mapping = inode->i_mapping; | ||
338 | int ret; | ||
339 | |||
340 | /* | 347 | /* |
341 | * We're skipping this inode because it's locked, and we're not | 348 | * We're skipping this inode because it's locked, and we're not |
342 | * doing writeback-for-data-integrity. Move it to s_more_io so | 349 | * doing writeback-for-data-integrity. Move it to s_more_io so |
@@ -345,15 +352,7 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc) | |||
345 | * completed a full scan of s_io. | 352 | * completed a full scan of s_io. |
346 | */ | 353 | */ |
347 | requeue_io(inode); | 354 | requeue_io(inode); |
348 | 355 | return 0; | |
349 | /* | ||
350 | * Even if we don't actually write the inode itself here, | ||
351 | * we can at least start some of the data writeout.. | ||
352 | */ | ||
353 | spin_unlock(&inode_lock); | ||
354 | ret = do_writepages(mapping, wbc); | ||
355 | spin_lock(&inode_lock); | ||
356 | return ret; | ||
357 | } | 356 | } |
358 | 357 | ||
359 | /* | 358 | /* |
@@ -479,8 +478,12 @@ sync_sb_inodes(struct super_block *sb, struct writeback_control *wbc) | |||
479 | iput(inode); | 478 | iput(inode); |
480 | cond_resched(); | 479 | cond_resched(); |
481 | spin_lock(&inode_lock); | 480 | spin_lock(&inode_lock); |
482 | if (wbc->nr_to_write <= 0) | 481 | if (wbc->nr_to_write <= 0) { |
482 | wbc->more_io = 1; | ||
483 | break; | 483 | break; |
484 | } | ||
485 | if (!list_empty(&sb->s_more_io)) | ||
486 | wbc->more_io = 1; | ||
484 | } | 487 | } |
485 | return; /* Leave any unwritten inodes on s_io */ | 488 | return; /* Leave any unwritten inodes on s_io */ |
486 | } | 489 | } |