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,32 +650,31 @@ mpage_writepages(struct address_space *mapping, ...@@ -650,32 +650,31 @@ 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)) {
if (writepage) { unlock_page(page);
ret = (*writepage)(page, wbc); continue;
if (ret) { }
if (ret == -ENOSPC)
set_bit(AS_ENOSPC, if (writepage) {
&mapping->flags); ret = (*writepage)(page, wbc);
else if (ret) {
set_bit(AS_EIO, if (ret == -ENOSPC)
&mapping->flags); set_bit(AS_ENOSPC,
} &mapping->flags);
} else { else
bio = mpage_writepage(bio, page, set_bit(AS_EIO,
get_block, &last_block_in_bio, &mapping->flags);
&ret, wbc);
}
if (ret || (--(wbc->nr_to_write) <= 0))
done = 1;
if (wbc->nonblocking &&
bdi_write_congested(bdi)) {
wbc->encountered_congestion = 1;
done = 1;
} }
} else { } else {
unlock_page(page); 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)) {
wbc->encountered_congestion = 1;
done = 1;
} }
} }
pagevec_release(&pvec); pagevec_release(&pvec);
......
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