From 079fe29f2c6433d24d50de4274b979149164161c Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 24 Jun 2011 14:29:48 -0400 Subject: [PATCH] --- yaml --- r: 257383 b: refs/heads/master c: 72c5052ddc3956d847f21c2b8d55c93664a51b2c h: refs/heads/master i: 257381: acdf69b2e379cc274121698e90cf267aecfb6132 257379: 216dc063fcb78fcc7336295124971c5a2d6171b8 257375: af62baea252c06282ba926012bbb5dce0005429c v: v3 --- [refs] | 2 +- trunk/fs/direct-io.c | 7 ++++--- trunk/fs/ext4/inode.c | 5 +++++ trunk/fs/ocfs2/aops.c | 1 + trunk/fs/xfs/linux-2.6/xfs_aops.c | 3 +++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index bf39c7308b65..9962845f54c9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: aacfc19c626ebd3daa675652457d71019a1f583f +refs/heads/master: 72c5052ddc3956d847f21c2b8d55c93664a51b2c diff --git a/trunk/fs/direct-io.c b/trunk/fs/direct-io.c index 0a073c7125a6..01d2d9ef609c 100644 --- a/trunk/fs/direct-io.c +++ b/trunk/fs/direct-io.c @@ -293,11 +293,12 @@ static ssize_t dio_complete(struct dio *dio, loff_t offset, ssize_t ret, bool is if (dio->end_io && dio->result) { dio->end_io(dio->iocb, offset, transferred, dio->map_bh.b_private, ret, is_async); - } else if (is_async) { - aio_complete(dio->iocb, ret, 0); + } else { + if (is_async) + aio_complete(dio->iocb, ret, 0); + inode_dio_done(dio->inode); } - inode_dio_done(dio->inode); return ret; } diff --git a/trunk/fs/ext4/inode.c b/trunk/fs/ext4/inode.c index 1f35573a34e1..678cde834f19 100644 --- a/trunk/fs/ext4/inode.c +++ b/trunk/fs/ext4/inode.c @@ -3573,6 +3573,7 @@ static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset, ssize_t size, void *private, int ret, bool is_async) { + struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; ext4_io_end_t *io_end = iocb->private; struct workqueue_struct *wq; unsigned long flags; @@ -3594,6 +3595,7 @@ static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset, out: if (is_async) aio_complete(iocb, ret, 0); + inode_dio_done(inode); return; } @@ -3614,6 +3616,9 @@ static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset, /* queue the work to convert unwritten extents to written */ queue_work(wq, &io_end->work); iocb->private = NULL; + + /* XXX: probably should move into the real I/O completion handler */ + inode_dio_done(inode); } static void ext4_end_io_buffer_write(struct buffer_head *bh, int uptodate) diff --git a/trunk/fs/ocfs2/aops.c b/trunk/fs/ocfs2/aops.c index 524d6167fb63..c1efe939c774 100644 --- a/trunk/fs/ocfs2/aops.c +++ b/trunk/fs/ocfs2/aops.c @@ -577,6 +577,7 @@ static void ocfs2_dio_end_io(struct kiocb *iocb, if (is_async) aio_complete(iocb, ret, 0); + inode_dio_done(inode); } /* diff --git a/trunk/fs/xfs/linux-2.6/xfs_aops.c b/trunk/fs/xfs/linux-2.6/xfs_aops.c index 79ce38be15a1..b3b418f519f3 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_aops.c +++ b/trunk/fs/xfs/linux-2.6/xfs_aops.c @@ -1339,6 +1339,9 @@ xfs_end_io_direct_write( } else { xfs_finish_ioend_sync(ioend); } + + /* XXX: probably should move into the real I/O completion handler */ + inode_dio_done(ioend->io_inode); } STATIC ssize_t