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, ...@@ -650,8 +650,12 @@ mpage_writepages(struct address_space *mapping,
if (wbc->sync_mode != WB_SYNC_NONE) if (wbc->sync_mode != WB_SYNC_NONE)
wait_on_page_writeback(page); wait_on_page_writeback(page);
if (page->mapping == mapping && !PageWriteback(page) && if (page->mapping != mapping || PageWriteback(page) ||
clear_page_dirty_for_io(page)) { !clear_page_dirty_for_io(page)) {
unlock_page(page);
continue;
}
if (writepage) { if (writepage) {
ret = (*writepage)(page, wbc); ret = (*writepage)(page, wbc);
if (ret) { if (ret) {
...@@ -663,20 +667,15 @@ mpage_writepages(struct address_space *mapping, ...@@ -663,20 +667,15 @@ mpage_writepages(struct address_space *mapping,
&mapping->flags); &mapping->flags);
} }
} else { } else {
bio = mpage_writepage(bio, page, bio = mpage_writepage(bio, page, get_block,
get_block, &last_block_in_bio, &last_block_in_bio, &ret, wbc);
&ret, wbc);
} }
if (ret || (--(wbc->nr_to_write) <= 0)) if (ret || (--(wbc->nr_to_write) <= 0))
done = 1; done = 1;
if (wbc->nonblocking && if (wbc->nonblocking && bdi_write_congested(bdi)) {
bdi_write_congested(bdi)) {
wbc->encountered_congestion = 1; wbc->encountered_congestion = 1;
done = 1; done = 1;
} }
} else {
unlock_page(page);
}
} }
pagevec_release(&pvec); pagevec_release(&pvec);
cond_resched(); 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