函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:devt_from_partuuid - looks up the dev_t of a partition by its UUID*@uuid_str: char array containing ascii UUID* The function will return the first partition which contains a matching* UUID value in its partition_meta_info struct. This does not search

函数原型:static dev_t devt_from_partuuid(const char *uuid_str)

返回类型:dev_t

参数:

类型参数名称
const char *uuid_str
110  res等于0
112  struct device * dev = NULL
115  offset等于0
116  bool clear_root_wait = false
119  uuid等于uuid_str
121  slash等于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
123  如果slash
124  c等于0
128  clear_root_wait = true
129  转到:done
131  len等于slashuuid_str
132  否则
133  len等于strlen - Find the length of a string*@s: The string to be sized
136  如果非len
137  clear_root_wait = true
138  转到:done
141  dev等于class_find_device( & block_class, NULL, & cmp, & match_dev_by_uuid - callback for finding a partition using its uuid*@dev: device passed in by the caller*@data: opaque pointer to the desired struct uuidcmp to match* Returns 1 if the device matches, and 0 otherwise.)
143  如果非dev则转到:done
146  res等于 dev_t, creates the sysfs "dev"
149  如果非offset则转到:no_offset
152  res等于0
153  disk等于part_to_disk(dev_to_part(dev))
154  part等于disk_get_part(disk, partno + offset)
155  如果part
156  res等于part_devt(part)
157  put_device(part_to_dev(part))
160  no_offset :
161  put_device(dev)
162  done :
163  如果clear_root_wait
164  打印错误信息("VFS: PARTUUID= is invalid.\nExpected PARTUUID=<valid-uuid-id>[/PARTNROFF=%%d]\n")
166  如果root_wait打印错误信息("Disabling rootwait; root= is invalid.\n")
168  root_wait等于0
170  返回:res
调用者
名称描述
name_to_dev_tConvert a name into device number