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>
This commit is contained in:
committed by
Alex Elder
parent
696123fca8
commit
40e2e97316
@@ -1406,7 +1406,9 @@ xfs_end_io_direct(
|
||||
struct kiocb *iocb,
|
||||
loff_t offset,
|
||||
ssize_t size,
|
||||
void *private)
|
||||
void *private,
|
||||
int ret,
|
||||
bool is_async)
|
||||
{
|
||||
xfs_ioend_t *ioend = iocb->private;
|
||||
|
||||
@@ -1452,6 +1454,9 @@ xfs_end_io_direct(
|
||||
* against double-freeing.
|
||||
*/
|
||||
iocb->private = NULL;
|
||||
|
||||
if (is_async)
|
||||
aio_complete(iocb, ret, 0);
|
||||
}
|
||||
|
||||
STATIC ssize_t
|
||||
|
Reference in New Issue
Block a user