xfs: allow appending aio writes
authorChristoph Hellwig <hch@infradead.org>
Sun, 9 Feb 2014 23:28:04 +0000 (10:28 +1100)
committerDave Chinner <david@fromorbit.com>
Sun, 9 Feb 2014 23:28:04 +0000 (10:28 +1100)
XFS can easily support appending aio writes by ensuring we always allocate
blocks as unwritten extents when performing direct I/O writes and only
converting them to written extents at I/O completion.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_aops.c

index db2cfb0..ef62c6b 100644 (file)
@@ -1441,7 +1441,8 @@ xfs_vm_direct_IO(
                ret = __blockdev_direct_IO(rw, iocb, inode, bdev, iov,
                                            offset, nr_segs,
                                            xfs_get_blocks_direct,
-                                           xfs_end_io_direct_write, NULL, 0);
+                                           xfs_end_io_direct_write, NULL,
+                                           DIO_ASYNC_EXTEND);
                if (ret != -EIOCBQUEUED && iocb->private)
                        goto out_destroy_ioend;
        } else {