提交 45d4f855 编写于 作者: D Dan Carpenter 提交者: Linus Torvalds

fs/direct-io.c: remove some left over checks

We know that "ret > 0" is true here.  These tests were left over from
commit 02afc27f ('direct-io: Handle O_(D)SYNC AIO') and aren't
needed any more.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 2b665e27
......@@ -1523,7 +1523,7 @@ ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
ssize_t err;
err = generic_write_sync(file, pos, ret);
if (err < 0 && ret > 0)
if (err < 0)
ret = err;
}
blk_finish_plug(&plug);
......
......@@ -1797,7 +1797,7 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb,
BTRFS_I(inode)->last_sub_trans = root->log_transid;
if (num_written > 0) {
err = generic_write_sync(file, pos, num_written);
if (err < 0 && num_written > 0)
if (err < 0)
num_written = err;
}
......
......@@ -153,7 +153,7 @@ ext4_file_dio_write(struct kiocb *iocb, const struct iovec *iov,
ssize_t err;
err = generic_write_sync(file, iocb->ki_pos - ret, ret);
if (err < 0 && ret > 0)
if (err < 0)
ret = err;
}
blk_finish_plug(&plug);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册