Commit 60af4464 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] mpage_writepages() cleanup

Rework the code layout a bit.  No logic change.
parent 082825b6
......@@ -650,8 +650,12 @@ mpage_writepages(struct address_space *mapping,
if (wbc->sync_mode != WB_SYNC_NONE)
wait_on_page_writeback(page);
if (page->mapping == mapping && !PageWriteback(page) &&
clear_page_dirty_for_io(page)) {
if (page->mapping != mapping || PageWriteback(page) ||
!clear_page_dirty_for_io(page)) {
unlock_page(page);
continue;
}
if (writepage) {
ret = (*writepage)(page, wbc);
if (ret) {
......@@ -663,20 +667,15 @@ mpage_writepages(struct address_space *mapping,
&mapping->flags);
}
} else {
bio = mpage_writepage(bio, page,
get_block, &last_block_in_bio,
&ret, wbc);
bio = mpage_writepage(bio, page, get_block,
&last_block_in_bio, &ret, wbc);
}
if (ret || (--(wbc->nr_to_write) <= 0))
done = 1;
if (wbc->nonblocking &&
bdi_write_congested(bdi)) {
if (wbc->nonblocking && bdi_write_congested(bdi)) {
wbc->encountered_congestion = 1;
done = 1;
}
} else {
unlock_page(page);
}
}
pagevec_release(&pvec);
cond_resched();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment