函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:parse_subpart

函数原型:static int parse_subpart(struct cmdline_subpart **subpart, char *partdef)

返回类型:int

参数:

类型参数名称
struct cmdline_subpart **subpart
char *partdef
13  ret等于0
16  * subpart = NULL
18  new_subpart等于分配内存并置零
19  如果非new_subpart则返回:负ENOMEM
22  如果partdef恒等于'-'则
23  size等于0ULL的反
24  partdef自加
25  否则
26  size等于memparse - parse a string with mem suffixes into a number*@ptr: Where parse begins*@retptr: (output) Optional pointer to next char after parse completes* Parses a string into a number. The number stored at @ptr is
27  如果size小于PAGE_SIZE
28  打印警告信息("cmdline partition size is invalid.")
29  ret等于负EINVAL
30  转到:fail
34  如果partdef恒等于'@'则
35  partdef自加
36  from等于memparse - parse a string with mem suffixes into a number*@ptr: Where parse begins*@retptr: (output) Optional pointer to next char after parse completes* Parses a string into a number. The number stored at @ptr is
37  否则
38  from等于0ULL的反
41  如果partdef恒等于'('则
43  next等于strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for
45  如果非next
46  打印警告信息("cmdline partition format is invalid.")
47  ret等于负EINVAL
48  转到:fail
51  length等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(int, next - partdef, partition name, such as 'rootfs' 的长度 - 1)
53  strncpy( partition name, such as 'rootfs' , partdef, length)
54  partition name, such as 'rootfs' [length]等于'\0'
56  partdef等于next先自加
57  否则 partition name, such as 'rootfs' [0]等于'\0'
60  flags等于0
62  如果非字符串指定长度比较
63  flags或等于Device is read only
64  partdef加等于2
67  如果非字符串指定长度比较
68  flags或等于Always locked after reset
69  partdef加等于2
72  subpart等于new_subpart
73  返回:0
74  fail :
75  释放内存
76  返回:ret
调用者
名称描述
parse_parts