diff options
author | Michal Hocko <mhocko@suse.com> | 2016-10-11 22:56:01 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-12 00:06:33 +0200 |
commit | 5114a97a8bce7f4ead29a32b67dee85438699b9e (patch) | |
tree | 1033f6f06e9d19d79271a82f09b9d43114953a42 /fs/afs | |
parent | treewide: remove redundant #include <linux/kconfig.h> (diff) | |
download | linux-5114a97a8bce7f4ead29a32b67dee85438699b9e.tar.xz linux-5114a97a8bce7f4ead29a32b67dee85438699b9e.zip |
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/afs')
-rw-r--r-- | fs/afs/write.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/afs/write.c b/fs/afs/write.c index 14d506efd1aa..f865c3f05bea 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -398,8 +398,7 @@ no_more: switch (ret) { case -EDQUOT: case -ENOSPC: - set_bit(AS_ENOSPC, - &wb->vnode->vfs_inode.i_mapping->flags); + mapping_set_error(wb->vnode->vfs_inode.i_mapping, -ENOSPC); break; case -EROFS: case -EIO: @@ -409,7 +408,7 @@ no_more: case -ENOMEDIUM: case -ENXIO: afs_kill_pages(wb->vnode, true, first, last); - set_bit(AS_EIO, &wb->vnode->vfs_inode.i_mapping->flags); + mapping_set_error(wb->vnode->vfs_inode.i_mapping, -EIO); break; case -EACCES: case -EPERM: |