函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\partitions\mac.c Create Date:2022-07-27 19:02:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:mac_partition

函数原型:int mac_partition(struct parsed_partitions *state)

返回类型:int

参数:

类型参数名称
struct parsed_partitions *state
45  md等于read_part_sector(state, 0, & sect)
46  如果非md则返回:负1
48  如果be16_to_cpu(xpected to be MAC_DRIVER_MAGIC )不等于MAC_DRIVER_MAGIC
49  put_dev_sector(sect)
50  返回: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  如果非data则返回:负1
58  partoffset等于secsize取模512
59  如果partoffsetpart的长度大于datasize则返回:负1
61  partmac_partition等于datapartoffset
62  如果be16_to_cpu( expected to be MAC_PARTITION_MAGIC )不等于s/partitions/mac.h
63  put_dev_sector(sect)
64  返回:0
66  blocks_in_map等于be32_to_cpu( # blocks in partition map )
67  如果blocks_in_map小于0或blocks_in_map大于等于DISK_MAX_PARTS
68  put_dev_sector(sect)
69  返回:0
72  如果blocks_in_map大于等于limitblocks_in_map等于limit减1
75  长字符串拼接
76 slot小于等于blocks_in_map循环
77  pos等于slotsecsize
78  put_dev_sector(sect)
79  data等于read_part_sector(state, pos / 512, & sect)
80  如果非data则返回:负1
82  partmac_partition等于datapos取模512
83  如果be16_to_cpu( expected to be MAC_PARTITION_MAGIC )不等于s/partitions/mac.h退出
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  如果非strncasecmp - Case insensitive, length-limited string comparison*@s1: One string*@s2: The other string*@len: the maximum number of characters to compareflags等于ADDPART_FLAG_RAID
140  put_dev_sector(sect)
141  长字符串拼接
142  返回:1