4 * Code extracted from drivers/block/genhd.c
6 * Copyright (C) 1991-1998 Linus Torvalds
7 * Re-organised Feb 1998 Russell King
11 #include <linux/genhd.h>
12 #include <linux/kernel.h>
13 #include <linux/major.h>
14 #include <linux/string.h>
15 #include <linux/blk.h>
20 int osf_partition(struct gendisk
*hd
, kdev_t dev
, unsigned long first_sector
,
24 int mask
= (1 << hd
->minor_shift
) - 1;
25 struct buffer_head
*bh
;
40 u16 d_rpm
, d_interleave
, d_trackskew
, d_cylskew
;
41 u32 d_headswitch
, d_trkseek
, d_flags
;
47 u32 d_bbsize
, d_sbsize
;
57 struct d_partition
* partition
;
59 if (!(bh
= bread(dev
,0,get_ptable_blocksize(dev
)))) {
60 printk("unable to read partition table\n");
63 label
= (struct disklabel
*) (bh
->b_data
+64);
64 partition
= label
->d_partitions
;
65 if (label
->d_magic
!= DISKLABELMAGIC
) {
69 if (label
->d_magic2
!= DISKLABELMAGIC
) {
73 for (i
= 0 ; i
< label
->d_npartitions
; i
++, partition
++) {
74 if ((current_minor
& mask
) == 0)
76 if (partition
->p_size
)
77 add_gd_partition(hd
, current_minor
,
78 first_sector
+partition
->p_offset
,