linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Add O_NONBLOCK support to FUSE
@ 2006-03-01  2:29 Jeff Dike
  2006-03-01  9:51 ` Miklos Szeredi
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Dike @ 2006-03-01  2:29 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: fuse-devel, linux-fsdevel, linux-kernel

This adds O_NONBLOCK support to FUSE.
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>

Index: host-2.6.15-fuse/fs/fuse/dev.c
===================================================================
--- host-2.6.15-fuse.orig/fs/fuse/dev.c	2006-02-28 21:00:00.000000000 -0500
+++ host-2.6.15-fuse/fs/fuse/dev.c	2006-02-28 21:04:36.000000000 -0500
@@ -613,6 +613,12 @@ static ssize_t fuse_dev_readv(struct fil
 	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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-03-02 19:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-01  2:29 [PATCH] Add O_NONBLOCK support to FUSE Jeff Dike
2006-03-01  9:51 ` Miklos Szeredi
2006-03-02 18:04   ` Jeff Dike
2006-03-02 19:56     ` Miklos Szeredi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).