aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-07-27 11:56:06 -0400
committerTheodore Ts'o <tytso@mit.edu>2010-07-27 11:56:06 -0400
commit552ef8024f909d9b3a7442d0ab0d48a22de24e9e (patch)
tree868af331b76e12c8d17b8449094065a069e0d759 /fs/ocfs2
parent5c521830cf3dfcf7638d409d8e02ed21020c064f (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: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/aops.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 3623ca20cc18..1d2b1f156bcf 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -609,7 +609,9 @@ bail:
609static void ocfs2_dio_end_io(struct kiocb *iocb, 609static void ocfs2_dio_end_io(struct kiocb *iocb,
610 loff_t offset, 610 loff_t offset,
611 ssize_t bytes, 611 ssize_t bytes,
612 void *private) 612 void *private,
613 int ret,
614 bool is_async)
613{ 615{
614 struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; 616 struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode;
615 int level; 617 int level;
@@ -623,6 +625,9 @@ static void ocfs2_dio_end_io(struct kiocb *iocb,
623 if (!level) 625 if (!level)
624 up_read(&inode->i_alloc_sem); 626 up_read(&inode->i_alloc_sem);
625 ocfs2_rw_unlock(inode, level); 627 ocfs2_rw_unlock(inode, level);
628
629 if (is_async)
630 aio_complete(iocb, ret, 0);
626} 631}
627 632
628/* 633/*