Function report |
Source Code:block\partitions\mac.c |
Create Date:2022-07-28 17:27:03 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:mac_partition
Proto:int mac_partition(struct parsed_partitions *state)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct parsed_partitions * | state |
45 | md = read_part_sector(state, 0, & sect) |
46 | If Not md Then Return -1 |
48 | If be16_to_cpu(xpected to be MAC_DRIVER_MAGIC ) != MAC_DRIVER_MAGIC Then |
49 | put_dev_sector(sect) |
50 | Return 0 |
52 | secsize = be16_to_cpu(block_size) |
53 | put_dev_sector(sect) |
55 | data = read_part_sector(state, datasize / 512, & sect) |
56 | If Not data Then Return -1 |
58 | partoffset = secsize % 512 |
59 | If partoffset + size of part > datasize Then Return -1 |
61 | part * mac_partition = data + partoffset |
62 | If be16_to_cpu( expected to be MAC_PARTITION_MAGIC ) != s/partitions/mac.h Then |
63 | put_dev_sector(sect) |
64 | Return 0 |
67 | If blocks_in_map < 0 || blocks_in_map >= DISK_MAX_PARTS Then |
68 | put_dev_sector(sect) |
69 | Return 0 |
72 | If blocks_in_map >= limit Then blocks_in_map = limit - 1 |
76 | When slot <= blocks_in_map cycle |
78 | put_dev_sector(sect) |
79 | data = read_part_sector(state, pos / 512, & sect) |
80 | If Not data Then Return -1 |
82 | part * mac_partition = data + pos % 512 |
83 | If be16_to_cpu( expected to be MAC_PARTITION_MAGIC ) != s/partitions/mac.h Then Break |
85 | put_partition(state, slot, be32_to_cpu( absolute starting block # of partition ) * (secsize / 512), be32_to_cpu( number of blocks in partition ) * (secsize / 512)) |
140 | put_dev_sector(sect) |
142 | 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 |