ChangeSet 1.1427, 2005/04/01 17:50:40+01:00, vh249@xxxxxxxxxxxxxxxxxxxxxx
Merge arcadians.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk
into arcadians.cl.cam.ac.uk:/local/scratch-2/vh249/xen-unstable.bk
blkfront.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/blkfront.c
b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/blkfront.c
--- a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/blkfront.c 2005-04-01
13:03:26 -05:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/blkfront.c 2005-04-01
13:03:26 -05:00
@@ -74,8 +74,10 @@
static blkif_front_ring_t blk_ring;
+#define BLK_RING_SIZE __RING_SIZE((blkif_sring_t *)0, PAGE_SIZE)
+
unsigned long rec_ring_free;
-blkif_request_t rec_ring[RING_SIZE(&blk_ring)];
+blkif_request_t rec_ring[BLK_RING_SIZE];
static int recovery = 0; /* "Recovery in progress" flag. Protected
* by the blkif_io_lock */
@@ -90,8 +92,7 @@
{
unsigned long free = rec_ring_free;
- if ( free > RING_SIZE(&blk_ring) )
- BUG();
+ BUG_ON(free > BLK_RING_SIZE);
rec_ring_free = rec_ring[free].id;
@@ -521,8 +522,7 @@
{
/* We kick pending request queues if the ring is reasonably empty. */
if ( (nr_pending != 0) &&
- (RING_PENDING_REQUESTS(&blk_ring) <
- (RING_SIZE(&blk_ring) >> 1)) )
+ (RING_PENDING_REQUESTS(&blk_ring) < (BLK_RING_SIZE >> 1)) )
{
/* Attempt to drain the queue, but bail if the ring becomes full. */
while ( (nr_pending != 0) && !RING_FULL(&blk_ring) )
@@ -1137,7 +1137,7 @@
sring = (blkif_sring_t *)__get_free_page(GFP_KERNEL);
SHARED_RING_INIT(sring);
- FRONT_RING_INIT(&blk_ring, sring);
+ FRONT_RING_INIT(&blk_ring, sring, PAGE_SIZE);
blkif_state = BLKIF_STATE_DISCONNECTED;
blkif_send_interface_connect();
}
@@ -1157,7 +1157,7 @@
* This will need to be fixed once we have barriers */
/* Stage 1 : Find active and move to safety. */
- for ( i = 0; i < RING_SIZE(&blk_ring); i++ )
+ for ( i = 0; i < BLK_RING_SIZE; i++ )
{
if ( rec_ring[i].id >= PAGE_OFFSET )
{
@@ -1178,10 +1178,10 @@
}
/* Stage 3 : Set up free list. */
- for ( ; i < RING_SIZE(&blk_ring); i++ )
+ for ( ; i < BLK_RING_SIZE; i++ )
rec_ring[i].id = i+1;
rec_ring_free = blk_ring.req_prod_pvt;
- rec_ring[RING_SIZE(&blk_ring)-1].id = 0x0fffffff;
+ rec_ring[BLK_RING_SIZE-1].id = 0x0fffffff;
/* blk_ring->req_prod will be set when we flush_requests().*/
wmb();
@@ -1368,9 +1368,9 @@
printk(KERN_INFO "xen_blk: Initialising virtual block device driver\n");
rec_ring_free = 0;
- for ( i = 0; i < RING_SIZE(&blk_ring); i++ )
+ for ( i = 0; i < BLK_RING_SIZE; i++ )
rec_ring[i].id = i+1;
- rec_ring[RING_SIZE(&blk_ring)-1].id = 0x0fffffff;
+ rec_ring[BLK_RING_SIZE-1].id = 0x0fffffff;
(void)ctrl_if_register_receiver(CMSG_BLKIF_FE, blkif_ctrlif_rx,
CALLBACK_IN_BLOCKING_CONTEXT);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|