staging: comedi: COMEDI_BUFINFO: become non-busy even if bytes_read is 0
authorIan Abbott <abbotti@mev.co.uk>
Fri, 19 Feb 2016 16:13:55 +0000 (16:13 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Feb 2016 23:25:58 +0000 (15:25 -0800)
commitf3aa8c0becfb1d968e552721cc1be8b91032539b
tree0940dac335dae047154bc326022679ee2ab433f8
parent57c563bf78f50d8a43e7ffe0087bc43dc0f188aa
staging: comedi: COMEDI_BUFINFO: become non-busy even if bytes_read is 0

The `COMEDI_BUFINFO` ioctl is used to advance the current position in
the buffer by a specified amount (which can be 0) and get the new
position.  On input, the `bytes_read` member of `struct comedi_bufinfo`
specified the amount to advance the "read" position for an asynchronous
command in the "read" direction.  If the command has already stopped
normally, and the "read" position has been advanced to the end of all
available data, the command is terminated by calling
`do_become_nonbusy()`.  (That is not currently done if the command
stopped with an error.)  Currently, the command is only terminated if
the user is trying to advance the "read" position by a non-zero amount.
Change it to allow the command to be terminated even if the user is not
trying to advance the "read" position.  This is justifiable, as the only
time a command stops without error is when it has been set up to read a
finite amount of data.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/comedi_fops.c
This page took 0.028488 seconds and 5 git commands to generate.