Skip to contentSkip to conversation

2.5.38 s390 fixes: 05_dasd.

PATCH New Martin Schwidefsky 1 participant 1 message Sep 24, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.5.38 s390 fixes: 05_dasd.

Allocate gendisk structure per dasd device, replace kdev_t by a bdev pointer where possible and remove option CONFIG_DASD_DYNAMIC.

drivers/s390/block/dasd.c +61 -46
diff -urN linux-2.5.38/drivers/s390/block/dasd.c linux-2.5.38-s390/drivers/s390/block/dasd.c
@@ -203,20 +203,24 @@
 dasd_alloc_device(dasd_devmap_t *devmap)
 {
 	dasd_device_t *device;
+	struct gendisk *gdp;
 	int rc;
 
-	/* Make sure the gendisk structure for this device exists. */
-	while (dasd_gendisk_from_devindex(devmap->devindex) == NULL) {
-		rc = dasd_gendisk_new_major();
-		if (rc)
-			return ERR_PTR(rc);
-	}
-
 	device = kmalloc(sizeof (dasd_device_t), GFP_ATOMIC);
 	if (device == NULL)
 		return ERR_PTR(-ENOMEM);
 	memset(device, 0, sizeof (dasd_device_t));
 
+	/* Get devinfo from the common io layer. */
+	rc = get_dev_info_by_devno(devmap->devno, &device->devinfo);
+	if (rc) {
+		kfree(device);
+		return ERR_PTR(rc);
+	}
+	DBF_EVENT(DBF_NOTICE, "got devinfo CU-type %04x and dev-type %04x",
+		  device->devinfo.sid_data.cu_type,
+		  device->devinfo.sid_data.dev_type);
+
 	/* Get two pages for normal block device operations. */
 	device->ccw_mem = (void *) __get_free_pages(GFP_ATOMIC | GFP_DMA, 1);
 	if (device->ccw_mem == NULL) {
@@ -231,17 +235,15 @@
 		return ERR_PTR(-ENOMEM);
 	}
 
-	/* Get devinfo from the common io layer. */
-	rc = get_dev_info_by_devno(devmap->devno, &device->devinfo);
-	if (rc) {
- 		free_page((unsigned long) device->erp_mem);
+	/* Allocate gendisk structure for device. */
+	gdp = dasd_gendisk_alloc(device->name, devmap->devindex);
+	if (IS_ERR(gdp)) {
+		free_page((unsigned long) device->erp_mem);
 		free_pages((unsigned long) device->ccw_mem, 1);
 		kfree(device);
-		return ERR_PTR(rc);
+		return (dasd_device_t *) gdp;
 	}
-	DBF_EVENT(DBF_NOTICE, "got devinfo CU-type %04x and dev-type %04x",
-		  device->devinfo.sid_data.cu_type,
-		  device->devinfo.sid_data.dev_type);
+	device->gdp = gdp;
 
 	dasd_init_chunklist(&device->ccw_chunks, device->ccw_mem, PAGE_SIZE*2);
 	dasd_init_chunklist(&device->erp_chunks, device->erp_mem, PAGE_SIZE);
@@ -268,6 +270,7 @@
 		kfree(device->private);
 	free_page((unsigned long) device->erp_mem);
 	free_pages((unsigned long) device->ccw_mem, 1);
+	dasd_gendisk_free(device->gdp);
 	kfree(device);
 }
 
@@ -278,21 +281,22 @@
 dasd_state_new_to_known(dasd_device_t *device)
 {
 	char buffer[5];
-	struct gendisk *gdp;
 	dasd_devmap_t *devmap;
 	umode_t devfs_perm;
 	devfs_handle_t dir;
-	int minor, rc;
+	int major, minor, rc;
 
 	devmap = dasd_devmap_from_devno(device->devinfo.devno);
 	if (devmap == NULL)
 		return -ENODEV;
-	gdp = dasd_gendisk_from_devindex(devmap->devindex);
-	if (gdp == NULL)
+	major = dasd_gendisk_index_major(devmap->devindex);
+	if (major < 0)
 		return -ENODEV;
-	/* Set kdev and the device name. */
-	device->kdev = mk_kdev(gdp->major, gdp->first_minor);
-	strcpy(device->name, gdp->major_name);
+	minor = devmap->devindex % DASD_PER_MAJOR;
+
+	/* Set bdev and the device name. */
+	device->bdev = bdget(MKDEV(major, minor << DASD_PARTN_BITS));
+	strcpy(device->name, device->gdp->major_name);
 
 	/* Find a discipline for the device. */
 	rc = dasd_find_disc(device);
@@ -302,14 +306,13 @@
 	/* Add a proc directory and the dasd device entry to devfs. */
 	sprintf(buffer, "%04x", device->devinfo.devno);
 	dir = devfs_mk_dir(dasd_devfs_handle, buffer, device);
-	gdp->de = dir;
+	device->gdp->de = dir;
 	if (devmap->features & DASD_FEATURE_READONLY)
 		devfs_perm = S_IFBLK | S_IRUSR;
 	else
 		devfs_perm = S_IFBLK | S_IRUSR | S_IWUSR;
 	device->devfs_entry = devfs_register(dir, "device", DEVFS_FL_DEFAULT,
-					     major(device->kdev),
-					     minor(device->kdev),
+					     major, minor << DASD_PARTN_BITS,
 					     devfs_perm,
 					     &dasd_device_operations, NULL);
 	device->state = DASD_STATE_KNOWN;
@@ -322,17 +325,25 @@
 static inline void
 dasd_state_known_to_new(dasd_device_t * device)
 {
-	dasd_devmap_t *devmap = dasd_devmap_from_devno(device->devinfo.devno);
-	struct gendisk *gdp = dasd_gendisk_from_devindex(devmap->devindex);
-	if (gdp == NULL)
-		return;
+	dasd_devmap_t *devmap;
+	struct block_device *bdev;
+	int minor;
+
+	devmap = dasd_devmap_from_devno(device->devinfo.devno);
+	minor = devmap->devindex % DASD_PER_MAJOR;
+
 	/* Remove device entry and devfs directory. */
 	devfs_unregister(device->devfs_entry);
-	devfs_unregister(gdp->de);
+	devfs_unregister(device->gdp->de);
 
 	/* Forget the discipline information. */
 	device->discipline = NULL;
 	device->state = DASD_STATE_NEW;
+
+	/* Forget the block device */
+	bdev = device->bdev;
+	device->bdev = NULL;
+	bdput(bdev);
 }
 
 /*
@@ -419,21 +430,29 @@
 }
 
 /*
+ * get the kdev_t of a device 
+ * FIXME: remove this when no longer needed
+ */
+static inline kdev_t
+dasd_partition_to_kdev_t(dasd_device_t *device, unsigned int partition)
+{
+	return to_kdev_t(device->bdev->bd_dev+partition);
+}
+
+
+/*
  * Setup block device.
  */
 static inline int
 dasd_state_accept_to_ready(dasd_device_t * device)
 {
 	dasd_devmap_t *devmap;
-	int major, minor;
 	int rc, i;
 
 	devmap = dasd_devmap_from_devno(device->devinfo.devno);
 	if (devmap->features & DASD_FEATURE_READONLY) {
-		major = major(device->kdev);
-		minor = minor(device->kdev);
 		for (i = 0; i < (1 << DASD_PARTN_BITS); i++)
-			set_device_ro(mk_kdev(major, minor+i), 1);
+			set_device_ro(dasd_partition_to_kdev_t(device, i), 1);
 		DEV_MESSAGE (KERN_WARNING, device, "%s",
 			     "setting read-only mode ");
 	}
@@ -1539,11 +1558,9 @@
 			goto restart;
 		}
 
-		/* Dechain request from device request queue ... */
+		/* Rechain request on device device request queue */
 		cqr->endclk = get_clock();
-		list_del(&cqr->list);
-		/* ... and add it to list of final requests. */
-		list_add_tail(&cqr->list, final_queue);
+		list_move_tail(&cqr->list, final_queue);
 	}
 }
 
