Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\partitions\check.c Create Date:2022-07-28 17:25:28
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:check_partition

Proto:struct parsed_partitions *check_partition(struct gendisk *hd, struct block_device *bdev)

Type:struct parsed_partitions

Parameter:

TypeParameterName
struct gendisk *hd
struct block_device *bdev
148  state = allocate_partitions(hd)
149  If Not state Then Return NULL
151  pp_buf = __get_free_page(GFP_KERNEL)
152  If Not pp_buf Then
153  free_partitions(state)
154  Return NULL
156  pp_buf[0] = '\0'
158  bdev = bdev
159  disk_name() is used by partition check code and the genhd driver.* It formats the devicename of the indicated disk into* the supplied buffer (of size at least 32), and returns* a pointer to that same buffer (for convenience).
160  snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
161  If isdigit(name[strlen - Find the length of a string*@s: The string to be sized - 1]) Then sprintf(name, "p")
164  i = res = err = 0
165  When Not res && check_part[i] cycle
166  memset(parts, 0, limit * size of parts[0] )
167  res = check_part[i++](state)
168  If res < 0 Then
172  err = res
173  res = 0
177  If res > 0 Then
178  printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
180  free_page((unsignedlong)pp_buf)
181  Return state
183  If access_beyond_eod Then err = -ENOSPC
185  If err Then res = err
188  If res Then
189  If This is ugly: should make genhd removable media aware Then 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.
192  printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
195  free_page((unsignedlong)pp_buf)
196  free_partitions(state)
197  Return ERR_PTR(res)
Caller
NameDescribe
blk_add_partitions