• David Brownell's avatar
    [PATCH] USB: gadgetfs AIO support · 75787d94
    David Brownell authored
    This patch adds AIO support to gadgetfs, letting user mode programs use
    "libaio" to manage USB I/O concurrency with the same API as they may
    already be using for disk files.  In particular, it's practical to
    stream isochronous data to/from userspace using this API, by keeping
    an endpoint's I/O queue from emptying.
    
    Each AIO "iocb" in userspace corresponds directly to one "usb_request"
    (and one kiocb) in the kernel.  Their lifecycles, including cancelation,
    overlap completely.  That's much of why the patch is so small (surprised
    the heck out of me!); that, and using copy_{to,from}_user() rather than
    trying fancy dma mapping tricks to attain zerocopy nirvana.
    
    The kernel AIO module forgot to export kick_iocb(), so this adds the
    missing declaration ... needed when using gadgetfs as a module.
    Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
    Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
    75787d94
aio.c 31.5 KB