4 * Code extracted from drivers/block/genhd.c
6 * Copyright (C) 1991-1998 Linus Torvalds
7 * Re-organised Feb 1998 Russell King
13 int osf_partition(struct parsed_partitions
*state
, struct block_device
*bdev
)
21 __le16 d_type
,d_subtype
;
30 __le16 d_sparespertrack
;
31 __le16 d_sparespercyl
;
33 __le16 d_rpm
, d_interleave
, d_trackskew
, d_cylskew
;
34 __le32 d_headswitch
, d_trkseek
, d_flags
;
35 __le32 d_drivedata
[5];
40 __le32 d_bbsize
, d_sbsize
;
50 struct d_partition
* partition
;
52 data
= read_dev_sector(bdev
, 0, §
);
56 label
= (struct disklabel
*) (data
+64);
57 partition
= label
->d_partitions
;
58 if (le32_to_cpu(label
->d_magic
) != DISKLABELMAGIC
) {
62 if (le32_to_cpu(label
->d_magic2
) != DISKLABELMAGIC
) {
66 for (i
= 0 ; i
< le16_to_cpu(label
->d_npartitions
); i
++, partition
++) {
67 if (slot
== state
->limit
)
69 if (le32_to_cpu(partition
->p_size
))
70 put_partition(state
, slot
,
71 le32_to_cpu(partition
->p_offset
),
72 le32_to_cpu(partition
->p_size
));