函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:When 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.

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

返回类型:int

参数:

类型参数名称
struct file *filp
unsigned intfd
unsigned intcmd
unsigned longarg
673  error等于0
674  __userargp等于arg
675  inode等于file_inode(filp)
678  :cmd恒等于FIOCLEX
679  set_close_on_exec(fd, 1)
680  退出
682  :cmd恒等于hese numbers need to be adjusted.
683  set_close_on_exec(fd, 0)
684  退出
686  :cmd恒等于FIONBIO
687  error等于ioctl_fionbio(filp, argp)
688  退出
690  :cmd恒等于FIOASYNC
691  error等于ioctl_fioasync(fd, filp, argp)
692  退出
694  :cmd恒等于Get exact space used by quota
695  如果S_ISDIR(i_mode)或S_ISREG(i_mode)或S_ISLNK(i_mode)则
697  res等于inode_get_bytes(inode)
698  error等于如果copy_to_user(argp, & res, res的长度)则负EFAULT否则0
700  否则error等于负ENOTTY
702  退出
704  :cmd恒等于Freeze
705  error等于ioctl_fsfreeze(filp)
706  退出
708  :cmd恒等于Thaw
709  error等于ioctl_fsthaw(filp)
710  退出
712  :cmd恒等于FS_IOC_FIEMAP
713  返回:ioctl_fiemap(filp, argp)
715  :cmd恒等于get the block size used for bmap
717  如果非s_blocksize则返回:负EINVAL
719  返回:put_user - Write a simple value into user space(s_blocksize, (int__user * )argp)
721  :cmd恒等于FICLONE
722  返回:ioctl_file_clone(filp, arg, 0, 0, 0)
724  :cmd恒等于FICLONERANGE
725  返回:ioctl_file_clone_range(filp, argp)
727  :cmd恒等于FIDEDUPERANGE
728  返回:ioctl_file_dedupe_range(filp, argp)
730  默认
731  如果S_ISREG(i_mode)则error等于file_ioctl(filp, cmd, arg)
733  否则error等于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.
735  退出
737  返回:error
调用者
名称描述
ksys_ioctl
COMPAT_SYSCALL_DEFINE3