@@ -1572,6 +1589,10 @@
 	dasd_ccw_req_t *cqr;
 	int nr_queued;
 
+	/* No bdev, no queue. */
+	bdev = device->bdev;
+	if (!bdev)
+		return;
 	queue = device->request_queue;
 	/* No queue ? Then there is nothing to do. */
 	if (queue == NULL)
@@ -1594,9 +1615,6 @@
 		if (cqr->status == DASD_CQR_QUEUED)
 			nr_queued++;
 	}
-	bdev = bdget(kdev_t_to_nr(device->kdev));
-	if (!bdev)
-		return;
 	while (!blk_queue_plugged(queue) &&
 	       !blk_queue_empty(queue) &&
 		nr_queued < DASD_CHANQ_MAX_SIZE) {
@@ -1628,7 +1646,6 @@
 		dasd_profile_start(device, cqr, req);
 		nr_queued++;
 	}
-	bdput(bdev);
 }
 
 /*
@@ -1707,11 +1724,9 @@
 			__dasd_process_erp(device, cqr);
 			continue;
 		}
-		/* Dechain request from device request queue ... */
+		/* Rechain request on device request queue */
 		cqr->endclk = get_clock();
-		list_del(&cqr->list);
-		/* ... and add it to list of flushed requests. */
-		list_add_tail(&cqr->list, &flush_queue);
+		list_move_tail(&cqr->list, &flush_queue);
 	}
 	spin_unlock_irq(get_irq_lock(device->devinfo.irq));
 	/* Now call the callback function of flushed requests */
