Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:blk_add_partitions

Proto:int blk_add_partitions(struct gendisk *disk, struct block_device *bdev)

Type:int

Parameter:

TypeParameterName
struct gendisk *disk
struct block_device *bdev
538  ret = -EAGAIN
540  If Not disk_part_scan_enabled(disk) Then Return 0
543  state = check_partition(disk, bdev)
544  If Not state Then Return 0
546  If IS_ERR(state) Then
551  If PTR_ERR(state) == -ENOSPC Then
554  If disk_unlock_native_capacity(disk) Then Return -EAGAIN
557  Return -EIO
563  If zoned == Host-managed zoned block device Then
564  pr_warn("%s: ignoring partition table on host managed zoned block device\n", name of major driver )
566  ret = 0
567  Go to out_free_state
575  If access_beyond_eod Then
576  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
579  If disk_unlock_native_capacity(disk) Then Go to out_free_state
584  kobject_uevent - notify userspace by sending an uevent*@kobj: struct kobject that the action is happening to*@action: action that is happening* Returns 0 if kobject_uevent() is completed with success or the* corresponding error when it fails.
590  When p < limit cycle If size Then
592  highest = p
593  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
595  When p < limit cycle If Not blk_add_partition(disk, bdev, state, p) Then
597  Go to out_free_state
599  ret = 0
600  out_free_state :
601  free_partitions(state)
602  Return ret