diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-07-18 17:17:09 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2010-07-26 17:09:02 -0400 |
commit | 40e2e97316af6e62affab7a392e792494b8d9dde (patch) | |
tree | 981ce3b464467893683d47f52ae5d35fdd32d46a /fs/xfs/linux-2.6 | |
parent | 696123fca877905696591829c97a2cef11c8d048 (diff) |
direct-io: move aio_complete into ->end_io
Filesystems with unwritten extent support must not complete an AIO request
until the transaction to convert the extent has been commited. That means
the aio_complete calls needs to be moved into the ->end_io callback so
that the filesystem can control when to call it exactly.
This makes a bit of a mess out of dio_complete and the ->end_io callback
prototype even more complicated.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_aops.c | 7 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_aops.h | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index 8abbf0532ea1..95d1e2695c3a 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c | |||
@@ -1406,7 +1406,9 @@ xfs_end_io_direct( | |||
1406 | struct kiocb *iocb, | 1406 | struct kiocb *iocb, |
1407 | loff_t offset, | 1407 | loff_t offset, |
1408 | ssize_t size, | 1408 | ssize_t size, |
1409 | void *private) | 1409 | void *private, |
1410 | int ret, | ||
1411 | bool is_async) | ||
1410 | { | 1412 | { |
1411 | xfs_ioend_t *ioend = iocb->private; | 1413 | xfs_ioend_t *ioend = iocb->private; |
1412 | 1414 | ||
@@ -1452,6 +1454,9 @@ xfs_end_io_direct( | |||
1452 | * against double-freeing. | 1454 | * against double-freeing. |
1453 | */ | 1455 | */ |
1454 | iocb->private = NULL; | 1456 | iocb->private = NULL; |
1457 | |||
1458 | if (is_async) | ||
1459 | aio_complete(iocb, ret, 0); | ||
1455 | } | 1460 | } |
1456 | 1461 | ||
1457 | STATIC ssize_t | 1462 | STATIC ssize_t |
diff --git a/fs/xfs/linux-2.6/xfs_aops.h b/fs/xfs/linux-2.6/xfs_aops.h index 319da173cc1a..c5057fb6237a 100644 --- a/fs/xfs/linux-2.6/xfs_aops.h +++ b/fs/xfs/linux-2.6/xfs_aops.h | |||
@@ -37,6 +37,8 @@ typedef struct xfs_ioend { | |||
37 | size_t io_size; /* size of the extent */ | 37 | size_t io_size; /* size of the extent */ |
38 | xfs_off_t io_offset; /* offset in the file */ | 38 | xfs_off_t io_offset; /* offset in the file */ |
39 | struct work_struct io_work; /* xfsdatad work queue */ | 39 | struct work_struct io_work; /* xfsdatad work queue */ |
40 | struct kiocb *io_iocb; | ||
41 | int io_result; | ||
40 | } xfs_ioend_t; | 42 | } xfs_ioend_t; |
41 | 43 | ||
42 | extern const struct address_space_operations xfs_address_space_operations; | 44 | extern const struct address_space_operations xfs_address_space_operations; |