Skip to content

Commit

Permalink
[PATCH] fuse: add O_NONBLOCK support to FUSE device
Browse files Browse the repository at this point in the history
I don't like duplicating the connected and list_empty tests in fuse_dev_readv,
but this seemed cleaner than adding the f_flags test to request_wait.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Apr 11, 2006
1 parent 385a17b commit e5ac1d1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/fuse/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,12 @@ static ssize_t fuse_dev_readv(struct file *file, const struct iovec *iov,
err = -EPERM;
if (!fc)
goto err_unlock;

err = -EAGAIN;
if ((file->f_flags & O_NONBLOCK) && fc->connected &&
list_empty(&fc->pending))
goto err_unlock;

request_wait(fc);
err = -ENODEV;
if (!fc->connected)
Expand Down

0 comments on commit e5ac1d1

Please sign in to comment.