1. Mar 26, 2015
  2. Mar 14, 2015
    • Christoph Hellwig's avatar
      fs: split generic and aio kiocb · 04b2fa9f
      Christoph Hellwig authored
      
      
      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: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      04b2fa9f
    • Christoph Hellwig's avatar
      fs: don't allow to complete sync iocbs through aio_complete · 599bd19b
      Christoph Hellwig authored
      
      
      The AIO interface is fairly complex because it tries to allow
      filesystems to always work async and then wakeup a synchronous
      caller through aio_complete.  It turns out that basically no one
      was doing this to avoid the complexity and context switches,
      and we've already fixed up the remaining users and can now
      get rid of this case.
      
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      599bd19b
    • Christoph Hellwig's avatar
      fuse: handle synchronous iocbs internally · 9d5722b7
      Christoph Hellwig authored
      
      
      Based on a patch from Maxim Patlasov <MPatlasov@parallels.com>.
      
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      9d5722b7
  3. Mar 13, 2015
  4. Mar 09, 2015
    • Alan Stern's avatar
      gadgetfs: really get rid of switching ->f_op · 96b62a57
      Alan Stern authored
      
      
      ... for ep0 as well
      
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      96b62a57
    • Al Viro's avatar
      gadgetfs: get rid of flipping ->f_op in ep_config() · d4461a60
      Al Viro authored
      
      
      Final methods start with get_ready_ep(), which will fail unless we have
      ->state == STATE_EP_ENABLED.  So they'd be failing just fine until that
      first write() anyway.  Let's do the following:
      	* get_ready_ep() gets a new argument - true when called from
      ep_write_iter(), false otherwise.
      	* make it quiet when it finds STATE_EP_READY (no printk, that is;
      the case won't be impossible after that change).
      	* when that new argument is true, treat STATE_EP_READY the same
      way as STATE_EP_ENABLED (i.e. return zero and do not unlock).
      	* in ep_write_iter(), after success of get_ready_ep() turn
      	if (!usb_endpoint_dir_in(&epdata->desc)) {
      into
      	if (epdata->state == STATE_EP_ENABLED &&
      	    !usb_endpoint_dir_in(&epdata->desc)) {
      - that logics only applies after config.
      	* have ep_config() take kernel-side buffer (i.e. use memcpy()
      instead of copy_from_user() in there) and in the "let's call ep_io or
      ep_aio" (again, in ep_write_iter()) add "... or ep_config() in case it's
      not configured yet"
      
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      d4461a60
  5. Feb 18, 2015