Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:struct block_device *lookup_bdev(const char *pathname)

Type:struct block_device

Parameter:

TypeParameterName
const char *pathname
2190  If Not pathname || Not pathname Then Return ERR_PTR( - EINVAL)
2193  error = kern_path(pathname, llow links at the end , & path)
2194  If error Then Return ERR_PTR(error)
2197  inode = d_backing_inode - Get upper or lower inode we should be using*@upper: The upper layer* This is the helper that should be used to get at the inode that will be used* if this dentry were to be opened as a file. The inode may be on the upper
2198  error = -ENOTBLK
2199  If Not S_ISBLK(i_mode) Then Go to fail
2201  error = -EACCES
2202  If Not may_open_dev( & path) Then Go to fail
2204  error = -ENOMEM
2205  bdev = bd_acquire(inode)
2206  If Not bdev Then Go to fail
2208  out :
2209  path_put - put a reference to a path*@path: path to put the reference to* Given a path decrement the reference count to the dentry and the vfsmount.
2210  Return bdev
2211  fail :
2212  bdev = ERR_PTR(error)
2213  Go to out
Caller
NameDescribe
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().
quotactl_blocklook up a superblock on which quota ops will be performed* - use the name of a block device to find the superblock thereon