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/ocfs2 | |
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/ocfs2')
-rw-r--r-- | fs/ocfs2/aops.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 356e976772bf..96337a4fbbdf 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
@@ -578,7 +578,9 @@ bail: | |||
578 | static void ocfs2_dio_end_io(struct kiocb *iocb, | 578 | static void ocfs2_dio_end_io(struct kiocb *iocb, |
579 | loff_t offset, | 579 | loff_t offset, |
580 | ssize_t bytes, | 580 | ssize_t bytes, |
581 | void *private) | 581 | void *private, |
582 | int ret, | ||
583 | bool is_async) | ||
582 | { | 584 | { |
583 | struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; | 585 | struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; |
584 | int level; | 586 | int level; |
@@ -592,6 +594,9 @@ static void ocfs2_dio_end_io(struct kiocb *iocb, | |||
592 | if (!level) | 594 | if (!level) |
593 | up_read(&inode->i_alloc_sem); | 595 | up_read(&inode->i_alloc_sem); |
594 | ocfs2_rw_unlock(inode, level); | 596 | ocfs2_rw_unlock(inode, level); |
597 | |||
598 | if (is_async) | ||
599 | aio_complete(iocb, ret, 0); | ||
595 | } | 600 | } |
596 | 601 | ||
597 | /* | 602 | /* |