Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ioctl_fiemap

Proto:static int ioctl_fiemap(struct file *filp, struct fiemap __user *ufiemap)

Type:int

Parameter:

TypeParameterName
struct file *filp
struct fiemap __user *ufiemap
181  struct fiemap_extent_info fieinfo = {0, }
182  inode = file_inode(filp)
183  sb = i_sb
187  If Not fiemap Then Return -EOPNOTSUPP
190  If copy_from_user( & fiemap, ufiemap, size of fiemap ) Then Return -EFAULT
193  If size of fm_extents array (in) > So that the fiemap access checks can't overflow on 32 bit machines. Then Return -EINVAL
196  error = fiemap_check_ranges(sb, logical offset (inclusive) at * which to start mapping (in) , logical length of mapping which * userspace wants (in) , & len)
198  If error Then Return error
201  Flags as passed from user = FIEMAP_FLAG_* flags for request (in/out)
202  Size of fiemap_extent array = size of fm_extents array (in)
203  Start offiemap_extent array = array of mapped extents (out)
205  If size of fm_extents array (in) != 0 && Not access_ok - Checks if a user space pointer is valid*@addr: User space pointer to start of block to check*@size: Size of block to check* Context: User context only. This function may sleep if pagefaults are* enabled.(Start offiemap_extent array , Size of fiemap_extent array * sizeof(structfiemap_extent)) Then Return -EFAULT
210  If Flags as passed from user & sync file data before map Then filemap_write_and_wait(i_mapping)
213  error = fiemap(inode, & fieinfo, logical offset (inclusive) at * which to start mapping (in) , len)
214  FIEMAP_FLAG_* flags for request (in/out) = Flags as passed from user
215  number of extents that were mapped (out) = Number of mapped extents
216  If copy_to_user(ufiemap, & fiemap, size of fiemap ) Then error = -EFAULT
219  Return error
Caller
NameDescribe
do_vfs_ioctlWhen you add any new common ioctls to the switches above and below* please update compat_sys_ioctl() too.* do_vfs_ioctl() is not for drivers and not intended to be EXPORT_SYMBOL()'d.* It's just a simple helper for sys_ioctl and compat_sys_ioctl.