Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:init\do_mounts.c Create Date:2022-07-28 13:56:48
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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

Proto:static dev_t devt_from_partuuid(const char *uuid_str)

Type:dev_t

Parameter:

TypeParameterName
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  If slash Then
124  c = 0
128  clear_root_wait = true
129  Go to done
131  len = slash - uuid_str
132  Else
133  len = strlen - Find the length of a string*@s: The string to be sized
136  If Not len Then
137  clear_root_wait = true
138  Go to 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  If Not dev Then Go to done
146  res = dev_t, creates the sysfs "dev"
149  If Not offset Then Go to no_offset
152  res = 0
153  disk = part_to_disk(dev_to_part(dev))
154  part = disk_get_part(disk, partno + offset)
155  If part Then
156  res = part_devt(part)
157  put_device(part_to_dev(part))
160  no_offset :
161  put_device(dev)
162  done :
163  If clear_root_wait Then
164  pr_err("VFS: PARTUUID= is invalid.\nExpected PARTUUID=<valid-uuid-id>[/PARTNROFF=%%d]\n")
166  If root_wait Then pr_err("Disabling rootwait; root= is invalid.\n")
168  root_wait = 0
170  Return res
Caller
NameDescribe
name_to_dev_tConvert a name into device number