direct-io.hg

changeset 4379:9f889c7b053b

bitkeeper revision 1.1159.258.77 (424a789awnI9QtGxkwnLulWuRuSRxA)

Rationalise blkdev settings in frontend drivers.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Mar 30 09:59:54 2005 +0000 (2005-03-30)
parents fff34e3e2b40
children d1595511060c 85f87d4249f9 52c3b00d09bb
files linux-2.4.29-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c linux-2.6.11-xen-sparse/drivers/xen/blkfront/block.h linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c
line diff
     1.1 --- a/linux-2.4.29-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c	Tue Mar 29 08:05:47 2005 +0000
     1.2 +++ b/linux-2.4.29-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c	Wed Mar 30 09:59:54 2005 +0000
     1.3 @@ -169,14 +169,14 @@ static int xlvbd_init_device(vdisk_t *xd
     1.4              blksize_size[major]  = xlide_blksize_size;
     1.5              hardsect_size[major] = xlide_hardsect_size;
     1.6              max_sectors[major]   = xlide_max_sectors;
     1.7 -            read_ahead[major]    = 8; /* from drivers/ide/ide-probe.c */
     1.8 +            read_ahead[major]    = 8;
     1.9          } 
    1.10          else if ( is_scsi )
    1.11          { 
    1.12              blksize_size[major]  = xlscsi_blksize_size;
    1.13              hardsect_size[major] = xlscsi_hardsect_size;
    1.14              max_sectors[major]   = xlscsi_max_sectors;
    1.15 -            read_ahead[major]    = 0; /* XXX 8; -- guessing */
    1.16 +            read_ahead[major]    = 8;
    1.17          }
    1.18          else
    1.19          { 
    1.20 @@ -529,20 +529,17 @@ int xlvbd_init(void)
    1.21      /* Initialize the global arrays. */
    1.22      for ( i = 0; i < 256; i++ ) 
    1.23      {
    1.24 -        /* from the generic ide code (drivers/ide/ide-probe.c, etc) */
    1.25          xlide_blksize_size[i]  = 1024;
    1.26          xlide_hardsect_size[i] = 512;
    1.27 -        xlide_max_sectors[i]   = 128;  /* 'hwif->rqsize' if we knew it */
    1.28 +        xlide_max_sectors[i]   = 512;
    1.29  
    1.30 -        /* from the generic scsi disk code (drivers/scsi/sd.c) */
    1.31 -        xlscsi_blksize_size[i]  = 1024; /* XXX 512; */
    1.32 +        xlscsi_blksize_size[i]  = 1024;
    1.33          xlscsi_hardsect_size[i] = 512;
    1.34 -        xlscsi_max_sectors[i]   = 128*8; /* XXX 128; */
    1.35 +        xlscsi_max_sectors[i]   = 512;
    1.36  
    1.37 -        /* we don't really know what to set these too since it depends */
    1.38          xlvbd_blksize_size[i]  = 512;
    1.39          xlvbd_hardsect_size[i] = 512;
    1.40 -        xlvbd_max_sectors[i]   = 128;
    1.41 +        xlvbd_max_sectors[i]   = 512;
    1.42      }
    1.43  
    1.44      vbd_info = kmalloc(MAX_VBDS * sizeof(vdisk_t), GFP_KERNEL);
     2.1 --- a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/block.h	Tue Mar 29 08:05:47 2005 +0000
     2.2 +++ b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/block.h	Wed Mar 30 09:59:54 2005 +0000
     2.3 @@ -66,8 +66,6 @@ struct xlbd_type_info {
     2.4      int partn_shift;
     2.5      int partn_per_major;
     2.6      int devs_per_major;
     2.7 -    int hardsect_size;
     2.8 -    int max_sectors;
     2.9      char *devname;
    2.10      char *diskname;
    2.11  };
     3.1 --- a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c	Tue Mar 29 08:05:47 2005 +0000
     3.2 +++ b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c	Wed Mar 30 09:59:54 2005 +0000
     3.3 @@ -33,9 +33,9 @@
     3.4  #include <linux/blkdev.h>
     3.5  
     3.6  /*
     3.7 - * For convenience we distinguish between ide, scsi and 'other' (i.e.
     3.8 - * potentially combinations of the two) in the naming scheme and in a few 
     3.9 - * other places (like default readahead, etc).
    3.10 + * For convenience we distinguish between ide, scsi and 'other' (i.e.,
    3.11 + * potentially combinations of the two) in the naming scheme and in a few other
    3.12 + * places.
    3.13   */
    3.14  
    3.15  #define NUM_IDE_MAJORS 10
    3.16 @@ -45,10 +45,6 @@
    3.17  static struct xlbd_type_info xlbd_ide_type = {
    3.18      .partn_shift = 6,
    3.19      .partn_per_major = 2,
    3.20 -    // XXXcl todo blksize_size[major]  = 1024;
    3.21 -    .hardsect_size = 512,
    3.22 -    .max_sectors = 128,  /* 'hwif->rqsize' if we knew it */
    3.23 -    // XXXcl todo read_ahead[major]    = 8; /* from drivers/ide/ide-probe.c */
    3.24      .devname = "ide",
    3.25      .diskname = "hd",
    3.26  };
    3.27 @@ -56,10 +52,6 @@ static struct xlbd_type_info xlbd_ide_ty
    3.28  static struct xlbd_type_info xlbd_scsi_type = {
    3.29      .partn_shift = 4,
    3.30      .partn_per_major = 16,
    3.31 -    // XXXcl todo blksize_size[major]  = 1024; /* XXX 512; */
    3.32 -    .hardsect_size = 512,
    3.33 -    .max_sectors = 128*8, /* XXX 128; */
    3.34 -    // XXXcl todo read_ahead[major]    = 0; /* XXX 8; -- guessing */
    3.35      .devname = "sd",
    3.36      .diskname = "sd",
    3.37  };
    3.38 @@ -67,10 +59,6 @@ static struct xlbd_type_info xlbd_scsi_t
    3.39  static struct xlbd_type_info xlbd_vbd_type = {
    3.40      .partn_shift = 4,
    3.41      .partn_per_major = 16,
    3.42 -    // XXXcl todo blksize_size[major]  = 512;
    3.43 -    .hardsect_size = 512,
    3.44 -    .max_sectors = 128,
    3.45 -    // XXXcl todo read_ahead[major]    = 8;
    3.46      .devname = "xvd",
    3.47      .diskname = "xvd",
    3.48  };
    3.49 @@ -245,17 +233,13 @@ static struct gendisk *xlvbd_get_gendisk
    3.50          elevator_init(xlbd_blk_queue, "noop");
    3.51  
    3.52          /*
    3.53 -         * Turn off barking 'headactive' mode. We dequeue
    3.54 -         * buffer heads as soon as we pass them to back-end
    3.55 -         * driver.
    3.56 +         * Turn off barking 'headactive' mode. We dequeue buffer heads as soon 
    3.57 +         * as we pass them to back-end driver.
    3.58           */
    3.59          blk_queue_headactive(xlbd_blk_queue, 0);
    3.60  
    3.61 -        /* Hard sector size and max sectors impersonate the equiv. hardware. */
    3.62 -        blk_queue_hardsect_size(
    3.63 -            xlbd_blk_queue, mi->type->hardsect_size);
    3.64 -        blk_queue_max_sectors(
    3.65 -            xlbd_blk_queue, mi->type->max_sectors);
    3.66 +        blk_queue_hardsect_size(xlbd_blk_queue, 512);
    3.67 +        blk_queue_max_sectors(xlbd_blk_queue, 512);
    3.68  
    3.69          /* Each segment in a request is up to an aligned page in size. */
    3.70          blk_queue_segment_boundary(xlbd_blk_queue, PAGE_SIZE - 1);