Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 166336
b: refs/heads/master
c: 71fd05a
h: refs/heads/master
v: v3
  • Loading branch information
Jens Axboe committed Sep 25, 2009
1 parent 4323e55 commit 97df898
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ae1b7f7d4b9ea587fda95c38301f4e72e8146634
refs/heads/master: 71fd05a887e0f3f6bfff76ff81b33776177d0606
43 changes: 23 additions & 20 deletions trunk/fs/fs-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,29 +750,32 @@ static long wb_writeback(struct bdi_writeback *wb,
wrote += MAX_WRITEBACK_PAGES - wbc.nr_to_write;

/*
* If we ran out of stuff to write, bail unless more_io got set
* If we consumed everything, see if we have more
*/
if (wbc.nr_to_write > 0) {
if (wbc.more_io) {
if (wbc.nr_to_write < MAX_WRITEBACK_PAGES)
continue;
/*
* Nothing written. Wait for some inode to
* become available for writeback. Otherwise
* we'll just busyloop.
*/
spin_lock(&inode_lock);
if (!list_empty(&wb->b_more_io)) {
inode = list_entry(
wb->b_more_io.prev,
struct inode, i_list);
inode_wait_for_writeback(inode);
}
spin_unlock(&inode_lock);
continue;
}
if (wbc.nr_to_write <= 0)
continue;
/*
* Didn't write everything and we don't have more IO, bail
*/
if (!wbc.more_io)
break;
/*
* Did we write something? Try for more
*/
if (wbc.nr_to_write < MAX_WRITEBACK_PAGES)
continue;
/*
* Nothing written. Wait for some inode to
* become available for writeback. Otherwise
* we'll just busyloop.
*/
spin_lock(&inode_lock);
if (!list_empty(&wb->b_more_io)) {
inode = list_entry(wb->b_more_io.prev,
struct inode, i_list);
inode_wait_for_writeback(inode);
}
spin_unlock(&inode_lock);
}

return wrote;
Expand Down

0 comments on commit 97df898

Please sign in to comment.