10 #include <linux/slab.h>
13 #include <asm/uaccess.h>
36 cyl = ptr->
hh & 0xFFF0;
39 head = ptr->
hh & 0x000F;
54 cyl = ptr->
hh & 0xFFF0;
57 head = ptr->
hh & 0x000F;
75 unsigned char temp[5];
96 testsect[1] = (blocksize >> 9);
97 testsect[2] = 2 * (blocksize >> 9);
100 for (i = 0; i < testcount; ++
i) {
101 data = read_part_sector(state, testsect[i], §);
104 memcpy(label, data,
sizeof(*label));
108 put_dev_sector(sect);
109 if (!
strcmp(temp,
"VOL1") ||
112 if (!
strcmp(temp,
"VOL1")) {
121 *labelsect = testsect[
i];
127 memset(label, 0,
sizeof(*label));
147 snprintf(tmp,
sizeof(tmp),
"VOL1/%8s:", name);
153 secperblk = blocksize >> 9;
154 blk = cchhb2blk(&label->
vol.vtoc, geo) + 1;
156 data = read_part_sector(state, blk * secperblk, §);
157 while (data !=
NULL) {
159 put_dev_sector(sect);
166 data = read_part_sector(state, blk * secperblk, §);
174 offset = cchh2blk(&
f1.DS1EXT1.llimit, geo);
175 size = cchh2blk(&
f1.DS1EXT1.ulimit, geo) -
179 if (counter >= state->
limit)
181 put_partition(state, counter + 1, offset, size);
184 data = read_part_sector(state, blk * secperblk, §);
207 snprintf(tmp,
sizeof(tmp),
"LNX1/%8s:", name);
209 secperblk = blocksize >> 9;
210 if (label->
lnx.ldl_version == 0xf2) {
211 size = label->
lnx.formatted_blocks * secperblk;
223 if (size != geo_size) {
235 offset = labelsect + secperblk;
236 put_partition(state, 1, offset, size - offset);
255 blocksize = label->
cms.block_size;
256 secperblk = blocksize >> 9;
257 if (label->
cms.disk_offset != 0) {
258 snprintf(tmp,
sizeof(tmp),
"CMS1/%8s(MDSK):", name);
261 offset = label->
cms.disk_offset * secperblk;
262 size = (label->
cms.block_count - 1) * secperblk;
264 snprintf(tmp,
sizeof(tmp),
"CMS1/%8s:", name);
274 offset = 2 * secperblk;
276 offset = labelsect + secperblk;
277 size = label->
cms.block_count * secperblk;
280 put_partition(state, 1, offset, size-offset);
302 blocksize = bdev_logical_block_size(bdev);
305 i_size = i_size_read(bdev->
bd_inode);
324 if (find_label(state, info, geo, blocksize, &labelsect, name, type,
326 if (!
strncmp(type,
"VOL1", 4)) {
327 res = find_vol1_partitions(state, geo, blocksize, name,
329 }
else if (!
strncmp(type,
"LNX1", 4)) {
330 res = find_lnx1_partitions(state, geo, blocksize, name,
331 label, labelsect, i_size,
333 }
else if (!
strncmp(type,
"CMS1", 4)) {
334 res = find_cms1_partitions(state, geo, blocksize, name,
349 offset = (info->label_block + 1) * (blocksize >> 9);
350 put_partition(state, 1, offset, size-offset);