drivers/s390/block/dasd_devmap.c +9 -0
diff -urN linux-2.5.38/drivers/s390/block/dasd_devmap.c linux-2.5.38-s390/drivers/s390/block/dasd_devmap.c
@@ -449,6 +449,15 @@
 }
 
 /*
+ * Find the devmap for a device corresponding to a block_device.
+ */
+dasd_devmap_t *
+dasd_devmap_from_bdev(struct block_device *bdev)
+{
+	return dasd_devmap_from_kdev(to_kdev_t(bdev->bd_dev));
+}
+
+/*
  * Find the device structure for device number devno. If it does not
  * exists yet, allocate it. Increase the reference counter in the device
  * structure and return a pointer to it.
drivers/s390/block/dasd_diag.c +7 -7
diff -urN linux-2.5.38/drivers/s390/block/dasd_diag.c linux-2.5.38-s390/drivers/s390/block/dasd_diag.c
@@ -21,6 +21,7 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/hdreg.h>	/* HDIO_GETGEO			    */
+#include <linux/bio.h>
 
 #include <asm/dasd.h>
 #include <asm/debug.h>
@@ -155,7 +156,7 @@
 	private->iob.key = 0;
 	private->iob.flags = 2;	/* do asynchronous io */
 	private->iob.block_count = dreq->block_count;
-	private->iob.interrupt_params = (u32) cqr;
+	private->iob.interrupt_params = (u32)(addr_t) cqr;
 	private->iob.bio_list = __pa(dreq->bio);
 
 	cqr->startclk = get_clock();
@@ -196,21 +197,21 @@
 	ip = S390_lowcore.ext_params;
 
 	cpu = smp_processor_id();
-	irq_enter(cpu, -1);
+	irq_enter();
 
 	if (!ip) {		/* no intparm: unsolicited interrupt */
 		MESSAGE(KERN_DEBUG, "%s", "caught unsolicited interrupt");
-		irq_exit(cpu, -1);
+		irq_exit();
 		return;
 	}
-	cqr = (dasd_ccw_req_t *) ip;
+	cqr = (dasd_ccw_req_t *)(addr_t) ip;
 	device = (dasd_device_t *) cqr->device;
 	if (strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) {
 		DEV_MESSAGE(KERN_WARNING, device,
 			    " magic number of dasd_ccw_req_t 0x%08X doesn't"
 			    " match discipline 0x%08X",
 			    cqr->magic, *(int *) (&device->discipline->name));
-		irq_exit(cpu, -1);
+		irq_exit();
 		return;
 	}
 
