summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@gmx.com>2019-04-23 08:08:35 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2019-05-09 07:23:12 +0300
commitd5d5f0c0c9160f00dd0729ebd3c46e31acc26672 (patch)
tree60236449c31bd6708608aca9784a8670da2cc4b9 /fs/f2fs
parentf5a131bb236d0283436842f0b07d23d401b2811d (diff)
downloadlinux-d5d5f0c0c9160f00dd0729ebd3c46e31acc26672.tar.xz
f2fs: remove redundant check in f2fs_file_write_iter()
We have already checked flag IOCB_DIRECT in the sanity check of flag IOCB_NOWAIT, so don't have to check it again here. Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/file.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 920d66fc2c89..e5fa1940ed3c 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -3063,20 +3063,16 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
if (iov_iter_fault_in_readable(from, iov_iter_count(from)))
set_inode_flag(inode, FI_NO_PREALLOC);
- if ((iocb->ki_flags & IOCB_NOWAIT) &&
- (iocb->ki_flags & IOCB_DIRECT)) {
- if (!f2fs_overwrite_io(inode, iocb->ki_pos,
+ if ((iocb->ki_flags & IOCB_NOWAIT)) {
+ if (!f2fs_overwrite_io(inode, iocb->ki_pos,
iov_iter_count(from)) ||
- f2fs_has_inline_data(inode) ||
- f2fs_force_buffered_io(inode,
- iocb, from)) {
- clear_inode_flag(inode,
- FI_NO_PREALLOC);
- inode_unlock(inode);
- ret = -EAGAIN;
- goto out;
- }
-
+ f2fs_has_inline_data(inode) ||
+ f2fs_force_buffered_io(inode, iocb, from)) {
+ clear_inode_flag(inode, FI_NO_PREALLOC);
+ inode_unlock(inode);
+ ret = -EAGAIN;
+ goto out;
+ }
} else {
preallocated = true;
target_size = iocb->ki_pos + iov_iter_count(from);