const: struct quota_format_ops
[safe/jmp/linux-2.6] / fs / direct-io.c
index 8b10b87..b912270 100644 (file)
@@ -1028,9 +1028,6 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode,
        if (dio->bio)
                dio_bio_submit(dio);
 
-       /* All IO is now issued, send it on its way */
-       blk_run_address_space(inode->i_mapping);
-
        /*
         * It is possible that, we return short IO due to end of file.
         * In that case, we need to release all the pages we got hold on.
@@ -1057,8 +1054,11 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode,
            ((rw & READ) || (dio->result == dio->size)))
                ret = -EIOCBQUEUED;
 
-       if (ret != -EIOCBQUEUED)
+       if (ret != -EIOCBQUEUED) {
+               /* All IO is now issued, send it on its way */
+               blk_run_address_space(inode->i_mapping);
                dio_await_completion(dio);
+       }
 
        /*
         * Sync will always be dropping the final ref and completing the
@@ -1124,7 +1124,7 @@ __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
        int acquire_i_mutex = 0;
 
        if (rw & WRITE)
-               rw = WRITE_ODIRECT;
+               rw = WRITE_ODIRECT_PLUG;
 
        if (bdev)
                bdev_blkbits = blksize_bits(bdev_logical_block_size(bdev));