direct-io.hg

changeset 4396:65e8e0c70597

bitkeeper revision 1.1236.1.169 (424bb04eB0_EeDkZ4a4b3PYM1jw59Q)

Patch from Jens Axboe to synchronously flush block requests from our
backend driver down to the disk(s). Big improvement in blkdev
performance.
author kaf24@firebug.cl.cam.ac.uk
date Thu Mar 31 08:09:50 2005 +0000 (2005-03-31)
parents 6a4d065f7256
children 0cbc4aad8b4c
files linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c
line diff
     1.1 --- a/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c	Thu Mar 31 08:04:56 2005 +0000
     1.2 +++ b/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c	Thu Mar 31 08:09:50 2005 +0000
     1.3 @@ -512,7 +512,6 @@ static void dispatch_rw_block_io(blkif_t
     1.4      for ( i = 0; i < nr_psegs; i++ )
     1.5      {
     1.6          struct bio *bio;
     1.7 -        struct bio_vec *bv;
     1.8  
     1.9          bio = bio_alloc(GFP_ATOMIC, 1);
    1.10          if ( unlikely(bio == NULL) )
    1.11 @@ -525,17 +524,14 @@ static void dispatch_rw_block_io(blkif_t
    1.12          bio->bi_private = pending_req;
    1.13          bio->bi_end_io  = end_block_io_op;
    1.14          bio->bi_sector  = phys_seg[i].sector_number;
    1.15 -        bio->bi_rw      = operation;
    1.16  
    1.17 -        bv = bio_iovec_idx(bio, 0);
    1.18 -        bv->bv_page   = virt_to_page(MMAP_VADDR(pending_idx, i));
    1.19 -        bv->bv_len    = phys_seg[i].nr_sects << 9;
    1.20 -        bv->bv_offset = phys_seg[i].buffer & ~PAGE_MASK;
    1.21 +        bio_add_page(
    1.22 +            bio,
    1.23 +            virt_to_page(MMAP_VADDR(pending_idx, i)),
    1.24 +            phys_seg[i].nr_sects << 9,
    1.25 +            phys_seg[i].buffer & ~PAGE_MASK);
    1.26  
    1.27 -        bio->bi_size    = bv->bv_len;
    1.28 -        bio->bi_vcnt++;
    1.29 -
    1.30 -        submit_bio(operation, bio);
    1.31 +        submit_bio(operation | (1 << BIO_RW_SYNC), bio);
    1.32      }
    1.33  #endif
    1.34