1 // SPDX-License-Identifier: GPL-2.0
3 * fs/partitions/ultrix.c
5 * Code extracted from drivers/block/genhd.c
7 * Re-organised Jul 1999 Russell King
13 int ultrix_partition(struct parsed_partitions
*state
)
18 struct ultrix_disklabel
{
19 s32 pt_magic
; /* magic no. indicating part. info exits */
20 s32 pt_valid
; /* set by driver if pt is current */
22 s32 pi_nblocks
; /* no. of sectors */
23 u32 pi_blkoff
; /* block offset for start */
27 #define PT_MAGIC 0x032957 /* Partition magic number */
28 #define PT_VALID 1 /* Indicates if struct is valid */
30 data
= read_part_sector(state
, (16384 - sizeof(*label
))/512, §
);
34 label
= (struct ultrix_disklabel
*)(data
+ 512 - sizeof(*label
));
36 if (label
->pt_magic
== PT_MAGIC
&& label
->pt_valid
== PT_VALID
) {
38 if (label
->pt_part
[i
].pi_nblocks
)
39 put_partition(state
, i
+1,
40 label
->pt_part
[i
].pi_blkoff
,
41 label
->pt_part
[i
].pi_nblocks
);
43 strlcat(state
->pp_buf
, "\n", PAGE_SIZE
);