ia64/xen-unstable
changeset 4410:45651a5b9d0b
bitkeeper revision 1.1159.279.1 (424c70f4QCqyymdEdrsWpGJWoWos9A)
Fix queue unplugging in blkback driver.
Signed-off-by: Keir Fraser <keir@xensource.com>
Fix queue unplugging in blkback driver.
Signed-off-by: Keir Fraser <keir@xensource.com>
author | kaf24@firebug.cl.cam.ac.uk |
---|---|
date | Thu Mar 31 21:51:48 2005 +0000 (2005-03-31) |
parents | 332cd3fd995c |
children | 3e78eadd8fb9 |
files | linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c linux-2.6.11-xen-sparse/drivers/xen/blkback/common.h linux-2.6.11-xen-sparse/drivers/xen/blkback/vbd.c |
line diff
1.1 --- a/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c Thu Mar 31 15:43:57 2005 +0000 1.2 +++ b/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c Thu Mar 31 21:51:48 2005 +0000 1.3 @@ -68,16 +68,10 @@ static PEND_RING_IDX pending_prod, pendi 1.4 static kmem_cache_t *buffer_head_cachep; 1.5 #else 1.6 static request_queue_t *plugged_queue; 1.7 -void bdev_put(struct block_device *bdev) 1.8 +static inline void bdev_flush_queue(request_queue_t *q) 1.9 { 1.10 - request_queue_t *q = plugged_queue; 1.11 - /* We might be giving up last reference to plugged queue. Flush if so. */ 1.12 - if ( (q != NULL) && 1.13 - (q == bdev_get_queue(bdev)) && 1.14 - (cmpxchg(&plugged_queue, q, NULL) == q) ) 1.15 - blk_run_queue(q); 1.16 - /* It's now safe to drop the block device. */ 1.17 - blkdev_put(bdev); 1.18 + if ( q->unplug_fn != NULL ) 1.19 + q->unplug_fn(q); 1.20 } 1.21 #endif 1.22 1.23 @@ -195,7 +189,7 @@ static int blkio_schedule(void *arg) 1.24 #else 1.25 if ( plugged_queue != NULL ) 1.26 { 1.27 - blk_run_queue(plugged_queue); 1.28 + bdev_flush_queue(plugged_queue); 1.29 plugged_queue = NULL; 1.30 } 1.31 #endif 1.32 @@ -523,7 +517,7 @@ static void dispatch_rw_block_io(blkif_t 1.33 if ( (q = bdev_get_queue(bio->bi_bdev)) != plugged_queue ) 1.34 { 1.35 if ( plugged_queue != NULL ) 1.36 - blk_run_queue(plugged_queue); 1.37 + bdev_flush_queue(plugged_queue); 1.38 plugged_queue = q; 1.39 } 1.40
2.1 --- a/linux-2.6.11-xen-sparse/drivers/xen/blkback/common.h Thu Mar 31 15:43:57 2005 +0000 2.2 +++ b/linux-2.6.11-xen-sparse/drivers/xen/blkback/common.h Thu Mar 31 21:51:48 2005 +0000 2.3 @@ -30,10 +30,8 @@ 2.4 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) 2.5 typedef struct rb_root rb_root_t; 2.6 typedef struct rb_node rb_node_t; 2.7 -extern void bdev_put(struct block_device *bdev); 2.8 #else 2.9 struct block_device; 2.10 -#define bdev_put(_b) ((void)0) 2.11 #endif 2.12 2.13 typedef struct blkif_st {
3.1 --- a/linux-2.6.11-xen-sparse/drivers/xen/blkback/vbd.c Thu Mar 31 15:43:57 2005 +0000 3.2 +++ b/linux-2.6.11-xen-sparse/drivers/xen/blkback/vbd.c Thu Mar 31 21:51:48 2005 +0000 3.3 @@ -14,6 +14,9 @@ 3.4 3.5 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) 3.6 static dev_t vbd_map_devnum(blkif_pdev_t); 3.7 +#define bdev_put(_b) blkdev_put(_b) 3.8 +#else 3.9 +#define bdev_put(_b) ((void)0) 3.10 #endif 3.11 3.12 void vbd_create(blkif_be_vbd_create_t *create)