提交 e5ac1d1e 编写于 作者: J Jeff Dike 提交者: Linus Torvalds

[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: NJeff Dike <jdike@addtoit.com>
Signed-off-by: NMiklos Szeredi <miklos@szeredi.hu>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 385a17bf
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册