fs/direct-io.c: remove some left over checks
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 3 Apr 2014 21:47:17 +0000 (14:47 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 3 Apr 2014 23:20:57 +0000 (16:20 -0700)
We know that "ret > 0" is true here.  These tests were left over from
commit 02afc27faec9 ('direct-io: Handle O_(D)SYNC AIO') and aren't
needed any more.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/block_dev.c
fs/btrfs/file.c
fs/ext4/file.c

index 1e86823a9cbda37f8451269d91a50f90d00c9566..e4cba21a627ea01d43d7fd99ddb6627b8650292a 100644 (file)
@@ -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);
index 0165b8672f099c49f96400fc0c87cc0b7cfc4532..7331a230e30b2531a1d94d8c13c628d1afa992fd 100644 (file)
@@ -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;
        }
 
index 1a5073959f322655b93ade8189107b9148d244ed..6db7f7db7777dffc4e4e0d959bf295dc0a03a6d8 100644 (file)
@@ -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);