Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:struct block_device *bd_start_claiming(struct block_device *bdev, void *holder)

Type:struct block_device

Parameter:

TypeParameterName
struct block_device *bdev
void *holder
1148  might_sleep()
1154  disk = bdev_get_gendisk(bdev, & partno)
1155  If Not disk Then Return ERR_PTR( - ENXIO)
1166  If partno Then whole = 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  Else 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  If Not whole Then Return ERR_PTR( - ENOMEM)
1176  spin_lock( & pseudo-fs)
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  If err == 0 Then
1180  bd_claiming = holder
1181  spin_unlock( & pseudo-fs)
1182  Return whole
1183  Else
1184  spin_unlock( & pseudo-fs)
1185  bdput(whole)
1186  Return ERR_PTR(err)
Caller
NameDescribe
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