aboutsummaryrefslogtreecommitdiffstats
path: root/fs/partitions
diff options
context:
space:
mode:
Diffstat (limited to 'fs/partitions')
-rw-r--r--fs/partitions/ibm.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/partitions/ibm.c b/fs/partitions/ibm.c
index 6327bcb2d73d..78010ad60e47 100644
--- a/fs/partitions/ibm.c
+++ b/fs/partitions/ibm.c
@@ -56,7 +56,10 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
56 struct hd_geometry *geo; 56 struct hd_geometry *geo;
57 char type[5] = {0,}; 57 char type[5] = {0,};
58 char name[7] = {0,}; 58 char name[7] = {0,};
59 struct vtoc_volume_label *vlabel; 59 union label_t {
60 struct vtoc_volume_label vol;
61 struct vtoc_cms_label cms;
62 } *label;
60 unsigned char *data; 63 unsigned char *data;
61 Sector sect; 64 Sector sect;
62 65
@@ -64,9 +67,8 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
64 goto out_noinfo; 67 goto out_noinfo;
65 if ((geo = kmalloc(sizeof(struct hd_geometry), GFP_KERNEL)) == NULL) 68 if ((geo = kmalloc(sizeof(struct hd_geometry), GFP_KERNEL)) == NULL)
66 goto out_nogeo; 69 goto out_nogeo;
67 if ((vlabel = kmalloc(sizeof(struct vtoc_volume_label), 70 if ((label = kmalloc(sizeof(union label_t), GFP_KERNEL)) == NULL)
68 GFP_KERNEL)) == NULL) 71 goto out_nolab;
69 goto out_novlab;
70 72
71 if (ioctl_by_bdev(bdev, BIODASDINFO, (unsigned long)info) != 0 || 73 if (ioctl_by_bdev(bdev, BIODASDINFO, (unsigned long)info) != 0 ||
72 ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0) 74 ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0)
@@ -87,7 +89,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
87 strncpy(name, data + 8, 6); 89 strncpy(name, data + 8, 6);
88 else 90 else
89 strncpy(name, data + 4, 6); 91 strncpy(name, data + 4, 6);
90 memcpy (vlabel, data, sizeof(struct vtoc_volume_label)); 92 memcpy(label, data, sizeof(union label_t));
91 put_dev_sector(sect); 93 put_dev_sector(sect);
92 94
93 EBCASC(type, 4); 95 EBCASC(type, 4);
@@ -100,14 +102,12 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
100 /* 102 /*
101 * VM style CMS1 labeled disk 103 * VM style CMS1 labeled disk
102 */ 104 */
103 int *label = (int *) vlabel; 105 if (label->cms.disk_offset != 0) {
104
105 if (label[13] != 0) {
106 printk("CMS1/%8s(MDSK):", name); 106 printk("CMS1/%8s(MDSK):", name);
107 /* disk is reserved minidisk */ 107 /* disk is reserved minidisk */
108 blocksize = label[3]; 108 blocksize = label->cms.block_size;
109 offset = label[13]; 109 offset = label->cms.disk_offset;
110 size = (label[7] - 1)*(blocksize >> 9); 110 size = (label->cms.block_count - 1) * (blocksize >> 9);
111 } else { 111 } else {
112 printk("CMS1/%8s:", name); 112 printk("CMS1/%8s:", name);
113 offset = (info->label_block + 1); 113 offset = (info->label_block + 1);
@@ -126,7 +126,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
126 printk("VOL1/%8s:", name); 126 printk("VOL1/%8s:", name);
127 127
128 /* get block number and read then go through format1 labels */ 128 /* get block number and read then go through format1 labels */
129 blk = cchhb2blk(&vlabel->vtoc, geo) + 1; 129 blk = cchhb2blk(&label->vol.vtoc, geo) + 1;
130 counter = 0; 130 counter = 0;
131 while ((data = read_dev_sector(bdev, blk*(blocksize/512), 131 while ((data = read_dev_sector(bdev, blk*(blocksize/512),
132 &sect)) != NULL) { 132 &sect)) != NULL) {
@@ -174,7 +174,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
174 } 174 }
175 175
176 printk("\n"); 176 printk("\n");
177 kfree(vlabel); 177 kfree(label);
178 kfree(geo); 178 kfree(geo);
179 kfree(info); 179 kfree(info);
180 return 1; 180 return 1;
@@ -182,8 +182,8 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
182out_readerr: 182out_readerr:
183out_badsect: 183out_badsect:
184out_noioctl: 184out_noioctl:
185 kfree(vlabel); 185 kfree(label);
186out_novlab: 186out_nolab:
187 kfree(geo); 187 kfree(geo);
188out_nogeo: 188out_nogeo:
189 kfree(info); 189 kfree(info);