Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:int disk_expand_part_tbl(struct gendisk *disk, int partno)

Type:int

Parameter:

TypeParameterName
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 = If old_ptbl Then len Else 0
1298  target = partno + 1
1299  If target < 0 Then Return -EINVAL
1303  If disk_max_parts(disk) && target > disk_max_parts(disk) Then Return -EINVAL
1306  If target <= len Then Return 0
1309  new_ptbl = kzalloc_node - allocate zeroed memory from a particular memory node.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).*@node: memory node from which to allocate
1311  If Not new_ptbl Then Return -ENOMEM
1314  len = target
1316  When i < len cycle 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  Return 0
Caller
NameDescribe
__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