Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:int blkdev_get(struct block_device *bdev, fmode_t mode, void *holder)

Type:int

Parameter:

TypeParameterName
struct block_device *bdev
fmode_tmode
void *holder
1723  struct block_device * whole = NULL
1726  WARN_ON_ONCE((mode & File is opened with O_EXCL (only set for block devices) ) && !holder)
1728  If mode & File is opened with O_EXCL (only set for block devices) && holder Then
1729  whole = 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
1730  If IS_ERR(whole) Then
1731  bdput(bdev)
1732  Return PTR_ERR(whole)
1736  res = d_mutex locking:* mutex_lock(part->bd_mutex)* mutex_lock_nested(whole->bd_mutex, 1)
1738  If whole Then
1739  disk = bd_disk
1742  mutex_lock( & open/close mutex )
1743  If Not res Then d_finish_claiming - finish claiming of a block device*@bdev: block device of interest*@whole: whole block device (returned from bd_start_claiming())*@holder: holder that has claimed @bdev* Finish exclusive open of a block device
1745  Else d_abort_claiming - abort claiming of a block device*@bdev: block device of interest*@whole: whole block device (returned from bd_start_claiming())*@holder: holder that has claimed @bdev* Abort claiming of a block device when the exclusive open failed
1756  bd_write_holder = true
1760  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1761  bdput(whole)
1764  Return res
Caller
NameDescribe
register_disk
blkdev_get_by_pathlkdev_get_by_path - open a block device by name*@path: path to the block device to open*@mode: FMODE_* mask*@holder: exclusive holder identifier* Open the blockdevice described by the device file at @path. @mode* and @holder are identical to blkdev_get().
blkdev_get_by_devlkdev_get_by_dev - open a block device by device number*@dev: device number of block device to open*@mode: FMODE_* mask*@holder: exclusive holder identifier* Open the blockdevice described by device number @dev. @mode and
blkdev_open
swsusp_swap_checkswsusp_swap_check - check if the resume device is a swap device* and get its index (if so)* This is called before saving image