]> git.karo-electronics.de Git - karo-tx-linux.git/commit
fuse: add support of async IO
authorMaxim Patlasov <mpatlasov@parallels.com>
Fri, 14 Dec 2012 15:20:41 +0000 (19:20 +0400)
committerMiklos Szeredi <mszeredi@suse.cz>
Wed, 17 Apr 2013 19:50:59 +0000 (21:50 +0200)
commit01e9d11a3e79035ca5cd89b035435acd4ba61ee1
tree514830e4188f2799b91239cd669ef1629ce3e278
parent187c5c36330bc8d15674d9e6d2a2412de6b1034d
fuse: add support of async IO

The patch implements a framework to process an IO request asynchronously. The
idea is to associate several fuse requests with a single kiocb by means of
fuse_io_priv structure. The structure plays the same role for FUSE as 'struct
dio' for direct-io.c.

The framework is supposed to be used like this:
 - someone (who wants to process an IO asynchronously) allocates fuse_io_priv
   and initializes it setting 'async' field to non-zero value.
 - as soon as fuse request is filled, it can be submitted (in non-blocking way)
   by fuse_async_req_send()
 - when all submitted requests are ACKed by userspace, io->reqs drops to zero
   triggering aio_complete()

In case of IO initiated by libaio, aio_complete() will finish processing the
same way as in case of dio_complete() calling aio_complete(). But the
framework may be also used for internal FUSE use when initial IO request
was synchronous (from user perspective), but it's beneficial to process it
asynchronously. Then the caller should wait on kiocb explicitly and
aio_complete() will wake the caller up.

Signed-off-by: Maxim Patlasov <mpatlasov@parallels.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
fs/fuse/file.c
fs/fuse/fuse_i.h