Move major/minor macros into public header, rename and use.
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Tue, 23 Aug 2005 15:26:54 +0000 (15:26 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Tue, 23 Aug 2005 15:26:54 +0000 (15:26 +0000)
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c
xen/include/public/io/blkif.h

index 28f57b94d12922391c9e6c70de731a8ec8bb3f7b..ee20c26a9ec53ecda97304a1217c957dde5329ef 100644 (file)
@@ -79,9 +79,6 @@ static struct xlbd_major_info *major_info[NUM_IDE_MAJORS + NUM_SCSI_MAJORS +
 #define MAX_VBDS 64
 static LIST_HEAD(vbds_list);
 
-#define MAJOR_XEN(dev) ((dev)>>8)
-#define MINOR_XEN(dev) ((dev) & 0xff)
-
 static struct block_device_operations xlvbd_block_fops =
 {
        .owner = THIS_MODULE,
@@ -139,8 +136,8 @@ xlbd_get_major_info(int vdevice)
        struct xlbd_major_info *mi;
        int major, minor, index;
 
-       major = MAJOR_XEN(vdevice);
-       minor = MINOR_XEN(vdevice);
+       major = BLKIF_MAJOR(vdevice);
+       minor = BLKIF_MINOR(vdevice);
 
        switch (major) {
        case IDE0_MAJOR: index = 0; break;
@@ -276,13 +273,13 @@ xlvbd_add(blkif_sector_t capacity, int vdevice, u16 vdisk_info,
        struct block_device *bd;
        int err = 0;
 
-       info->dev = MKDEV(MAJOR_XEN(vdevice), MINOR_XEN(vdevice));
+       info->dev = MKDEV(BLKIF_MAJOR(vdevice), BLKIF_MINOR(vdevice));
 
        bd = bdget(info->dev);
        if (bd == NULL)
                return -ENODEV;
 
-       err = xlvbd_alloc_gendisk(MINOR_XEN(vdevice), capacity, vdevice,
+       err = xlvbd_alloc_gendisk(BLKIF_MINOR(vdevice), capacity, vdevice,
                                  vdisk_info, sector_size, info);
 
        bdput(bd);
index 26a33a448c682e4289e7804b905e984425d13493..c57ff15d25b6599920f1d7682e9852bf4fa35197 100644 (file)
@@ -58,6 +58,9 @@ typedef struct blkif_response {
 #define BLKIF_RSP_ERROR  -1 /* non-specific 'error' */
 #define BLKIF_RSP_OKAY    0 /* non-specific 'okay'  */
 
+#define BLKIF_MAJOR(dev) ((dev)>>8)
+#define BLKIF_MINOR(dev) ((dev) & 0xff)
+
 /*
  * Generate blkif ring structures and types.
  */