Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:disk_get_part - get partition*@disk: disk to look partition from*@partno: partition number* Look for partition @partno from @disk. If found, increment* reference count and return it.* CONTEXT:* Don't care.* RETURNS:

Proto:struct hd_struct *disk_get_part(struct gendisk *disk, int partno)

Type:struct hd_struct

Parameter:

TypeParameterName
struct gendisk *disk
intpartno
138  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
139  part = __disk_get_part(disk, partno)
140  If part Then get_device - atomically increment the reference count for the device.
142  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
144  Return part
Caller
NameDescribe
blkpg_ioctl
bdget_diskdget_disk - do bdget() by gendisk and partition number*@disk: gendisk of interest*@partno: partition number* Find partition @partno from @disk, do bdget() on it.* CONTEXT:* Don't care.* RETURNS:* Resulting block_device on success, NULL on failure.
blk_lookup_devt
__blkdev_getd_mutex locking:* mutex_lock(part->bd_mutex)* mutex_lock_nested(whole->bd_mutex, 1)