函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:file_ioctl

函数原型:static int file_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)

返回类型:int

参数:

类型参数名称
struct file *filp
unsigned intcmd
unsigned longarg
527  inode等于file_inode(filp)
528  __userp等于arg
531  :cmd恒等于map access
532  返回:ioctl_fibmap(filp, p)
533  :cmd恒等于FIONREAD
534  返回:put_user - Write a simple value into user space(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 - f_pos, p)
535  :cmd恒等于FS_IOC_RESVSP
536  :cmd恒等于FS_IOC_RESVSP64
537  返回:This provides compatibility with legacy XFS pre-allocation ioctls* which predate the fallocate syscall.* Only the l_start, l_len and l_whence fields of the 'struct space_resv'* are used here, rest are ignored.
538  :cmd恒等于FS_IOC_UNRESVSP
539  :cmd恒等于FS_IOC_UNRESVSP64
540  返回:This provides compatibility with legacy XFS pre-allocation ioctls* which predate the fallocate syscall.* Only the l_start, l_len and l_whence fields of the 'struct space_resv'* are used here, rest are ignored.
541  :cmd恒等于FS_IOC_ZERO_RANGE
542  返回:This provides compatibility with legacy XFS pre-allocation ioctls* which predate the fallocate syscall.* Only the l_start, l_len and l_whence fields of the 'struct space_resv'* are used here, rest are ignored.
545  返回:vfs_ioctl - call filesystem specific ioctl methods*@filp: open file to invoke ioctl method on*@cmd: ioctl command to execute*@arg: command-specific argument for ioctl* Invokes filesystem specific ->unlocked_ioctl, if one exists; otherwise* returns -ENOTTY.
调用者
名称描述
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.