pata_scc: propagate return value of scc_wait_after_reset
[deliverable/linux.git] / fs / direct-io.c
index 194d0d122cae566b8e82c1a1bd3188499a467796..c3116404ab49a29c3b11fb53c175132f715750a5 100644 (file)
@@ -71,7 +71,6 @@ struct dio_submit {
                                           been performed at the start of a
                                           write */
        int pages_in_io;                /* approximate total IO pages */
-       size_t  size;                   /* total request size (doesn't change)*/
        sector_t block_in_file;         /* Current offset into the underlying
                                           file in dio_block units. */
        unsigned blocks_available;      /* At block_in_file.  changes */
@@ -159,7 +158,7 @@ static inline int dio_refill_pages(struct dio *dio, struct dio_submit *sdio)
 {
        ssize_t ret;
 
-       ret = iov_iter_get_pages(sdio->iter, dio->pages, DIO_PAGES * PAGE_SIZE,
+       ret = iov_iter_get_pages(sdio->iter, dio->pages, DIO_PAGES,
                                &sdio->from);
 
        if (ret < 0 && sdio->blocks_available && (dio->rw & WRITE)) {
@@ -1104,7 +1103,8 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
        unsigned blkbits = i_blkbits;
        unsigned blocksize_mask = (1 << blkbits) - 1;
        ssize_t retval = -EINVAL;
-       loff_t end = offset + iov_iter_count(iter);
+       size_t count = iov_iter_count(iter);
+       loff_t end = offset + count;
        struct dio *dio;
        struct dio_submit sdio = { 0, };
        struct buffer_head map_bh = { 0, };
@@ -1287,10 +1287,9 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
         */
        BUG_ON(retval == -EIOCBQUEUED);
        if (dio->is_async && retval == 0 && dio->result &&
-           ((rw == READ) || (dio->result == sdio.size)))
+           (rw == READ || dio->result == count))
                retval = -EIOCBQUEUED;
-
-       if (retval != -EIOCBQUEUED)
+       else
                dio_await_completion(dio);
 
        if (drop_refcount(dio) == 0) {
This page took 0.046197 seconds and 5 git commands to generate.