WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Clean up use of wait_event_interruptible().

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Clean up use of wait_event_interruptible().
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 02 Mar 2006 23:02:10 +0000
Delivery-date: Thu, 02 Mar 2006 23:02:50 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 990b436099befd67d3fec6dfe704e2022c20924d
# Parent  8f1f6c70e4f5f29cc7df518e4d547cf3ccec2ab9
Clean up use of wait_event_interruptible().

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 8f1f6c70e4f5 -r 990b436099be 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c    Thu Mar  2 
15:41:45 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c    Thu Mar  2 
17:57:03 2006
@@ -89,14 +89,18 @@
 {
        struct xenstore_domain_interface *intf = xenstore_domain_interface();
        XENSTORE_RING_IDX cons, prod;
+       int rc;
 
        while (len != 0) {
                void *dst;
                unsigned int avail;
 
-               wait_event_interruptible(xb_waitq,
-                                        (intf->req_prod - intf->req_cons) !=
-                                        XENSTORE_RING_SIZE);
+               rc = wait_event_interruptible(
+                       xb_waitq,
+                       (intf->req_prod - intf->req_cons) !=
+                       XENSTORE_RING_SIZE);
+               if (rc < 0)
+                       return rc;
 
                /* Read indexes, then verify. */
                cons = intf->req_cons;
@@ -130,13 +134,17 @@
 {
        struct xenstore_domain_interface *intf = xenstore_domain_interface();
        XENSTORE_RING_IDX cons, prod;
+       int rc;
 
        while (len != 0) {
                unsigned int avail;
                const char *src;
 
-               wait_event_interruptible(xb_waitq,
-                                        intf->rsp_cons != intf->rsp_prod);
+               rc = wait_event_interruptible(
+                       xb_waitq,
+                       intf->rsp_cons != intf->rsp_prod);
+               if (rc < 0)
+                       return rc;
 
                /* Read indexes, then verify. */
                cons = intf->rsp_cons;
diff -r 8f1f6c70e4f5 -r 990b436099be 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Thu Mar  2 
15:41:45 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Thu Mar  2 
17:57:03 2006
@@ -123,8 +123,9 @@
 
        while (list_empty(&xs_state.reply_list)) {
                spin_unlock(&xs_state.reply_lock);
-               wait_event_interruptible(xs_state.reply_waitq,
-                                        !list_empty(&xs_state.reply_list));
+               /* XXX FIXME: Avoid synchronous wait for response here. */
+               wait_event(xs_state.reply_waitq,
+                          !list_empty(&xs_state.reply_list));
                spin_lock(&xs_state.reply_lock);
        }
 
@@ -685,6 +686,9 @@
                wait_event_interruptible(watch_events_waitq,
                                         !list_empty(&watch_events));
 
+               if (kthread_should_stop())
+                       break;
+
                down(&xenwatch_mutex);
 
                spin_lock(&watch_events_lock);
@@ -705,6 +709,8 @@
 
                up(&xenwatch_mutex);
        }
+
+       return 0;
 }
 
 static int process_msg(void)
@@ -778,7 +784,11 @@
                if (err)
                        printk(KERN_WARNING "XENBUS error %d while reading "
                               "message\n", err);
-       }
+               if (kthread_should_stop())
+                       break;
+       }
+
+       return 0;
 }
 
 int xs_init(void)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Clean up use of wait_event_interruptible()., Xen patchbot -unstable <=