[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] xenfs: implement O_NONBLOCK for /proc/xen/xenbus



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1280137200 -3600
# Node ID 2893229a53a0a3aa6663d96e7c877e43936a3c8e
# Parent  85ca9742b8b9f49d8371c6ce305b0cdeff4f341e
xenfs: 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@xxxxxxxxxx>
---
 drivers/xen/xenbus/xenbus_dev.c |    3 +++
 1 files changed, 3 insertions(+)

diff -r 85ca9742b8b9 -r 2893229a53a0 drivers/xen/xenbus/xenbus_dev.c
--- a/drivers/xen/xenbus/xenbus_dev.c   Fri Jul 09 12:37:28 2010 +0100
+++ b/drivers/xen/xenbus/xenbus_dev.c   Mon Jul 26 10:40:00 2010 +0100
@@ -104,6 +104,9 @@ static ssize_t xenbus_dev_read(struct fi
        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)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.