函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:check_partition

函数原型:struct parsed_partitions *check_partition(struct gendisk *hd, struct block_device *bdev)

返回类型:struct parsed_partitions

参数:

类型参数名称
struct gendisk *hd
struct block_device *bdev
148  state等于allocate_partitions(hd)
149  如果非state则返回:NULL
151  pp_buf等于__get_free_page(GFP_KERNEL)
152  如果非pp_buf
153  free_partitions(state)
154  返回: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  如果是数字输出格式化串
164  i等于res等于err等于0
165  当非rescheck_part[i]循环
166  memset(parts, 0, limit * parts[0]的长度)
167  res等于check_part[i++](state)
168  如果res小于0则
172  err等于res
173  res等于0
177  如果res大于0则
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  返回:state
183  如果access_beyond_eoderr等于负ENOSPC
185  如果errres等于err
188  如果res
189  如果This is ugly: should make genhd removable media aware长字符串拼接
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  返回:错误号
调用者
名称描述
blk_add_partitions