Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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.

Proto:int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, unsigned long arg)

Type:int

Parameter:

TypeParameterName
struct file *filp
unsigned intfd
unsigned intcmd
unsigned longarg
673  error = 0
674  __user * argp = arg
675  inode = file_inode(filp)
678  Case cmd == FIOCLEX
679  set_close_on_exec(fd, 1)
680  Break
682  Case cmd == hese numbers need to be adjusted.
683  set_close_on_exec(fd, 0)
684  Break
686  Case cmd == FIONBIO
687  error = ioctl_fionbio(filp, argp)
688  Break
690  Case cmd == FIOASYNC
691  error = ioctl_fioasync(fd, filp, argp)
692  Break
694  Case cmd == Get exact space used by quota
695  If S_ISDIR(i_mode) || S_ISREG(i_mode) || S_ISLNK(i_mode) Then
698  error = If copy_to_user(argp, & res, size of res ) Then -EFAULT Else 0
700  Else error = -ENOTTY
702  Break
704  Case cmd == Freeze
705  error = ioctl_fsfreeze(filp)
706  Break
708  Case cmd == Thaw
709  error = ioctl_fsthaw(filp)
710  Break
712  Case cmd == FS_IOC_FIEMAP
713  Return ioctl_fiemap(filp, argp)
715  Case cmd == get the block size used for bmap
717  If Not s_blocksize Then Return -EINVAL
719  Return Write a simple value into user space(s_blocksize, (int__user * )argp)
721  Case cmd == FICLONE
722  Return ioctl_file_clone(filp, arg, 0, 0, 0)
724  Case cmd == FICLONERANGE
725  Return ioctl_file_clone_range(filp, argp)
727  Case cmd == FIDEDUPERANGE
728  Return ioctl_file_dedupe_range(filp, argp)
730  Default
731  If S_ISREG(i_mode) Then error = file_ioctl(filp, cmd, arg)
733  Else 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  Break
737  Return error
Caller
NameDescribe
ksys_ioctl
COMPAT_SYSCALL_DEFINE3