Function report |
Source Code:block\partitions\sun.c |
Create Date:2022-07-28 17:30:01 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:sun_partition
Proto:int sun_partition(struct parsed_partitions *state)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct parsed_partitions * | state |
18 | slot = 1 |
21 | struct sun_disklabel{unsigned char info[128];struct sun_vtoc{__be32 version;char volume[8];__be16 nparts;struct sun_info{__be16 id;__be16 flags;}infos[8];__be16 padding;__be32 bootinfo[3];__be32 sanity;__be32 reserved[10];__be32 timestamp[8];}vtoc;__be32 write_reinstruct;__be32 read_reinstruct;unsigned char spare[148];__be16 rspeed;__be16 pcylcount;__be16 sparecyl;__be16 obs1;__be16 obs2;__be16 ilfact;__be16 ncyl;__be16 nacyl;__be16 ntrks;__be16 nsect;__be16 obs3;__be16 obs4;struct sun_partition{__be32 start_cylinder;__be32 num_sectors;}partitions[8];__be16 magic;__be16 csum;} * label |
65 | label = read_part_sector(state, 0, & sect) |
66 | If Not label Then Return -1 |
69 | p = partitions |
70 | If be16_to_cpu(magic) != s/partitions/sun.h Then |
73 | put_dev_sector(sect) |
74 | Return 0 |
80 | If csum Then |
83 | put_dev_sector(sect) |
84 | Return 0 |
88 | use_vtoc = be32_to_cpu(sanity) == SUN_VTOC_SANITY && be32_to_cpu(version) == 1 && be16_to_cpu(nparts) <= 8 |
93 | nparts = If use_vtoc Then be16_to_cpu(nparts) Else 8 |
101 | spc = be16_to_cpu(ntrks) * be16_to_cpu(nsect) |
106 | st_sector = be32_to_cpu(start_cylinder) * spc |
107 | num_sectors = be32_to_cpu(num_sectors) |
108 | If num_sectors Then |
109 | put_partition(state, slot, st_sector, num_sectors) |
110 | flags = 0 |
111 | If use_vtoc Then |
112 | If be16_to_cpu(id) == LINUX_RAID_PARTITION Then flags |= ADDPART_FLAG_RAID |
114 | Else if be16_to_cpu(id) == SUN_WHOLE_DISK Then flags |= ADDPART_FLAG_WHOLEDISK |
118 | slot++ |
121 | put_dev_sector(sect) |
122 | Return 1 |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |