函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\ioctl.c Create Date:2022-07-29 10:36:16
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:ioctl_fiemap

函数原型:static int ioctl_fiemap(struct file *filp, struct fiemap __user *ufiemap)

返回类型:int

参数:

类型参数名称
struct file *filp
struct fiemap __user *ufiemap
181  struct fiemap_extent_info fieinfo = {0, }
182  inode等于file_inode(filp)
183  sb等于i_sb
187  如果非fiemap则返回:负EOPNOTSUPP
190  如果copy_from_user( & fiemap, ufiemap, fiemap的长度)则返回:负EFAULT
193  如果 size of fm_extents array (in) 大于So that the fiemap access checks can't overflow on 32 bit machines. 则返回:负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  如果error则返回: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  如果 size of fm_extents array (in) 不等于0且非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))则返回:负EFAULT
210  如果Flags as passed from user 按位与sync file data before map 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  如果copy_to_user(ufiemap, & fiemap, fiemap的长度)则error等于负EFAULT
219  返回:error
调用者
名称描述
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.