函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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

函数原型:int blkdev_get(struct block_device *bdev, fmode_t mode, void *holder)

返回类型:int

参数:

类型参数名称
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  如果mode按位与File is opened with O_EXCL (only set for block devices) holder
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  如果是错误
1731  bdput(bdev)
1732  返回:错误
1736  res等于d_mutex locking:* mutex_lock(part->bd_mutex)* mutex_lock_nested(whole->bd_mutex, 1)
1738  如果whole
1739  disk等于bd_disk
1742  mutex_lock( & open/close mutex )
1743  如果非resd_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  否则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  返回:res
调用者
名称描述
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