diff options
| author | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2014-06-04 16:07:45 -0700 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-05-24 02:20:24 +0200 |
| commit | ddc077272b19719f8592f8738929017d3742341b (patch) | |
| tree | 82f1c8c1d658017bb8a27d98f5081d132d6d4ae5 /fs/mpage.c | |
| parent | 7e1c81fc6ba03ac924d8b19c52a2b62fd2c9353a (diff) | |
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 <matthew.r.wilcox@intel.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dheeraj Reddy <dheeraj.reddy@intel.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Diffstat (limited to 'fs/mpage.c')
| -rw-r--r-- | fs/mpage.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/fs/mpage.c b/fs/mpage.c index fe608e66d..9a5c19c68 100644 --- a/fs/mpage.c +++ b/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); |
