Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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 activityDownload SCCTChinese

Name:mac_partition

Proto:int mac_partition(struct parsed_partitions *state)

Type:int

Parameter:

TypeParameterName
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)
54  datasize = und_down - round down to next specified power of 2*@x: the value to round*@y: multiple to round down to (must be a power of 2)* Rounds @x down to next multiple of @y (which must be a power of 2).* To perform arbitrary rounding down, use rounddown() below.(secsize, 512)
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
66  blocks_in_map = be32_to_cpu( # blocks in partition map )
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
75  strlcat - Append a length-limited, C-string to another*@dest: The string to be appended to*@src: The string to append to it*@count: The size of the destination buffer.
76  When slot <= blocks_in_map cycle
77  pos = slot * secsize
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))
89  If Not strncasecmp - Case insensitive, length-limited string comparison*@s1: One string*@s2: The other string*@len: the maximum number of characters to compare Then flags = ADDPART_FLAG_RAID
140  put_dev_sector(sect)
141  strlcat - Append a length-limited, C-string to another*@dest: The string to be appended to*@src: The string to append to it*@count: The size of the destination buffer.
142  Return 1