函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\block_dev.c Create Date:2022-07-29 10:46:05
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:d_start_claiming - start claiming a block device*@bdev: block device of interest*@holder: holder trying to claim @bdev*@bdev is about to be opened exclusively

函数原型:struct block_device *bd_start_claiming(struct block_device *bdev, void *holder)

返回类型:struct block_device

参数:

类型参数名称
struct block_device *bdev
void *holder
1148  might_sleep()
1154  disk等于bdev_get_gendisk(bdev, & partno)
1155  如果非disk则返回:错误号
1166  如果partnowhole等于dget_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.
1168  否则whole等于dgrab -- Grab a reference to an already referenced block device*@bdev: Block device to grab a reference to.
1171  put_disk_and_module(disk)
1172  如果非whole则返回:错误号
1176  加自旋锁
1178  err等于d_prepare_to_claim - prepare to claim a block device*@bdev: block device of interest*@whole: the whole device containing @bdev, may equal @bdev*@holder: holder trying to claim @bdev* Prepare to claim @bdev
1179  如果err恒等于0则
1180  bd_claiming等于holder
1181  自旋锁解锁
1182  返回:whole
1183  否则
1184  自旋锁解锁
1185  bdput(whole)
1186  返回:错误号
调用者
名称描述
blkdev_getlkdev_get - open a block device*@bdev: block_device to open*@mode: FMODE_* mask*@holder: exclusive holder identifier* Open @bdev with @mode. If @mode includes %FMODE_EXCL, @bdev is* open with exclusive access. Specifying %FMODE_EXCL with %NULL