mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
fs/mpage.c: factor page_endio() out of mpage_end_io()
page_endio() takes care of updating all the appropriate page flags once I/O has finished to a page. Switch to using mapping_set_error() instead of setting AS_EIO directly; this will handle thin-provisioned devices correctly. Signed-off-by: Matthew Wilcox <[email protected]> Cc: Dave Chinner <[email protected]> Cc: Dheeraj Reddy <[email protected]> Cc: Hugh Dickins <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
90768eee45
commit
57d998456a
3 changed files with 28 additions and 17 deletions
18
fs/mpage.c
18
fs/mpage.c
|
|
@ -48,23 +48,7 @@ static void mpage_end_io(struct bio *bio, int err)
|
|||
|
||||
bio_for_each_segment_all(bv, bio, i) {
|
||||
struct page *page = bv->bv_page;
|
||||
|
||||
if (bio_data_dir(bio) == READ) {
|
||||
if (!err) {
|
||||
SetPageUptodate(page);
|
||||
} else {
|
||||
ClearPageUptodate(page);
|
||||
SetPageError(page);
|
||||
}
|
||||
unlock_page(page);
|
||||
} else { /* bio_data_dir(bio) == WRITE */
|
||||
if (err) {
|
||||
SetPageError(page);
|
||||
if (page->mapping)
|
||||
set_bit(AS_EIO, &page->mapping->flags);
|
||||
}
|
||||
end_page_writeback(page);
|
||||
}
|
||||
page_endio(page, bio_data_dir(bio), err);
|
||||
}
|
||||
|
||||
bio_put(bio);
|
||||
|
|
|
|||
Loading…
Reference in a new issue