aboutsummaryrefslogtreecommitdiffstats
path: root/fs/buffer.c
diff options
context:
space:
mode:
authorMichal Hocko <mhocko@suse.com>2016-10-11 16:56:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-11 18:06:33 -0400
commit5114a97a8bce7f4ead29a32b67dee85438699b9e (patch)
tree1033f6f06e9d19d79271a82f09b9d43114953a42 /fs/buffer.c
parent97139d4a6f26445de47b378cddd5192c0278f863 (diff)
fs: use mapping_set_error instead of opencoded set_bit
The mapping_set_error() helper sets the correct AS_ flag for the mapping so there is no reason to open code it. Use the helper directly. [akpm@linux-foundation.org: be honest about conversion from -ENXIO to -EIO] Link: http://lkml.kernel.org/r/20160912111608.2588-2-mhocko@kernel.org Signed-off-by: Michal Hocko <mhocko@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 7dad8713fac8..b205a629001d 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -351,7 +351,7 @@ void end_buffer_async_write(struct buffer_head *bh, int uptodate)
351 set_buffer_uptodate(bh); 351 set_buffer_uptodate(bh);
352 } else { 352 } else {
353 buffer_io_error(bh, ", lost async page write"); 353 buffer_io_error(bh, ", lost async page write");
354 set_bit(AS_EIO, &page->mapping->flags); 354 mapping_set_error(page->mapping, -EIO);
355 set_buffer_write_io_error(bh); 355 set_buffer_write_io_error(bh);
356 clear_buffer_uptodate(bh); 356 clear_buffer_uptodate(bh);
357 SetPageError(page); 357 SetPageError(page);
@@ -3249,7 +3249,7 @@ drop_buffers(struct page *page, struct buffer_head **buffers_to_free)
3249 bh = head; 3249 bh = head;
3250 do { 3250 do {
3251 if (buffer_write_io_error(bh) && page->mapping) 3251 if (buffer_write_io_error(bh) && page->mapping)
3252 set_bit(AS_EIO, &page->mapping->flags); 3252 mapping_set_error(page->mapping, -EIO);
3253 if (buffer_busy(bh)) 3253 if (buffer_busy(bh))
3254 goto failed; 3254 goto failed;
3255 bh = bh->b_this_page; 3255 bh = bh->b_this_page;