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

Proto:static long blkdev_fallocate(struct file *file, int mode, loff_t start, loff_t len)

Type:long

Parameter:

TypeParameterName
struct file *file
intmode
loff_tstart
loff_tlen
2083  bdev = I_BDEV(bdev_file_inode(file))
2085  end = start + len - 1
2090  If mode & ~BLKDEV_FALLOC_FL_SUPPORTED Then Return -EOPNOTSUPP
2094  isize = NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they
2095  If start >= isize Then Return -EINVAL
2097  If end >= isize Then
2098  If mode & default is extend size Then
2099  len = isize - start
2100  end = start + len - 1
2101  Else Return -EINVAL
2108  If (start | len) & bdev_logical_block_size(bdev) - 1 Then Return -EINVAL
2112  mapping = i_mapping
2113  runcate_inode_pages_range - truncate range of pages specified by start & end byte offsets*@mapping: mapping to truncate*@lstart: offset from which to truncate*@lend: offset to which to truncate (inclusive)* Truncate the page cache, removing the pages that
2116  Case mode == FALLOC_FL_ZERO_RANGE is used to convert a range of file to zeros preferably* without issuing data IO
2117  Case mode == FALLOC_FL_ZERO_RANGE is used to convert a range of file to zeros preferably* without issuing data IO | default is extend size
2118  error = blkdev_issue_zeroout(bdev, start >> 9, len >> 9, GFP_KERNEL, do not free blocks )
2120  Break
2121  Case mode == de-allocates range | default is extend size
2122  error = blkdev_issue_zeroout(bdev, start >> 9, len >> 9, GFP_KERNEL, don't write explicit zeroes )
2124  Break
2125  Case mode == de-allocates range | default is extend size | served codepoint
2126  error = blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_KERNEL, 0)
2128  Break
2129  Default
2130  Return -EOPNOTSUPP
2132  If error Then Return error
2140  Return validate_inode_pages2_range - remove range of pages from an address_space*@mapping: the address_space*@start: the page offset 'from' which to invalidate*@end: the page offset 'to' which to invalidate (inclusive)* Any pages which are found to be mapped