summaryrefslogtreecommitdiffstats
path: root/fs/direct-io.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2015-02-02 14:49:06 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2015-03-13 12:10:27 -0400
commit04b2fa9f8f36ec6fb6fd1c9dc9df6fff0cd27323 (patch)
treef9fdc8004b4decca27e30da1614529eaf1455136 /fs/direct-io.c
parent599bd19bdc4c6b20fd91d50f2f79dececbaf80c1 (diff)
downloadlinux-04b2fa9f8f36ec6fb6fd1c9dc9df6fff0cd27323.tar.gz
linux-04b2fa9f8f36ec6fb6fd1c9dc9df6fff0cd27323.tar.bz2
linux-04b2fa9f8f36ec6fb6fd1c9dc9df6fff0cd27323.zip
fs: split generic and aio kiocb
Most callers in the kernel want to perform synchronous file I/O, but still have to bloat the stack with a full struct kiocb. Split out the parts needed in filesystem code from those in the aio code, and only allocate those needed to pass down argument on the stack. The aio code embedds the generic iocb in the one it allocates and can easily get back to it by using container_of. Also add a ->ki_complete method to struct kiocb, this is used to call into the aio code and thus removes the dependency on aio for filesystems impementing asynchronous operations. It will also allow other callers to substitute their own completion callback. We also add a new ->ki_flags field to work around the nasty layering violation recently introduced in commit 5e33f6 ("usb: gadget: ffs: add eventfd notification about ffs events"). Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/direct-io.c')
-rw-r--r--fs/direct-io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/direct-io.c b/fs/direct-io.c
index e181b6b2e297..c38b460776e6 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -265,7 +265,7 @@ static ssize_t dio_complete(struct dio *dio, loff_t offset, ssize_t ret,
ret = err;
}
- aio_complete(dio->iocb, ret, 0);
+ dio->iocb->ki_complete(dio->iocb, ret, 0);
}
kmem_cache_free(dio_cache, dio);
@@ -1056,7 +1056,7 @@ static inline int drop_refcount(struct dio *dio)
* operation. AIO can if it was a broken operation described above or
* in fact if all the bios race to complete before we get here. In
* that case dio_complete() translates the EIOCBQUEUED into the proper
- * return code that the caller will hand to aio_complete().
+ * return code that the caller will hand to ->complete().
*
* This is managed by the bio_lock instead of being an atomic_t so that
* completion paths can drop their ref and use the remaining count to