ChangeSet 1.1159.256.77, 2005/03/30 10:59:54+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx
Rationalise blkdev settings in frontend drivers.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
linux-2.4.29-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c | 15 ++---
linux-2.6.11-xen-sparse/drivers/xen/blkfront/block.h | 2
linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c | 30 ++--------
3 files changed, 13 insertions(+), 34 deletions(-)
diff -Nru a/linux-2.4.29-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c
b/linux-2.4.29-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c
--- a/linux-2.4.29-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c
2005-03-30 06:03:47 -05:00
+++ b/linux-2.4.29-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c
2005-03-30 06:03:47 -05:00
@@ -169,14 +169,14 @@
blksize_size[major] = xlide_blksize_size;
hardsect_size[major] = xlide_hardsect_size;
max_sectors[major] = xlide_max_sectors;
- read_ahead[major] = 8; /* from drivers/ide/ide-probe.c */
+ read_ahead[major] = 8;
}
else if ( is_scsi )
{
blksize_size[major] = xlscsi_blksize_size;
hardsect_size[major] = xlscsi_hardsect_size;
max_sectors[major] = xlscsi_max_sectors;
- read_ahead[major] = 0; /* XXX 8; -- guessing */
+ read_ahead[major] = 8;
}
else
{
@@ -529,20 +529,17 @@
/* Initialize the global arrays. */
for ( i = 0; i < 256; i++ )
{
- /* from the generic ide code (drivers/ide/ide-probe.c, etc) */
xlide_blksize_size[i] = 1024;
xlide_hardsect_size[i] = 512;
- xlide_max_sectors[i] = 128; /* 'hwif->rqsize' if we knew it */
+ xlide_max_sectors[i] = 512;
- /* from the generic scsi disk code (drivers/scsi/sd.c) */
- xlscsi_blksize_size[i] = 1024; /* XXX 512; */
+ xlscsi_blksize_size[i] = 1024;
xlscsi_hardsect_size[i] = 512;
- xlscsi_max_sectors[i] = 128*8; /* XXX 128; */
+ xlscsi_max_sectors[i] = 512;
- /* we don't really know what to set these too since it depends */
xlvbd_blksize_size[i] = 512;
xlvbd_hardsect_size[i] = 512;
- xlvbd_max_sectors[i] = 128;
+ xlvbd_max_sectors[i] = 512;
}
vbd_info = kmalloc(MAX_VBDS * sizeof(vdisk_t), GFP_KERNEL);
diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/block.h
b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/block.h
--- a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/block.h 2005-03-30
06:03:47 -05:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/block.h 2005-03-30
06:03:47 -05:00
@@ -66,8 +66,6 @@
int partn_shift;
int partn_per_major;
int devs_per_major;
- int hardsect_size;
- int max_sectors;
char *devname;
char *diskname;
};
diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c
b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c
--- a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c 2005-03-30
06:03:48 -05:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c 2005-03-30
06:03:48 -05:00
@@ -33,9 +33,9 @@
#include <linux/blkdev.h>
/*
- * For convenience we distinguish between ide, scsi and 'other' (i.e.
- * potentially combinations of the two) in the naming scheme and in a few
- * other places (like default readahead, etc).
+ * For convenience we distinguish between ide, scsi and 'other' (i.e.,
+ * potentially combinations of the two) in the naming scheme and in a few other
+ * places.
*/
#define NUM_IDE_MAJORS 10
@@ -45,10 +45,6 @@
static struct xlbd_type_info xlbd_ide_type = {
.partn_shift = 6,
.partn_per_major = 2,
- // XXXcl todo blksize_size[major] = 1024;
- .hardsect_size = 512,
- .max_sectors = 128, /* 'hwif->rqsize' if we knew it */
- // XXXcl todo read_ahead[major] = 8; /* from drivers/ide/ide-probe.c */
.devname = "ide",
.diskname = "hd",
};
@@ -56,10 +52,6 @@
static struct xlbd_type_info xlbd_scsi_type = {
.partn_shift = 4,
.partn_per_major = 16,
- // XXXcl todo blksize_size[major] = 1024; /* XXX 512; */
- .hardsect_size = 512,
- .max_sectors = 128*8, /* XXX 128; */
- // XXXcl todo read_ahead[major] = 0; /* XXX 8; -- guessing */
.devname = "sd",
.diskname = "sd",
};
@@ -67,10 +59,6 @@
static struct xlbd_type_info xlbd_vbd_type = {
.partn_shift = 4,
.partn_per_major = 16,
- // XXXcl todo blksize_size[major] = 512;
- .hardsect_size = 512,
- .max_sectors = 128,
- // XXXcl todo read_ahead[major] = 8;
.devname = "xvd",
.diskname = "xvd",
};
@@ -245,17 +233,13 @@
elevator_init(xlbd_blk_queue, "noop");
/*
- * Turn off barking 'headactive' mode. We dequeue
- * buffer heads as soon as we pass them to back-end
- * driver.
+ * Turn off barking 'headactive' mode. We dequeue buffer heads as soon
+ * as we pass them to back-end driver.
*/
blk_queue_headactive(xlbd_blk_queue, 0);
- /* Hard sector size and max sectors impersonate the equiv. hardware. */
- blk_queue_hardsect_size(
- xlbd_blk_queue, mi->type->hardsect_size);
- blk_queue_max_sectors(
- xlbd_blk_queue, mi->type->max_sectors);
+ blk_queue_hardsect_size(xlbd_blk_queue, 512);
+ blk_queue_max_sectors(xlbd_blk_queue, 512);
/* Each segment in a request is up to an aligned page in size. */
blk_queue_segment_boundary(xlbd_blk_queue, PAGE_SIZE - 1);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|