ia64/xen-unstable

changeset 215:43f9b7e980ef

bitkeeper revision 1.75 (3e54c1d5-NSDUblXJ0dD2Mk9r0xf1w)

xen_block.c:
Fix blkdev bug.
author kaf24@labyrinth.cl.cam.ac.uk
date Thu Feb 20 11:53:57 2003 +0000 (2003-02-20)
parents 2e78c0d979ec
children 48f852d4241d
files xen-2.4.16/drivers/block/xen_block.c
line diff
     1.1 --- a/xen-2.4.16/drivers/block/xen_block.c	Thu Feb 20 11:04:29 2003 +0000
     1.2 +++ b/xen-2.4.16/drivers/block/xen_block.c	Thu Feb 20 11:53:57 2003 +0000
     1.3 @@ -30,9 +30,9 @@ static kmem_cache_t *blk_request_cachep;
     1.4  static atomic_t nr_pending;
     1.5  
     1.6  static int do_block_io_op_domain(struct task_struct* task, int max_to_do);
     1.7 -static int dispatch_rw_block_io(int index);
     1.8 -static int dispatch_probe_block_io(int index);
     1.9 -static int dispatch_debug_block_io(int index);
    1.10 +static int dispatch_rw_block_io(struct task_struct *p, int index);
    1.11 +static int dispatch_probe_block_io(struct task_struct *p, int index);
    1.12 +static int dispatch_debug_block_io(struct task_struct *p, int index);
    1.13  
    1.14  static spinlock_t io_schedule_lock;
    1.15  static struct list_head io_schedule_list;
    1.16 @@ -179,15 +179,15 @@ static int do_block_io_op_domain(struct 
    1.17  
    1.18  	case XEN_BLOCK_READ:
    1.19  	case XEN_BLOCK_WRITE:
    1.20 -	    status = dispatch_rw_block_io(loop);
    1.21 +	    status = dispatch_rw_block_io(task, loop);
    1.22  	    break;
    1.23  
    1.24  	case XEN_BLOCK_PROBE:
    1.25 -	    status = dispatch_probe_block_io(loop);
    1.26 +	    status = dispatch_probe_block_io(task, loop);
    1.27  	    break;
    1.28  
    1.29  	case XEN_BLOCK_DEBUG:
    1.30 -	    status = dispatch_debug_block_io(loop);
    1.31 +	    status = dispatch_debug_block_io(task, loop);
    1.32  	    break;
    1.33  
    1.34  	default:
    1.35 @@ -204,17 +204,17 @@ static int do_block_io_op_domain(struct 
    1.36  }
    1.37  
    1.38  
    1.39 -static int dispatch_debug_block_io (int index)
    1.40 +static int dispatch_debug_block_io(struct task_struct *p, int index)
    1.41  {
    1.42      printk (KERN_ALERT "dispatch_debug_block_io: UNIMPL\n"); 
    1.43      return 1; 
    1.44  }
    1.45  
    1.46  
    1.47 -static int dispatch_probe_block_io (int index)
    1.48 +static int dispatch_probe_block_io(struct task_struct *p, int index)
    1.49  {
    1.50      extern void ide_probe_devices(xen_disk_info_t *xdi);
    1.51 -    blk_ring_t *blk_ring = current->blk_ring_base;
    1.52 +    blk_ring_t *blk_ring = p->blk_ring_base;
    1.53      xen_disk_info_t *xdi;
    1.54      
    1.55      xdi = phys_to_virt((unsigned long)blk_ring->req_ring[index].buffer);
    1.56 @@ -229,10 +229,10 @@ static int dispatch_probe_block_io (int 
    1.57  }
    1.58  
    1.59  
    1.60 -static int dispatch_rw_block_io (int index)
    1.61 +static int dispatch_rw_block_io(struct task_struct *p, int index)
    1.62  {
    1.63      extern void ll_rw_block(int rw, int nr, struct buffer_head * bhs[]); 
    1.64 -    blk_ring_t *blk_ring = current->blk_ring_base;
    1.65 +    blk_ring_t *blk_ring = p->blk_ring_base;
    1.66      struct buffer_head *bh;
    1.67      struct request_queue *rq;
    1.68      int operation;
    1.69 @@ -263,9 +263,6 @@ static int dispatch_rw_block_io (int ind
    1.70  		"sync" : "async"));
    1.71      }
    1.72  
    1.73 -    /* XXX KAF: A bit racey maybe? The whole wake-up pending needs fixing. */
    1.74 -    if ( atomic_read(&nr_pending) >= MAX_PENDING_REQS )
    1.75 -        return 1;
    1.76      atomic_inc(&nr_pending);
    1.77      blk_request = kmem_cache_alloc(blk_request_cachep, GFP_ATOMIC);
    1.78  
    1.79 @@ -301,7 +298,7 @@ static int dispatch_rw_block_io (int ind
    1.80      /* save meta data about request */
    1.81      blk_request->id     = blk_ring->req_ring[index].id;
    1.82      blk_request->bh     = bh;
    1.83 -    blk_request->domain = current; 
    1.84 +    blk_request->domain = p; 
    1.85      
    1.86      /* dispatch single block request */
    1.87      ll_rw_block(operation, 1, &bh);       /* linux top half */