diff options
author | Jeff Dike <jdike@addtoit.com> | 2006-04-11 01:54:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-11 09:18:48 -0400 |
commit | e5ac1d1e70a8c19a65a959d73650203df7a2e168 (patch) | |
tree | e3efd114e3350c270d3693266d38d07eaedae757 /fs | |
parent | 385a17bfc3cb035333c8a91eddc78a6e04c4625e (diff) |
[PATCH] fuse: add O_NONBLOCK support to FUSE device
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fuse/dev.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 438770f8867f..75c6e9166c39 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c | |||
@@ -619,6 +619,12 @@ static ssize_t fuse_dev_readv(struct file *file, const struct iovec *iov, | |||
619 | err = -EPERM; | 619 | err = -EPERM; |
620 | if (!fc) | 620 | if (!fc) |
621 | goto err_unlock; | 621 | goto err_unlock; |
622 | |||
623 | err = -EAGAIN; | ||
624 | if ((file->f_flags & O_NONBLOCK) && fc->connected && | ||
625 | list_empty(&fc->pending)) | ||
626 | goto err_unlock; | ||
627 | |||
622 | request_wait(fc); | 628 | request_wait(fc); |
623 | err = -ENODEV; | 629 | err = -ENODEV; |
624 | if (!fc->connected) | 630 | if (!fc->connected) |