diff options
author | Christoph Hellwig <hch@infradead.org> | 2013-09-04 09:04:39 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-09-04 09:23:46 -0400 |
commit | 7b7a8665edd8db733980389b098530f9e4f630b2 (patch) | |
tree | 968d570a9f0c4d861226aefed2f5f97a131c8d53 /fs/ocfs2/aops.c | |
parent | 4b6ccca701ef5977d0ffbc2c932430dea88b38b6 (diff) |
direct-io: Implement generic deferred AIO completions
Add support to the core direct-io code to defer AIO completions to user
context using a workqueue. This replaces opencoded and less efficient
code in XFS and ext4 (we save a memory allocation for each direct IO)
and will be needed to properly support O_(D)SYNC for AIO.
The communication between the filesystem and the direct I/O code requires
a new buffer head flag, which is a bit ugly but not avoidable until the
direct I/O code stops abusing the buffer_head structure for communicating
with the filesystems.
Currently this creates a per-superblock unbound workqueue for these
completions, which is taken from an earlier patch by Jan Kara. I'm
not really convinced about this use and would prefer a "normal" global
workqueue with a high concurrency limit, but this needs further discussion.
JK: Fixed ext4 part, dynamic allocation of the workqueue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ocfs2/aops.c')
-rw-r--r-- | fs/ocfs2/aops.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 2abf97b2a592..94417a85ce6e 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
@@ -565,9 +565,7 @@ bail: | |||
565 | static void ocfs2_dio_end_io(struct kiocb *iocb, | 565 | static void ocfs2_dio_end_io(struct kiocb *iocb, |
566 | loff_t offset, | 566 | loff_t offset, |
567 | ssize_t bytes, | 567 | ssize_t bytes, |
568 | void *private, | 568 | void *private) |
569 | int ret, | ||
570 | bool is_async) | ||
571 | { | 569 | { |
572 | struct inode *inode = file_inode(iocb->ki_filp); | 570 | struct inode *inode = file_inode(iocb->ki_filp); |
573 | int level; | 571 | int level; |
@@ -592,10 +590,6 @@ static void ocfs2_dio_end_io(struct kiocb *iocb, | |||
592 | 590 | ||
593 | level = ocfs2_iocb_rw_locked_level(iocb); | 591 | level = ocfs2_iocb_rw_locked_level(iocb); |
594 | ocfs2_rw_unlock(inode, level); | 592 | ocfs2_rw_unlock(inode, level); |
595 | |||
596 | inode_dio_done(inode); | ||
597 | if (is_async) | ||
598 | aio_complete(iocb, ret, 0); | ||
599 | } | 593 | } |
600 | 594 | ||
601 | /* | 595 | /* |