]> git.baikalelectronics.ru Git - kernel.git/commit
direct-io: Implement generic deferred AIO completions
authorChristoph Hellwig <hch@infradead.org>
Wed, 4 Sep 2013 13:04:39 +0000 (15:04 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 4 Sep 2013 13:23:46 +0000 (09:23 -0400)
commit31dab44266ac182346a7cf2ba867e69e0d1ea83f
tree968d570a9f0c4d861226aefed2f5f97a131c8d53
parent2f6ce46289f282cd9ecdbd6097b2136c514788cc
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>
fs/direct-io.c
fs/ext4/ext4.h
fs/ext4/inode.c
fs/ext4/page-io.c
fs/ext4/super.c
fs/ocfs2/aops.c
fs/super.c
fs/xfs/xfs_aops.c
fs/xfs/xfs_aops.h
include/linux/buffer_head.h
include/linux/fs.h