提交 d5d5f0c0 编写于 作者: C Chengguang Xu 提交者: Jaegeuk Kim

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: NChengguang Xu <cgxu519@gmx.com>
Reviewed-by: NChao Yu <yuchao0@huawei.com>
Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
上级 f5a131bb
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册