Skip to content

Commit

Permalink
f2fs: remove duplicate code in f2fs_file_write_iter
Browse files Browse the repository at this point in the history
We will do the same check in generic_write_checks.
if (iocb->ki_flags & IOCB_NOWAIT) && !(iocb->ki_flags & IOCB_DIRECT)
        return -EINVAL;
just remove the same check in f2fs_file_write_iter.

Signed-off-by: Lihong Kou <koulihong@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
  • Loading branch information
Lihong Kou authored and Jaegeuk Kim committed Aug 23, 2019
1 parent d3a1a0e commit 0b86f78
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions fs/f2fs/file.c
Original file line number Diff line number Diff line change
@@ -3160,11 +3160,6 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
goto out;
}

if ((iocb->ki_flags & IOCB_NOWAIT) && !(iocb->ki_flags & IOCB_DIRECT)) {
ret = -EINVAL;
goto out;
}

if (!inode_trylock(inode)) {
if (iocb->ki_flags & IOCB_NOWAIT) {
ret = -EAGAIN;

0 comments on commit 0b86f78

Please sign in to comment.