diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2016-07-29 15:10:57 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2016-07-29 15:10:57 +0300 |
commit | 4a7f4e88fef171f989df9538c382d2b5063d21bb (patch) | |
tree | c9748e6d78adb07a196560d749a678a00a15929f /fs/fuse | |
parent | d72d9e2a5d7ec04a1f92925c5ac633d8031fa7fc (diff) | |
download | linux-4a7f4e88fef171f989df9538c382d2b5063d21bb.tar.xz |
fuse: use filemap_check_errors()
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse')
-rw-r--r-- | fs/fuse/file.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 594fb15fba9b..c6b6819d2f53 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -417,12 +417,7 @@ static int fuse_flush(struct file *file, fl_owner_t id) fuse_sync_writes(inode); inode_unlock(inode); - if (test_bit(AS_ENOSPC, &file->f_mapping->flags) && - test_and_clear_bit(AS_ENOSPC, &file->f_mapping->flags)) - err = -ENOSPC; - if (test_bit(AS_EIO, &file->f_mapping->flags) && - test_and_clear_bit(AS_EIO, &file->f_mapping->flags)) - err = -EIO; + err = filemap_check_errors(file->f_mapping); if (err) return err; @@ -477,12 +472,7 @@ int fuse_fsync_common(struct file *file, loff_t start, loff_t end, * filemap_write_and_wait_range() does not catch errors. * We have to do this directly after fuse_sync_writes() */ - if (test_bit(AS_ENOSPC, &file->f_mapping->flags) && - test_and_clear_bit(AS_ENOSPC, &file->f_mapping->flags)) - err = -ENOSPC; - if (test_bit(AS_EIO, &file->f_mapping->flags) && - test_and_clear_bit(AS_EIO, &file->f_mapping->flags)) - err = -EIO; + err = filemap_check_errors(file->f_mapping); if (err) goto out; |