linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / fs / partitions / ibm.c
index d352a73..1e4a938 100644 (file)
@@ -1,11 +1,18 @@
 /*
- * File...........: linux/fs/partitions/ibm.c
+ * File...........: linux/fs/partitions/ibm.c      
  * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com>
  *                  Volker Sameske <sameske@de.ibm.com>
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
+
+ * History of changes (starts July 2000)
+ * 07/10/00 Fixed detection of CMS formatted disks     
+ * 02/13/00 VTOC partition support added
+ * 12/27/01 fixed PL030593 (CMS reserved minidisk not detected on 64 bit)
+ * 07/24/03 no longer using contents of freed page for CMS label recognition (BZ3611)
  */
 
+#include <linux/config.h>
 #include <linux/buffer_head.h>
 #include <linux/hdreg.h>
 #include <linux/slab.h>
@@ -18,7 +25,7 @@
 #include "ibm.h"
 
 /*
- * compute the block number from a
+ * compute the block number from a 
  * cyl-cyl-head-head structure
  */
 static inline int
@@ -27,8 +34,9 @@ cchh2blk (struct vtoc_cchh *ptr, struct hd_geometry *geo) {
               ptr->hh * geo->sectors;
 }
 
+
 /*
- * compute the block number from a
+ * compute the block number from a 
  * cyl-cyl-head-head-block structure
  */
 static inline int
@@ -40,7 +48,7 @@ cchhb2blk (struct vtoc_cchhb *ptr, struct hd_geometry *geo) {
 
 /*
  */
-int
+int 
 ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
 {
        int blocksize, offset, size;
@@ -69,7 +77,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
                goto out_nogeo;
        if ((label = kmalloc(sizeof(union label_t), GFP_KERNEL)) == NULL)
                goto out_nolab;
-
+       
        if (ioctl_by_bdev(bdev, BIODASDINFO, (unsigned long)info) != 0 ||
            ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0)
                goto out_noioctl;
@@ -146,13 +154,13 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
 
                        /* OK, we got valid partition data */
                        offset = cchh2blk(&f1.DS1EXT1.llimit, geo);
-                       size  = cchh2blk(&f1.DS1EXT1.ulimit, geo) -
+                       size  = cchh2blk(&f1.DS1EXT1.ulimit, geo) - 
                                offset + geo->sectors;
                        if (counter >= state->limit)
                                break;
-                       put_partition(state, counter + 1,
-                                     offset * (blocksize >> 9),
-                                     size * (blocksize >> 9));
+                       put_partition(state, counter + 1, 
+                                        offset * (blocksize >> 9),
+                                        size * (blocksize >> 9));
                        counter++;
                        blk++;
                }
@@ -167,7 +175,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
                offset = (info->label_block + 1);
                size = i_size >> 9;
                put_partition(state, 1, offset*(blocksize >> 9),
-                             size-offset*(blocksize >> 9));
+                                size-offset*(blocksize >> 9));
        }
 
        printk("\n");
@@ -175,7 +183,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
        kfree(geo);
        kfree(info);
        return 1;
-
+       
 out_readerr:
 out_noioctl:
        kfree(label);