4 * Code extracted from drivers/block/genhd.c
6 * Copyright (C) 1991-1998 Linus Torvalds
7 * Re-organised Feb 1998 Russell King
13 #define MAX_OSF_PARTITIONS 18
15 int osf_partition(struct parsed_partitions
*state
)
19 unsigned int npartitions
;
24 __le16 d_type
,d_subtype
;
33 __le16 d_sparespertrack
;
34 __le16 d_sparespercyl
;
36 __le16 d_rpm
, d_interleave
, d_trackskew
, d_cylskew
;
37 __le32 d_headswitch
, d_trkseek
, d_flags
;
38 __le32 d_drivedata
[5];
43 __le32 d_bbsize
, d_sbsize
;
51 } d_partitions
[MAX_OSF_PARTITIONS
];
53 struct d_partition
* partition
;
55 data
= read_part_sector(state
, 0, §
);
59 label
= (struct disklabel
*) (data
+64);
60 partition
= label
->d_partitions
;
61 if (le32_to_cpu(label
->d_magic
) != DISKLABELMAGIC
) {
65 if (le32_to_cpu(label
->d_magic2
) != DISKLABELMAGIC
) {
69 npartitions
= le16_to_cpu(label
->d_npartitions
);
70 if (npartitions
> MAX_OSF_PARTITIONS
) {
74 for (i
= 0 ; i
< npartitions
; i
++, partition
++) {
75 if (slot
== state
->limit
)
77 if (le32_to_cpu(partition
->p_size
))
78 put_partition(state
, slot
,
79 le32_to_cpu(partition
->p_offset
),
80 le32_to_cpu(partition
->p_size
));
83 strlcat(state
->pp_buf
, "\n", PAGE_SIZE
);