direct-io.hg

changeset 2275:b2f1fa774452

bitkeeper revision 1.1159.1.76 (4123675aNWvu0fGFgPa2aJkfXqPOBg)

temporary blkfront fix to mark pages dirty during migrate -- should be deleted when grant tables are enabled.
author iap10@labyrinth.cl.cam.ac.uk
date Wed Aug 18 14:27:38 2004 +0000 (2004-08-18)
parents a6d73a771367
children 3addc3532bc7
files linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c
line diff
     1.1 --- a/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c	Wed Aug 18 14:23:07 2004 +0000
     1.2 +++ b/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c	Wed Aug 18 14:27:38 2004 +0000
     1.3 @@ -61,6 +61,7 @@ static void kick_pending_request_queues(
     1.4  
     1.5  int __init xlblk_init(void);
     1.6  
     1.7 +void blkif_completion( blkif_request_t *req );
     1.8  
     1.9  static inline int GET_ID_FROM_FREELIST( void )
    1.10  {
    1.11 @@ -359,6 +360,8 @@ static irqreturn_t blkif_int(int irq, vo
    1.12  
    1.13  //printk(KERN_ALERT"i: %d req %p (%ld)\n",i,req,id);
    1.14  
    1.15 +	blkif_completion( &rec_ring[id] );
    1.16 +
    1.17  	ADD_ID_TO_FREELIST(id);  // overwrites req
    1.18  
    1.19          switch ( bret->operation )
    1.20 @@ -891,6 +894,8 @@ static void blkif_int(int irq, void *dev
    1.21  
    1.22  //printk("i: %d req %p (%ld)\n",i,bh,id);
    1.23  
    1.24 +	blkif_completion( &rec_ring[id] );
    1.25 +
    1.26  	ADD_ID_TO_FREELIST(id);
    1.27  
    1.28          switch ( bret->operation )
    1.29 @@ -1262,3 +1267,27 @@ void blkdev_resume(void)
    1.30      memcpy(cmsg.msg, &st, sizeof(st));
    1.31      ctrl_if_send_message_block(&cmsg, NULL, 0, TASK_UNINTERRUPTIBLE);
    1.32  }
    1.33 +
    1.34 +/* XXXXX THIS IS A TEMPORARY FUNCTION UNTIL WE GET GRANT TABLES */
    1.35 +
    1.36 +void blkif_completion( blkif_request_t *req )
    1.37 +{
    1.38 +    int i;
    1.39 +
    1.40 +    switch ( req->operation )
    1.41 +    {
    1.42 +    case BLKIF_OP_READ:
    1.43 +	for ( i = 0; i < req->nr_segments; i++ )
    1.44 +	{
    1.45 +	    unsigned long pfn = req->frame_and_sects[i] >> PAGE_SHIFT;
    1.46 +	    unsigned long mfn = phys_to_machine_mapping[pfn];
    1.47 +
    1.48 +	    queue_machphys_update(mfn, pfn);
    1.49 +	}
    1.50 +
    1.51 +	break;
    1.52 +    }
    1.53 +    
    1.54 +}
    1.55 +
    1.56 +