函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:disk_expand_part_tbl - expand disk->part_tbl*@disk: disk to expand part_tbl for*@partno: expand such that this partno can fit in* Expand disk->part_tbl such that @partno can fit in. disk->part_tbl

函数原型:int disk_expand_part_tbl(struct gendisk *disk, int partno)

返回类型:int

参数:

类型参数名称
struct gendisk *disk
intpartno
1288  old_ptbl等于cu_dereference_protected() - fetch RCU pointer when updates prevented*@p: The pointer to read, prior to dereferencing*@c: The conditions under which the dereference will take place* Return the value of the specified RCU-protected pointer, but omit( Array of pointers to partitions indexed by partno. * Protected with matching bdev lock but stat and other * non-critical accesses use RCU. Always access through * helpers., 1)
1291  len等于如果old_ptbllen否则0
1298  target等于partno加1
1299  如果target小于0则返回:负EINVAL
1303  如果disk_max_parts(disk)且target大于disk_max_parts(disk)则返回:负EINVAL
1306  如果target小于等于len则返回:0
1309  new_ptbl等于根据内存节点分配内存
1311  如果非new_ptbl则返回:负ENOMEM
1314  len等于target
1316 i小于len循环cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization(part[i], part[i])
1319  disk_replace_part_tbl - replace disk->part_tbl in RCU-safe way*@disk: disk to replace part_tbl for*@new_ptbl: new part_tbl to install* Replace disk->part_tbl with @new_ptbl in RCU-safe way. The* original ptbl is freed using RCU callback.* LOCKING:
1320  返回:0
调用者
名称描述
__alloc_disk_node
add_partitionMust be called either with bd_mutex held, before a disk can be opened or* after all disk users are gone.
blk_add_partitions