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_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().

Proto:struct block_device *blkdev_get_by_path(const char *path, fmode_t mode, void *holder)

Type:struct block_device

Parameter:

TypeParameterName
const char *path
fmode_tmode
void *holder
1791  bdev = lookup_bdev - lookup a struct block_device by name*@pathname: special file representing the block device* Get a reference to the blockdevice at @pathname in the current* namespace if possible and return it. Return ERR_PTR(error)* otherwise.
1792  If IS_ERR(bdev) Then Return bdev
1795  err = 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
1796  If err Then Return ERR_PTR(err)
1799  If mode & le is open for writing && bdev_read_only(bdev) Then
1800  blkdev_put(bdev, mode)
1801  Return ERR_PTR( - EACCES)
1804  Return bdev
Caller
NameDescribe
mount_bdev