From 5114a97a8bce7f4ead29a32b67dee85438699b9e Mon Sep 17 00:00:00 2001 From: Michal Hocko Date: Tue, 11 Oct 2016 13:56:01 -0700 Subject: 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/staging/lustre/lustre/llite/vvp_page.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'drivers/staging') diff --git a/drivers/staging/lustre/lustre/llite/vvp_page.c b/drivers/staging/lustre/lustre/llite/vvp_page.c index 5d79efc1aafe..046e84d7a158 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_page.c +++ b/drivers/staging/lustre/lustre/llite/vvp_page.c @@ -241,10 +241,7 @@ static void vvp_vmpage_error(struct inode *inode, struct page *vmpage, int ioret obj->vob_discard_page_warned = 0; } else { SetPageError(vmpage); - if (ioret == -ENOSPC) - set_bit(AS_ENOSPC, &inode->i_mapping->flags); - else - set_bit(AS_EIO, &inode->i_mapping->flags); + mapping_set_error(inode->i_mapping, ioret); if ((ioret == -ESHUTDOWN || ioret == -EINTR) && obj->vob_discard_page_warned == 0) { -- cgit v1.2.3