diff options
Diffstat (limited to 'fs/partitions')
-rw-r--r-- | fs/partitions/ibm.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/fs/partitions/ibm.c b/fs/partitions/ibm.c index 1e4a93835fed..830c55d86ab1 100644 --- a/fs/partitions/ibm.c +++ b/fs/partitions/ibm.c | |||
@@ -1,15 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * File...........: linux/fs/partitions/ibm.c | 2 | * File...........: linux/fs/partitions/ibm.c |
3 | * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com> | 3 | * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com> |
4 | * Volker Sameske <sameske@de.ibm.com> | 4 | * Volker Sameske <sameske@de.ibm.com> |
5 | * Bugreports.to..: <Linux390@de.ibm.com> | 5 | * Bugreports.to..: <Linux390@de.ibm.com> |
6 | * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 | 6 | * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 |
7 | |||
8 | * History of changes (starts July 2000) | ||
9 | * 07/10/00 Fixed detection of CMS formatted disks | ||
10 | * 02/13/00 VTOC partition support added | ||
11 | * 12/27/01 fixed PL030593 (CMS reserved minidisk not detected on 64 bit) | ||
12 | * 07/24/03 no longer using contents of freed page for CMS label recognition (BZ3611) | ||
13 | */ | 7 | */ |
14 | 8 | ||
15 | #include <linux/config.h> | 9 | #include <linux/config.h> |
@@ -25,7 +19,7 @@ | |||
25 | #include "ibm.h" | 19 | #include "ibm.h" |
26 | 20 | ||
27 | /* | 21 | /* |
28 | * compute the block number from a | 22 | * compute the block number from a |
29 | * cyl-cyl-head-head structure | 23 | * cyl-cyl-head-head structure |
30 | */ | 24 | */ |
31 | static inline int | 25 | static inline int |
@@ -34,9 +28,8 @@ cchh2blk (struct vtoc_cchh *ptr, struct hd_geometry *geo) { | |||
34 | ptr->hh * geo->sectors; | 28 | ptr->hh * geo->sectors; |
35 | } | 29 | } |
36 | 30 | ||
37 | |||
38 | /* | 31 | /* |
39 | * compute the block number from a | 32 | * compute the block number from a |
40 | * cyl-cyl-head-head-block structure | 33 | * cyl-cyl-head-head-block structure |
41 | */ | 34 | */ |
42 | static inline int | 35 | static inline int |
@@ -48,7 +41,7 @@ cchhb2blk (struct vtoc_cchhb *ptr, struct hd_geometry *geo) { | |||
48 | 41 | ||
49 | /* | 42 | /* |
50 | */ | 43 | */ |
51 | int | 44 | int |
52 | ibm_partition(struct parsed_partitions *state, struct block_device *bdev) | 45 | ibm_partition(struct parsed_partitions *state, struct block_device *bdev) |
53 | { | 46 | { |
54 | int blocksize, offset, size; | 47 | int blocksize, offset, size; |
@@ -77,7 +70,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
77 | goto out_nogeo; | 70 | goto out_nogeo; |
78 | if ((label = kmalloc(sizeof(union label_t), GFP_KERNEL)) == NULL) | 71 | if ((label = kmalloc(sizeof(union label_t), GFP_KERNEL)) == NULL) |
79 | goto out_nolab; | 72 | goto out_nolab; |
80 | 73 | ||
81 | if (ioctl_by_bdev(bdev, BIODASDINFO, (unsigned long)info) != 0 || | 74 | if (ioctl_by_bdev(bdev, BIODASDINFO, (unsigned long)info) != 0 || |
82 | ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0) | 75 | ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0) |
83 | goto out_noioctl; | 76 | goto out_noioctl; |
@@ -154,13 +147,13 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
154 | 147 | ||
155 | /* OK, we got valid partition data */ | 148 | /* OK, we got valid partition data */ |
156 | offset = cchh2blk(&f1.DS1EXT1.llimit, geo); | 149 | offset = cchh2blk(&f1.DS1EXT1.llimit, geo); |
157 | size = cchh2blk(&f1.DS1EXT1.ulimit, geo) - | 150 | size = cchh2blk(&f1.DS1EXT1.ulimit, geo) - |
158 | offset + geo->sectors; | 151 | offset + geo->sectors; |
159 | if (counter >= state->limit) | 152 | if (counter >= state->limit) |
160 | break; | 153 | break; |
161 | put_partition(state, counter + 1, | 154 | put_partition(state, counter + 1, |
162 | offset * (blocksize >> 9), | 155 | offset * (blocksize >> 9), |
163 | size * (blocksize >> 9)); | 156 | size * (blocksize >> 9)); |
164 | counter++; | 157 | counter++; |
165 | blk++; | 158 | blk++; |
166 | } | 159 | } |
@@ -175,7 +168,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
175 | offset = (info->label_block + 1); | 168 | offset = (info->label_block + 1); |
176 | size = i_size >> 9; | 169 | size = i_size >> 9; |
177 | put_partition(state, 1, offset*(blocksize >> 9), | 170 | put_partition(state, 1, offset*(blocksize >> 9), |
178 | size-offset*(blocksize >> 9)); | 171 | size-offset*(blocksize >> 9)); |
179 | } | 172 | } |
180 | 173 | ||
181 | printk("\n"); | 174 | printk("\n"); |
@@ -183,7 +176,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
183 | kfree(geo); | 176 | kfree(geo); |
184 | kfree(info); | 177 | kfree(info); |
185 | return 1; | 178 | return 1; |
186 | 179 | ||
187 | out_readerr: | 180 | out_readerr: |
188 | out_noioctl: | 181 | out_noioctl: |
189 | kfree(label); | 182 | kfree(label); |