ia64/xen-unstable

changeset 6366:b3eb952c04ee

Move major/minor macros into public header, rename and use.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Tue Aug 23 15:26:54 2005 +0000 (2005-08-23)
parents 28e55fad651f
children a826ad59b3ea
files linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c xen/include/public/io/blkif.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Tue Aug 23 13:18:45 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Tue Aug 23 15:26:54 2005 +0000
     1.3 @@ -79,9 +79,6 @@ static struct xlbd_major_info *major_inf
     1.4  #define MAX_VBDS 64
     1.5  static LIST_HEAD(vbds_list);
     1.6  
     1.7 -#define MAJOR_XEN(dev) ((dev)>>8)
     1.8 -#define MINOR_XEN(dev) ((dev) & 0xff)
     1.9 -
    1.10  static struct block_device_operations xlvbd_block_fops =
    1.11  {
    1.12  	.owner = THIS_MODULE,
    1.13 @@ -139,8 +136,8 @@ xlbd_get_major_info(int vdevice)
    1.14  	struct xlbd_major_info *mi;
    1.15  	int major, minor, index;
    1.16  
    1.17 -	major = MAJOR_XEN(vdevice);
    1.18 -	minor = MINOR_XEN(vdevice);
    1.19 +	major = BLKIF_MAJOR(vdevice);
    1.20 +	minor = BLKIF_MINOR(vdevice);
    1.21  
    1.22  	switch (major) {
    1.23  	case IDE0_MAJOR: index = 0; break;
    1.24 @@ -276,13 +273,13 @@ xlvbd_add(blkif_sector_t capacity, int v
    1.25  	struct block_device *bd;
    1.26  	int err = 0;
    1.27  
    1.28 -	info->dev = MKDEV(MAJOR_XEN(vdevice), MINOR_XEN(vdevice));
    1.29 +	info->dev = MKDEV(BLKIF_MAJOR(vdevice), BLKIF_MINOR(vdevice));
    1.30  
    1.31  	bd = bdget(info->dev);
    1.32  	if (bd == NULL)
    1.33  		return -ENODEV;
    1.34  
    1.35 -	err = xlvbd_alloc_gendisk(MINOR_XEN(vdevice), capacity, vdevice,
    1.36 +	err = xlvbd_alloc_gendisk(BLKIF_MINOR(vdevice), capacity, vdevice,
    1.37  				  vdisk_info, sector_size, info);
    1.38  
    1.39  	bdput(bd);
     2.1 --- a/xen/include/public/io/blkif.h	Tue Aug 23 13:18:45 2005 +0000
     2.2 +++ b/xen/include/public/io/blkif.h	Tue Aug 23 15:26:54 2005 +0000
     2.3 @@ -58,6 +58,9 @@ typedef struct blkif_response {
     2.4  #define BLKIF_RSP_ERROR  -1 /* non-specific 'error' */
     2.5  #define BLKIF_RSP_OKAY    0 /* non-specific 'okay'  */
     2.6  
     2.7 +#define BLKIF_MAJOR(dev) ((dev)>>8)
     2.8 +#define BLKIF_MINOR(dev) ((dev) & 0xff)
     2.9 +
    2.10  /*
    2.11   * Generate blkif ring structures and types.
    2.12   */