From a1d9c833f9d09d06d1bea1ce9526cf5b04c33593 Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Tue, 23 Aug 2005 15:26:54 +0000 Subject: [PATCH] Move major/minor macros into public header, rename and use. Signed-off-by: Christian Limpach --- linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c | 11 ++++------- xen/include/public/io/blkif.h | 3 +++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c index 28f57b94d1..ee20c26a9e 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c @@ -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); diff --git a/xen/include/public/io/blkif.h b/xen/include/public/io/blkif.h index 26a33a448c..c57ff15d25 100644 --- a/xen/include/public/io/blkif.h +++ b/xen/include/public/io/blkif.h @@ -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. */ -- 2.30.2