@@ -244,8 +245,7 @@
 	dasd_schedule_bh(device);
 
 	spin_unlock_irqrestore(get_irq_lock(device->devinfo.irq), flags);
-	irq_exit(cpu, -1);
-
+	irq_exit();
 }
 
 static int
drivers/s390/block/dasd_eckd.c +18 -18
diff -urN linux-2.5.38/drivers/s390/block/dasd_eckd.c linux-2.5.38-s390/drivers/s390/block/dasd_eckd.c
@@ -29,6 +29,7 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/hdreg.h>	/* HDIO_GETGEO			    */
+#include <linux/bio.h>
 
 #include <asm/debug.h>
 #include <asm/idals.h>
@@ -69,7 +70,6 @@
 	attrib_data_t attrib;	/* e.g. cache operations */
 } dasd_eckd_private_t;
 
-#ifdef CONFIG_DASD_DYNAMIC
 static
 devreg_t dasd_eckd_known_devices[] = {
 	{
@@ -94,7 +94,6 @@
 		oper_func:dasd_oper_handler
 	}
 };
-#endif
 
 static const int sizes_trk0[] = { 28, 148, 84 };
 #define LABEL_SIZE 140
@@ -1092,7 +1091,8 @@
  * Buils a channel programm to releases a prior reserved 
  * (see dasd_eckd_reserve) device.
  */
