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>
This commit is contained in:
parent
b6bb1574fc
commit
9ca2000e9d
1 changed files with 9 additions and 13 deletions
|
@ -2839,20 +2839,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)))
|
if (iov_iter_fault_in_readable(from, iov_iter_count(from)))
|
||||||
set_inode_flag(inode, FI_NO_PREALLOC);
|
set_inode_flag(inode, FI_NO_PREALLOC);
|
||||||
|
|
||||||
if ((iocb->ki_flags & IOCB_NOWAIT) &&
|
if ((iocb->ki_flags & IOCB_NOWAIT)) {
|
||||||
(iocb->ki_flags & IOCB_DIRECT)) {
|
if (!f2fs_overwrite_io(inode, iocb->ki_pos,
|
||||||
if (!f2fs_overwrite_io(inode, iocb->ki_pos,
|
|
||||||
iov_iter_count(from)) ||
|
iov_iter_count(from)) ||
|
||||||
f2fs_has_inline_data(inode) ||
|
f2fs_has_inline_data(inode) ||
|
||||||
f2fs_force_buffered_io(inode,
|
f2fs_force_buffered_io(inode, iocb, from)) {
|
||||||
iocb, from)) {
|
clear_inode_flag(inode, FI_NO_PREALLOC);
|
||||||
clear_inode_flag(inode,
|
inode_unlock(inode);
|
||||||
FI_NO_PREALLOC);
|
ret = -EAGAIN;
|
||||||
inode_unlock(inode);
|
goto out;
|
||||||
ret = -EAGAIN;
|
}
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
preallocated = true;
|
preallocated = true;
|
||||||
target_size = iocb->ki_pos + iov_iter_count(from);
|
target_size = iocb->ki_pos + iov_iter_count(from);
|
||||||
|
|
Loading…
Add table
Reference in a new issue