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] Simplify code by acking watch as soon as we read it.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Simplify code by acking watch as soon as we read it.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 28 Jul 2005 08:52:11 -0400
Delivery-date: Thu, 28 Jul 2005 12:52:39 +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 cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID d24e1970c20542771fc3b359de206f196ec603e0
# Parent  3be03cd7cd4c670655ce086050fba71c0cf6a957
Simplify code by acking watch as soon as we read it.
Since watches no longer block anyone, this doesn't change semantics.
Signed-off-by: Rusty Russel <rusty@xxxxxxxxxxxxxxx>
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r 3be03cd7cd4c -r d24e1970c205 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Thu Jul 28 
12:25:13 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Thu Jul 28 
12:29:23 2005
@@ -479,8 +479,6 @@
        return err;
 }
 
-static struct xenbus_watch *watch_callback;
-
 void unregister_xenbus_watch(struct xenbus_watch *watch)
 {
        char token[sizeof(watch) * 2 + 1];
@@ -492,12 +490,9 @@
        err = xs_unwatch(watch->node, token);
        list_del(&watch->list);
 
-       /* Make sure watch thread knows we unwatched, so don't ack. */
-       if (watch_callback == watch)
-               watch_callback = NULL;
-
        if (err)
-               printk(KERN_WARNING "XENBUS Failed to release watch %s: %i\n",
+               printk(KERN_WARNING
+                      "XENBUS Failed to release watch %s: %i\n",
                       watch->node, err);
 }
 
@@ -521,18 +516,13 @@
                        struct xenbus_watch *w;
                        int err;
 
+                       err = xs_acknowledge_watch(token);
+                       if (err)
+                               printk(KERN_WARNING "XENBUS ack %s fail %i\n",
+                                      node, err);
                        w = find_watch(token);
                        BUG_ON(!w);
-                       watch_callback = w;
                        w->callback(w, node);
-
-                       if (watch_callback) {
-                               err = xs_acknowledge_watch(token);
-                               if (err)
-                                       printk(KERN_WARNING
-                                              "XENBUS ack %s fail %i\n",
-                                              node, err);
-                       }
                        kfree(node);
                } else
                        printk(KERN_WARNING "XENBUS xs_read_watch: %li\n",

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Simplify code by acking watch as soon as we read it., Xen patchbot -unstable <=