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] Fix queue unplugging in blkback driver.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix queue unplugging in blkback driver.
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Thu, 31 Mar 2005 21:51:48 +0000
Delivery-date: Thu, 31 Mar 2005 22:04:25 +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 Development List <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1817.1.1, 2005/03/31 22:51:48+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        Fix queue unplugging in blkback driver.
        Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>



 blkback.c |   16 +++++-----------
 common.h  |    2 --
 vbd.c     |    3 +++
 3 files changed, 8 insertions(+), 13 deletions(-)


diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c 
b/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c
--- a/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c     2005-03-31 
17:04:25 -05:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c     2005-03-31 
17:04:25 -05:00
@@ -68,16 +68,10 @@
 static kmem_cache_t *buffer_head_cachep;
 #else
 static request_queue_t *plugged_queue;
-void bdev_put(struct block_device *bdev)
+static inline void bdev_flush_queue(request_queue_t *q)
 {
-    request_queue_t *q = plugged_queue;
-    /* We might be giving up last reference to plugged queue. Flush if so. */
-    if ( (q != NULL) &&
-         (q == bdev_get_queue(bdev)) && 
-         (cmpxchg(&plugged_queue, q, NULL) == q) )
-        blk_run_queue(q);
-    /* It's now safe to drop the block device. */
-    blkdev_put(bdev);
+    if ( q->unplug_fn != NULL )
+        q->unplug_fn(q);
 }
 #endif
 
@@ -195,7 +189,7 @@
 #else
         if ( plugged_queue != NULL )
         {
-            blk_run_queue(plugged_queue);
+            bdev_flush_queue(plugged_queue);
             plugged_queue = NULL;
         }
 #endif
@@ -523,7 +517,7 @@
         if ( (q = bdev_get_queue(bio->bi_bdev)) != plugged_queue )
         {
             if ( plugged_queue != NULL )
-                blk_run_queue(plugged_queue);
+                bdev_flush_queue(plugged_queue);
             plugged_queue = q;
         }
 
diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/blkback/common.h 
b/linux-2.6.11-xen-sparse/drivers/xen/blkback/common.h
--- a/linux-2.6.11-xen-sparse/drivers/xen/blkback/common.h      2005-03-31 
17:04:25 -05:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/blkback/common.h      2005-03-31 
17:04:25 -05:00
@@ -30,10 +30,8 @@
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 typedef struct rb_root rb_root_t;
 typedef struct rb_node rb_node_t;
-extern void bdev_put(struct block_device *bdev);
 #else
 struct block_device;
-#define bdev_put(_b) ((void)0)
 #endif
 
 typedef struct blkif_st {
diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/blkback/vbd.c 
b/linux-2.6.11-xen-sparse/drivers/xen/blkback/vbd.c
--- a/linux-2.6.11-xen-sparse/drivers/xen/blkback/vbd.c 2005-03-31 17:04:24 
-05:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/blkback/vbd.c 2005-03-31 17:04:25 
-05:00
@@ -14,6 +14,9 @@
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 static dev_t vbd_map_devnum(blkif_pdev_t);
+#define bdev_put(_b) blkdev_put(_b)
+#else
+#define bdev_put(_b) ((void)0)
 #endif
 
 void vbd_create(blkif_be_vbd_create_t *create) 

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

<Prev in Thread] Current Thread [Next in Thread>