The `last_bh' logic probably isn't worth much. In those situations where only
the front part of the page is being written out we will save some looping but
in the vastly more common case of an all-page writeout if just adds more code.
Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
int err;
sector_t block;
sector_t last_block;
- struct buffer_head *bh, *head, *last_bh = NULL;
+ struct buffer_head *bh, *head;
int nr_underway = 0;
BUG_ON(!PageLocked(page));
}
if (test_clear_buffer_dirty(bh)) {
mark_buffer_async_write(bh);
- last_bh = bh;
} else {
unlock_buffer(bh);
}
if (buffer_async_write(bh)) {
submit_bh(WRITE, bh);
nr_underway++;
- if (bh == last_bh)
- break;
}
bh = next;
} while (bh != head);
- bh = head;
unlock_page(page);
err = 0;
if (buffer_mapped(bh) && buffer_dirty(bh)) {
lock_buffer(bh);
mark_buffer_async_write(bh);
- last_bh = bh;
} else {
/*
* The buffer may have been set dirty during
clear_buffer_dirty(bh);
submit_bh(WRITE, bh);
nr_underway++;
- if (bh == last_bh)
- break;
}
bh = next;
} while (bh != head);
- bh = head;
goto done;
}