aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2010-06-23 18:30:15 +0200
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-07-26 10:05:05 -0700
commit6280f190da4dd083f14f704be6b3314311a7eacb (patch)
tree23b80ccd862117688eafa4c52ae6ad61fda2f082 /drivers/xen
parentxenbus: do not hold transaction_mutex when returning to userspace (diff)
downloadlinux-dev-6280f190da4dd083f14f704be6b3314311a7eacb.tar.xz
linux-dev-6280f190da4dd083f14f704be6b3314311a7eacb.zip
implement O_NONBLOCK for /proc/xen/xenbus
This patch implements O_NONBLOCK for /proc/xen/xenbus. It is a simple matter of returning -EAGAIN instead of waiting on a queue. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/xenfs/xenbus.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/xen/xenfs/xenbus.c b/drivers/xen/xenfs/xenbus.c
index a9592d981b10..9d5b519d2e4c 100644
--- a/drivers/xen/xenfs/xenbus.c
+++ b/drivers/xen/xenfs/xenbus.c
@@ -122,6 +122,9 @@ static ssize_t xenbus_file_read(struct file *filp,
mutex_lock(&u->reply_mutex);
while (list_empty(&u->read_buffers)) {
mutex_unlock(&u->reply_mutex);
+ if (filp->f_flags & O_NONBLOCK)
+ return -EAGAIN;
+
ret = wait_event_interruptible(u->read_waitq,
!list_empty(&u->read_buffers));
if (ret)