Root/
1 | /* |
2 | * fs/partitions/ultrix.c |
3 | * |
4 | * Code extracted from drivers/block/genhd.c |
5 | * |
6 | * Re-organised Jul 1999 Russell King |
7 | */ |
8 | |
9 | #include "check.h" |
10 | #include "ultrix.h" |
11 | |
12 | int ultrix_partition(struct parsed_partitions *state, struct block_device *bdev) |
13 | { |
14 | int i; |
15 | Sector sect; |
16 | unsigned char *data; |
17 | struct ultrix_disklabel { |
18 | s32 pt_magic; /* magic no. indicating part. info exits */ |
19 | s32 pt_valid; /* set by driver if pt is current */ |
20 | struct pt_info { |
21 | s32 pi_nblocks; /* no. of sectors */ |
22 | u32 pi_blkoff; /* block offset for start */ |
23 | } pt_part[8]; |
24 | } *label; |
25 | |
26 | #define PT_MAGIC 0x032957 /* Partition magic number */ |
27 | #define PT_VALID 1 /* Indicates if struct is valid */ |
28 | |
29 | data = read_dev_sector(bdev, (16384 - sizeof(*label))/512, §); |
30 | if (!data) |
31 | return -1; |
32 | |
33 | label = (struct ultrix_disklabel *)(data + 512 - sizeof(*label)); |
34 | |
35 | if (label->pt_magic == PT_MAGIC && label->pt_valid == PT_VALID) { |
36 | for (i=0; i<8; i++) |
37 | if (label->pt_part[i].pi_nblocks) |
38 | put_partition(state, i+1, |
39 | label->pt_part[i].pi_blkoff, |
40 | label->pt_part[i].pi_nblocks); |
41 | put_dev_sector(sect); |
42 | printk ("\n"); |
43 | return 1; |
44 | } else { |
45 | put_dev_sector(sect); |
46 | return 0; |
47 | } |
48 | } |
49 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9