Commit 6280f190da4dd083f14f704be6b3314311a7eacb

Authored by Paolo Bonzini
Committed by Jeremy Fitzhardinge
1 parent 4c31a78114

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>

Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff

drivers/xen/xenfs/xenbus.c
... ... @@ -122,6 +122,9 @@
122 122 mutex_lock(&u->reply_mutex);
123 123 while (list_empty(&u->read_buffers)) {
124 124 mutex_unlock(&u->reply_mutex);
  125 + if (filp->f_flags & O_NONBLOCK)
  126 + return -EAGAIN;
  127 +
125 128 ret = wait_event_interruptible(u->read_waitq,
126 129 !list_empty(&u->read_buffers));
127 130 if (ret)