-static int dasd_eckd_release(void *inp, int no, long args)
+static int
+dasd_eckd_release(struct block_device *bdev, int no, long args)
 {
 	dasd_devmap_t *devmap;
 	dasd_device_t *device;
@@ -1101,7 +1101,7 @@
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
-	devmap = dasd_devmap_from_kdev(((struct inode *) inp)->i_rdev);
+	devmap = dasd_devmap_from_bdev(bdev);
 	device = (devmap != NULL) ?
 		dasd_get_device(devmap) : ERR_PTR(-ENODEV);
 	if (IS_ERR(device))
@@ -1134,7 +1134,8 @@
  * 'timeout the request'. This leads to an terminate IO if 
  * the interrupt is outstanding for a certain time. 
  */
-static int dasd_eckd_reserve(void *inp, int no, long args)
+static int
+dasd_eckd_reserve(struct block_device *bdev, int no, long args)
 {
 	dasd_devmap_t *devmap;
 	dasd_device_t *device;
@@ -1143,7 +1144,7 @@
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
-	devmap = dasd_devmap_from_kdev(((struct inode *) inp)->i_rdev);
+	devmap = dasd_devmap_from_bdev(bdev);
 	device = (devmap != NULL) ?
 		dasd_get_device(devmap) : ERR_PTR(-ENODEV);
 	if (IS_ERR(device))
@@ -1168,7 +1169,7 @@
 
 	if (rc == -EIO) {
 		/* Request got an eror or has been timed out. */
-		dasd_eckd_release(inp, no, args);
+		dasd_eckd_release(bdev, no, args);
 	}
 	dasd_kfree_request(cqr, cqr->device);
 	dasd_put_device(devmap);
@@ -1180,7 +1181,8 @@
  * Buils a channel programm to break a device's reservation. 
  * (unconditional reserve)
  */
-static int dasd_eckd_steal_lock(void *inp, int no, long args)
+static int
+dasd_eckd_steal_lock(struct block_device *bdev, int no, long args)
 {
 	dasd_devmap_t *devmap;
 	dasd_device_t *device;
@@ -1189,7 +1191,7 @@
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
-	devmap = dasd_devmap_from_kdev(((struct inode *) inp)->i_rdev);
+	devmap = dasd_devmap_from_bdev(bdev);
 	device = (devmap != NULL) ?
 		dasd_get_device(devmap) : ERR_PTR(-ENODEV);
 	if (IS_ERR(device))
@@ -1213,7 +1215,7 @@
 
 	if (rc == -EIO) {
 		/* Request got an eror or has been timed out. */
-		dasd_eckd_release(inp, no, args);
+		dasd_eckd_release(bdev, no, args);
 	}
 	dasd_kfree_request(cqr, cqr->device);
 	dasd_put_device(devmap);
@@ -1223,7 +1225,8 @@
 /*
  * Read performance statistics
  */
-static int dasd_eckd_performance(void *inp, int no, long args)
+static int
+dasd_eckd_performance(struct block_device *bdev, int no, long args)
 {
 	dasd_devmap_t *devmap;
 	dasd_device_t *device;
@@ -1233,7 +1236,7 @@
 	ccw1_t *ccw;
 	int rc;
 
-	devmap = dasd_devmap_from_kdev(((struct inode *) inp)->i_rdev);
+	devmap = dasd_devmap_from_bdev(bdev);
 	device = (devmap != NULL) ?
 		dasd_get_device(devmap) : ERR_PTR(-ENODEV);
 	if (IS_ERR(device))
@@ -1292,7 +1295,8 @@
  * Set attributes (cache operations)
  * Stores the attributes for cache operation to be used in Define Extend (DE).
  */
-static int dasd_eckd_set_attrib(void *inp, int no, long args)
+static int
+dasd_eckd_set_attrib(struct block_device *bdev, int no, long args)
 {
 	dasd_devmap_t *devmap;
 	dasd_device_t *device;
@@ -1304,7 +1308,7 @@
 	if (!args)
 		return -EINVAL;
 
-	devmap = dasd_devmap_from_kdev(((struct inode *) inp)->i_rdev);
+	devmap = dasd_devmap_from_bdev(bdev);
 	device = (devmap != NULL) ?
 		dasd_get_device(devmap) : ERR_PTR(-ENODEV);
 	if (IS_ERR(device))
@@ -1452,10 +1456,8 @@
 	ASCEBC(dasd_eckd_discipline.ebcname, 4);
 	dasd_discipline_add(&dasd_eckd_discipline);
 
-#ifdef CONFIG_DASD_DYNAMIC
 	for (i = 0; i < sizeof(dasd_eckd_known_devices)/sizeof(devreg_t); i++)
 			s390_device_register(&dasd_eckd_known_devices[i]);
-#endif
 	return 0;
 }
 
@@ -1464,10 +1466,8 @@
 {
 	int i;
 
-#ifdef CONFIG_DASD_DYNAMIC
 	for (i = 0; i < sizeof(dasd_eckd_known_devices)/sizeof(devreg_t); i++)
 		s390_device_unregister(&dasd_eckd_known_devices[i]);
-#endif				/* CONFIG_DASD_DYNAMIC */
 
 	dasd_discipline_del(&dasd_eckd_discipline);
 
drivers/s390/block/dasd_fba.c +1 -6
diff -urN linux-2.5.38/drivers/s390/block/dasd_fba.c linux-2.5.38-s390/drivers/s390/block/dasd_fba.c
@@ -16,6 +16,7 @@
 
 #include <linux/slab.h>
 #include <linux/hdreg.h>	/* HDIO_GETGEO			    */
+#include <linux/bio.h>
 
 #include <asm/idals.h>
 #include <asm/ebcdic.h>
@@ -43,7 +44,6 @@
 	dasd_fba_characteristics_t rdc_data;
 } dasd_fba_private_t;
 
-#ifdef CONFIG_DASD_DYNAMIC
 static
 devreg_t dasd_fba_known_devices[] = {
 	{
@@ -59,7 +59,6 @@
 		oper_func:dasd_oper_handler
 	}
 };
-#endif
 
 static inline void
 define_extent(ccw1_t * ccw, DE_fba_data_t *data, int rw,
@@ -417,10 +416,8 @@
 
 	ASCEBC(dasd_fba_discipline.ebcname, 4);
 	dasd_discipline_add(&dasd_fba_discipline);
-#ifdef CONFIG_DASD_DYNAMIC
 	for (i = 0; i < sizeof(dasd_fba_known_devices) / sizeof(devreg_t); i++)
 		s390_device_register(&dasd_fba_known_devices[i]);
-#endif
 	return 0;
 }
 
@@ -429,10 +426,8 @@
 {
 	int i;
 
-#ifdef CONFIG_DASD_DYNAMIC
 	for (i = 0; i < sizeof(dasd_fba_known_devices) / sizeof(devreg_t); i++)
 		s390_device_unregister(&dasd_fba_known_devices[i]);
-#endif
 	dasd_discipline_del(&dasd_fba_discipline);
 }
 
drivers/s390/block/dasd_genhd.c +132 -95

349 lines not on this page · raw message

drivers/s390/block/dasd_int.h +11 -11
diff -urN linux-2.5.38/drivers/s390/block/dasd_int.h linux-2.5.38-s390/drivers/s390/block/dasd_int.h
@@ -64,12 +64,12 @@
 #include <asm/irq.h>
 #include <asm/s390dyn.h>
 
-#define CONFIG_DASD_DYNAMIC
-
 /*
  * SECTION: Type definitions
  */
-typedef int (*dasd_ioctl_fn_t) (void *inp, int no, long args);
+struct dasd_device_t;
+
+typedef int (*dasd_ioctl_fn_t) (struct block_device *bdev, int no, long args);
 
 typedef struct {
 	struct list_head list;
@@ -139,9 +139,8 @@
 /* messages to be written via klogd and dbf */
 #define DEV_MESSAGE(d_loglevel,d_device,d_string,d_args...)\
 do { \
-	printk(d_loglevel PRINTK_HEADER " /dev/%-7s(%3d:%3d),%04x@%02x: " \
-	       d_string "\n", d_device->name, \
-	       major(d_device->kdev), minor(d_device->kdev), \
+	printk(d_loglevel PRINTK_HEADER " %s,%04x@%02x: " \
+	       d_string "\n", bdevname(d_device->bdev), \
 	       d_device->devinfo.devno, d_device->devinfo.irq, \
 	       d_args); \
 	DBF_DEV_EVENT(DBF_ALERT, d_device, d_string, d_args); \
@@ -153,8 +152,6 @@
 	DBF_EVENT(DBF_ALERT, d_string, d_args); \
 } while(0)
 
-struct dasd_device_t;
-
 typedef struct dasd_ccw_req_t {
 	unsigned int magic;		/* Eye catcher */
         struct list_head list;		/* list_head for request queueing. */
@@ -262,7 +259,8 @@
 typedef struct dasd_device_t {
 	/* Block device stuff. */
 	char name[16];			/* The device name in /dev. */
-	kdev_t kdev;
+	struct block_device *bdev;
+	struct gendisk *gdp;
 	devfs_handle_t devfs_entry;
 	request_queue_t *request_queue;
 	spinlock_t request_queue_lock;
@@ -467,6 +465,7 @@
 dasd_devmap_t *dasd_devmap_from_devindex(int);
 dasd_devmap_t *dasd_devmap_from_irq(int);
 dasd_devmap_t *dasd_devmap_from_kdev(kdev_t);
+dasd_devmap_t *dasd_devmap_from_bdev(struct block_device *bdev);
 dasd_device_t *dasd_get_device(dasd_devmap_t *);
 void dasd_put_device(dasd_devmap_t *);
 
@@ -478,9 +477,10 @@
 /* externals in dasd_gendisk.c */
 int  dasd_gendisk_init(void);
 void dasd_gendisk_exit(void);
-int  dasd_gendisk_new_major(void);
 int  dasd_gendisk_major_index(int);
-struct gendisk *dasd_gendisk_from_devindex(int);
+int  dasd_gendisk_index_major(int);
+struct gendisk *dasd_gendisk_alloc(char *, int);
+void dasd_gendisk_free(struct gendisk *);
 void dasd_setup_partitions(dasd_device_t *);
 void dasd_destroy_partitions(dasd_device_t *);
 
drivers/s390/block/dasd_ioctl.c +72 -52

323 lines not on this page · raw message

drivers/s390/block/dasd_proc.c +7 -8
diff -urN linux-2.5.38/drivers/s390/block/dasd_proc.c linux-2.5.38-s390/drivers/s390/block/dasd_proc.c
@@ -15,6 +15,7 @@
 #include <linux/config.h>
 #include <linux/version.h>
 #include <linux/ctype.h>
+#include <linux/vmalloc.h>
 
 #include <asm/debug.h>
 #include <asm/irq.h>
@@ -123,7 +124,7 @@
 	}
 	features = dasd_feature_list(str, &str);
 	/* Negative numbers in from/to/features indicate errors */
-	if (from < 0 || to < 0 || features < 0)
+	if (from < 0 || to < 0 || from > 65546 || to > 65536 || features < 0)
 		goto out_error;
 
 	if (add_or_set == 0) {
@@ -152,10 +153,8 @@
 dasd_devices_print(dasd_devmap_t *devmap, char *str)
 {
 	dasd_device_t *device;
-	struct gendisk *gdp;
-	char buffer[7];
 	char *substr;
-	int minor;
+	int major, minor;
 	int len;
 
 	device = dasd_get_device(devmap);
@@ -169,11 +168,11 @@
 	else
 		len += sprintf(str + len, "(none)");
 	/* Print kdev. */
-	gdp = dasd_gendisk_from_devindex(devmap->devindex);
-	minor = devmap->devindex % DASD_PER_MAJOR;
-	len += sprintf(str + len, " at (%3d:%3d)", gdp->major, minor);
+	major = MAJOR(device->bdev->bd_dev);
+	minor = MINOR(device->bdev->bd_dev);
+	len += sprintf(str + len, " at (%3d:%3d)", major, minor);
 	/* Print device name. */
-	len += sprintf(str + len, " is %-7s", gdp->major_name);
+	len += sprintf(str + len, " is %-7s", device->name);
 	/* Print devices features. */
 	substr = (devmap->features & DASD_FEATURE_READONLY) ? "(ro)" : " ";
 	len += sprintf(str + len, "%4s: ", substr);
include/asm-s390/dasd.h +3 -1
diff -urN linux-2.5.38/include/asm-s390/dasd.h linux-2.5.38-s390/include/asm-s390/dasd.h
@@ -13,6 +13,8 @@
  * 12/06/01 DASD_API_VERSION 2 - binary compatible to 0 (new BIODASDINFO2)
  * 01/23/02 DASD_API_VERSION 3 - added BIODASDPSRD (and BIODASDENAPAV) IOCTL
  * 02/15/02 DASD_API_VERSION 4 - added BIODASDSATTR IOCTL
+ * ##/##/## DASD_API_VERSION 5 - added boxed dasd support TOBEDONE
+ * 21/06/02 DASD_API_VERSION 6 - fixed HDIO_GETGEO: geo.start is in sectors!
  *         
  */
 
@@ -22,7 +24,7 @@
 
 #define DASD_IOCTL_LETTER 'D'
 
-#define DASD_API_VERSION 4
+#define DASD_API_VERSION 6
 
 /* 
  * struct dasd_information2_t
include/asm-s390x/dasd.h +3 -1
diff -urN linux-2.5.38/include/asm-s390x/dasd.h linux-2.5.38-s390/include/asm-s390x/dasd.h
@@ -13,6 +13,8 @@
  * 12/06/01 DASD_API_VERSION 2 - binary compatible to 0 (new BIODASDINFO2)
  * 01/23/02 DASD_API_VERSION 3 - added BIODASDPSRD (and BIODASDENAPAV) IOCTL
  * 02/15/02 DASD_API_VERSION 4 - added BIODASDSATTR IOCTL
+ * ##/##/## DASD_API_VERSION 5 - added boxed dasd support TOBEDONE
+ * 21/06/02 DASD_API_VERSION 6 - fixed HDIO_GETGEO: geo.start is in sectors!
  *         
  */
 
@@ -22,7 +24,7 @@
 
 #define DASD_IOCTL_LETTER 'D'
 
-#define DASD_API_VERSION 4
+#define DASD_API_VERSION 6
 
 /* 
  * struct dasd_information2_t