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

Proto:static int blkdev_open(struct inode *inode, struct file *filp)

Type:int

Parameter:

TypeParameterName
struct inode *inode
struct file *filp
1857  f_flags |= O_LARGEFILE
1859  f_mode |= File is capable of returning -EAGAIN if I/O will block
1861  If f_flags & O_NDELAY Then f_mode |= File is opened with O_NDELAY (only set for block devices)
1863  If f_flags & O_EXCL Then f_mode |= File is opened with O_EXCL (only set for block devices)
1865  If (f_flags & O_ACCMODE) == 3 Then f_mode |= File is opened using open(.., 3, ..) and is writeable only for ioctls(specialy hack for floppy.c)
1868  bdev = bd_acquire(inode)
1869  If (bdev == NULL) Then Return -ENOMEM
1872  f_mapping = i_mapping
1873  f_wb_err = lemap_sample_wb_err - sample the current errseq_t to test for later errors*@mapping: mapping to be sampled* Writeback errors are always reported relative to a particular sample point* in the past. This function provides those sample points.
1875  Return 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