OSDN Git Service

f2fs: remove duplicate code in f2fs_file_write_iter
authorLihong Kou <koulihong@huawei.com>
Mon, 5 Aug 2019 07:27:24 +0000 (15:27 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 23 Aug 2019 14:57:14 +0000 (07:57 -0700)
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>
fs/f2fs/file.c

index 16f39c0..b1f38f2 100644 (file)
@@ -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;