ia64/xen-unstable

changeset 392:561ef4670036

bitkeeper revision 1.184.1.4 (3ead1db8tA_S2OPhEXeHGdyDCCSayw)

Merge scramble.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into scramble.cl.cam.ac.uk:/local/scratch/kaf24/xeno
author kaf24@scramble.cl.cam.ac.uk
date Mon Apr 28 12:25:28 2003 +0000 (2003-04-28)
parents 87ad003d8f24 352d467b7f51
children d1688684d94d 8b0a613b55b5
files xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_block.c xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_block.h xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_ide.c xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_scsi.c xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_segment.c xenolinux-2.4.21-pre4-sparse/include/linux/major.h xenolinux-2.4.21-pre4-sparse/init/do_mounts.c
line diff
     1.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_block.c	Mon Apr 28 11:59:53 2003 +0000
     1.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_block.c	Mon Apr 28 12:25:28 2003 +0000
     1.3 @@ -10,8 +10,6 @@
     1.4  
     1.5  typedef unsigned char byte; /* from linux/ide.h */
     1.6  
     1.7 -#define XLBLK_MAX 32
     1.8 -
     1.9  #define XLBLK_RESPONSE_IRQ _EVENT_BLK_RESP
    1.10  #define DEBUG_IRQ          _EVENT_DEBUG 
    1.11  
     2.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_block.h	Mon Apr 28 11:59:53 2003 +0000
     2.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_block.h	Mon Apr 28 12:25:28 2003 +0000
     2.3 @@ -35,12 +35,20 @@
     2.4  #define DPRINTK_IOCTL(_f, _a...) ((void)0)
     2.5  #endif
     2.6  
     2.7 -/* IDE/SCSI have <= 32 partitions per device. VIRT has <= 16. */
     2.8 -#define PARTN_SHIFT(_dev) ((MAJOR(_dev)==XLVIRT_MAJOR) ? 4 : 5)
     2.9 -#define XLIDE_PARTN_SHIFT  5
    2.10 -#define XLSCSI_PARTN_SHIFT 5
    2.11 +/* XL IDE and SCSI use same major/minor numbers as normal Linux devices. */
    2.12 +#define XLIDE_MAJOR IDE0_MAJOR
    2.13 +#define XLSCSI_MAJOR SCSI_DISK0_MAJOR
    2.14 +
    2.15 +/* IDE has < 64 partitions per device. VIRT and SCSI have < 16. */
    2.16 +#define PARTN_SHIFT(_dev) ((MAJOR(_dev)==IDE0_MAJOR) ? 6 : 4)
    2.17 +#define XLIDE_PARTN_SHIFT  6
    2.18 +#define XLSCSI_PARTN_SHIFT 4
    2.19  #define XLVIRT_PARTN_SHIFT 4
    2.20  
    2.21 +#define XLIDE_DEVS_PER_MAJOR  (256 >> XLIDE_PARTN_SHIFT)
    2.22 +#define XLSCSI_DEVS_PER_MAJOR (256 >> XLSCSI_PARTN_SHIFT)
    2.23 +#define XLVIRT_DEVS_PER_MAJOR (256 >> XLVIRT_PARTN_SHIFT)
    2.24 +
    2.25  /*
    2.26   * We have one of these per XL-IDE, XL-SCSI, and XL-VIRT device.
    2.27   * They hang in an array off the gendisk structure. We may end up putting
     3.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_ide.c	Mon Apr 28 11:59:53 2003 +0000
     3.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_ide.c	Mon Apr 28 12:25:28 2003 +0000
     3.3 @@ -2,7 +2,6 @@
     3.4   * xl_ide.c
     3.5   * 
     3.6   * Xenolinux virtual IDE block-device driver.
     3.7 - * 
     3.8   */
     3.9  
    3.10  #include "xl_block.h"
    3.11 @@ -10,9 +9,8 @@
    3.12  #define MAJOR_NR XLIDE_MAJOR 
    3.13  #include <linux/blk.h>
    3.14  
    3.15 -/* We support up to 16 devices of up to 16 partitions each. */
    3.16  #define XLIDE_MAX         256
    3.17 -#define XLIDE_MAJOR_NAME "xhd"
    3.18 +#define XLIDE_MAJOR_NAME "hd"
    3.19  static int xlide_blksize_size[XLIDE_MAX];
    3.20  static int xlide_hardsect_size[XLIDE_MAX];
    3.21  static int xlide_max_sectors[XLIDE_MAX];
    3.22 @@ -45,7 +43,9 @@ int xlide_init(xen_disk_info_t *xdi)
    3.23      units = 0;
    3.24      for ( i = 0; i < xdi->count; i++ )
    3.25          if ( IS_IDE_XENDEV(xdi->disks[i].device) &&
    3.26 -             ((xdi->disks[i].device & XENDEV_IDX_MASK) < 16) ) units++;
    3.27 +             ((xdi->disks[i].device & XENDEV_IDX_MASK) <
    3.28 +              XLIDE_DEVS_PER_MAJOR) ) 
    3.29 +            units++;
    3.30      if ( units == 0 ) return 0;
    3.31  
    3.32      SET_MODULE_OWNER(&xlide_block_fops);
    3.33 @@ -112,8 +112,9 @@ int xlide_init(xen_disk_info_t *xdi)
    3.34  	minor = disk << XLIDE_PARTN_SHIFT; 
    3.35  
    3.36  
    3.37 -        /* We can use the first 16 IDE devices. */
    3.38 -        if ( !IS_IDE_XENDEV(xdi->disks[i].device) || (disk >= 16) ) continue;
    3.39 +        if ( !IS_IDE_XENDEV(xdi->disks[i].device) || 
    3.40 +             (disk >= XLIDE_DEVS_PER_MAJOR) ) 
    3.41 +            continue;
    3.42  
    3.43          ((xl_disk_t *)gd->real_devices)[disk].capacity =
    3.44              xdi->disks[i].capacity;
     4.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_scsi.c	Mon Apr 28 11:59:53 2003 +0000
     4.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_scsi.c	Mon Apr 28 12:25:28 2003 +0000
     4.3 @@ -2,7 +2,6 @@
     4.4   * xl_scsi.c
     4.5   * 
     4.6   * Xenolinux virtual SCSI block-device driver.
     4.7 - * 
     4.8   */
     4.9  
    4.10  #include "xl_block.h"
    4.11 @@ -10,9 +9,8 @@
    4.12  #define MAJOR_NR XLSCSI_MAJOR
    4.13  #include <linux/blk.h>
    4.14  
    4.15 -/* We support up to 16 devices of up to 16 partitions each. */
    4.16  #define XLSCSI_MAX        256
    4.17 -#define XLSCSI_MAJOR_NAME "xsd"
    4.18 +#define XLSCSI_MAJOR_NAME "sd"
    4.19  static int xlscsi_blksize_size[XLSCSI_MAX];
    4.20  static int xlscsi_hardsect_size[XLSCSI_MAX];
    4.21  static int xlscsi_max_sectors[XLSCSI_MAX];
    4.22 @@ -45,7 +43,9 @@ int xlscsi_init(xen_disk_info_t *xdi)
    4.23      units = 0;
    4.24      for ( i = 0; i < xdi->count; i++ )
    4.25          if ( IS_SCSI_XENDEV(xdi->disks[i].device) &&
    4.26 -             ((xdi->disks[i].device & XENDEV_IDX_MASK) < 16) ) units++;
    4.27 +             ((xdi->disks[i].device & XENDEV_IDX_MASK) <
    4.28 +              XLSCSI_DEVS_PER_MAJOR) ) 
    4.29 +            units++;
    4.30      if ( units == 0 ) return 0;
    4.31  
    4.32      SET_MODULE_OWNER(&xlscsi_block_fops);
    4.33 @@ -110,8 +110,9 @@ int xlscsi_init(xen_disk_info_t *xdi)
    4.34      {
    4.35          disk = xdi->disks[i].device & XENDEV_IDX_MASK;
    4.36  
    4.37 -        /* We can use the first 16 IDE devices. */
    4.38 -        if ( !IS_SCSI_XENDEV(xdi->disks[i].device) || (disk >= 16) ) continue;
    4.39 +        if ( !IS_SCSI_XENDEV(xdi->disks[i].device) || 
    4.40 +             (disk >= XLSCSI_DEVS_PER_MAJOR) )
    4.41 +            continue;
    4.42  
    4.43          ((xl_disk_t *)gd->real_devices)[disk].capacity =
    4.44              xdi->disks[i].capacity;
     5.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_segment.c	Mon Apr 28 11:59:53 2003 +0000
     5.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_segment.c	Mon Apr 28 12:25:28 2003 +0000
     5.3 @@ -13,7 +13,6 @@
     5.4  /* Copied from linux/ide.h */
     5.5  typedef unsigned char byte; 
     5.6  
     5.7 -/* We support up to 16 devices of up to 16 partitions each. */
     5.8  #define XLVIRT_MAX        256
     5.9  #define XLVIRT_MAJOR_NAME "xvd"
    5.10  static int xlseg_blksize_size[XLVIRT_MAX];
    5.11 @@ -119,8 +118,8 @@ int __init xlseg_init(void)
    5.12      {
    5.13          disk = xdi->disks[i].device & XENDEV_IDX_MASK;
    5.14  
    5.15 -        /* We can use the first 16 IDE devices. */
    5.16 -        if ( !IS_VIRTUAL_XENDEV(xdi->disks[i].device) || (disk >= 16) )
    5.17 +        if ( !IS_VIRTUAL_XENDEV(xdi->disks[i].device) || 
    5.18 +             (disk >= XLVIRT_DEVS_PER_MAJOR) )
    5.19              continue;
    5.20  
    5.21          ((xl_disk_t *)gd->real_devices)[disk].capacity =
     6.1 --- a/xenolinux-2.4.21-pre4-sparse/include/linux/major.h	Mon Apr 28 11:59:53 2003 +0000
     6.2 +++ b/xenolinux-2.4.21-pre4-sparse/include/linux/major.h	Mon Apr 28 12:25:28 2003 +0000
     6.3 @@ -146,15 +146,10 @@
     6.4  #define	UMEM_MAJOR	116	/* http://www.umem.com/ Battery Backed RAM */
     6.5  
     6.6  /*
     6.7 - * XLIDE/XLSCSI each support up to 8 devices of <= 32 partitions each.
     6.8   * XLVIRT supports 16 devices of <= 16 partitions each.
     6.9 - * eg. xhda == (123, 0), xhdb == (123, 32), ...
    6.10 - *     xsda == (124, 0), xsdb == (124, 32), ...
    6.11 - *     xvda == (125, 0), xvdb == (125, 16), ...
    6.12 + * eg. xvda == (125, 0), xvdb == (125, 16), ...
    6.13   */
    6.14 -#define XLIDE_MAJOR	123	/* XenoLinux IDE Device */
    6.15 -#define XLSCSI_MAJOR	124	/* XenoLinux SCSI Device */
    6.16 -#define XLVIRT_MAJOR    125     /* XenoLinux Virtual Device */
    6.17 +#define XLVIRT_MAJOR    125
    6.18  
    6.19  #define RTF_MAJOR	150
    6.20  #define RAW_MAJOR	162
     7.1 --- a/xenolinux-2.4.21-pre4-sparse/init/do_mounts.c	Mon Apr 28 11:59:53 2003 +0000
     7.2 +++ b/xenolinux-2.4.21-pre4-sparse/init/do_mounts.c	Mon Apr 28 12:25:28 2003 +0000
     7.3 @@ -231,17 +231,6 @@ static struct dev_name_struct {
     7.4  	{ "ataraid/d14p",0x72E0 },
     7.5  	{ "ataraid/d15p",0x72F0 },
     7.6  #if defined(CONFIG_XENOLINUX_BLOCK)
     7.7 -        /* XenoLinux IDE Devices */
     7.8 -        { "xhda", 0x7B00 }, { "xhdb", 0x7B20 },
     7.9 -        { "xhdc", 0x7B40 }, { "xhdd", 0x7B60 },
    7.10 -        { "xhde", 0x7B80 }, { "xhdf", 0x7BA0 },
    7.11 -        { "xhdg", 0x7BC0 }, { "xhdh", 0x7BE0 },
    7.12 -        /* Xenolinux SCSI Devices */
    7.13 -        { "xsda", 0x7C00 }, { "xsdb", 0x7C20 },
    7.14 -        { "xsdc", 0x7C40 }, { "xsdd", 0x7C60 },
    7.15 -        { "xsde", 0x7C80 }, { "xsdf", 0x7CA0 },
    7.16 -        { "xsdg", 0x7CC0 }, { "xsdh", 0x7CE0 },
    7.17 -        /* XenoLinux Virtual Devices */
    7.18          { "xvda", 0x7D00 }, { "xvdb", 0x7D10 },
    7.19          { "xvdc", 0x7D20 }, { "xvdd", 0x7D30 },
    7.20          { "xvde", 0x7D40 }, { "xvdf", 0x7D50 },