Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:COMPAT_SYSCALL_DEFINE3

Proto:COMPAT_SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, compat_ulong_t, arg32)

Type:

Parameter:Nothing

145  arg = arg32
146  f = fdget(fd)
147  error = -EBADF
148  If Not file Then Go to out
152  error = security_file_ioctl(file, cmd, arg)
153  If error Then Go to out_fput
158  Case cmd == FIOCLEX
159  Case cmd == hese numbers need to be adjusted.
160  Case cmd == Freeze
161  Case cmd == Thaw
162  Case cmd == FICLONE
163  Go to do_ioctl
165  Case cmd == FIONBIO
166  Case cmd == FIOASYNC
167  Case cmd == Get exact space used by quota
168  Case cmd == FS_IOC_FIEMAP
169  Case cmd == get the block size used for bmap
170  Case cmd == FICLONERANGE
171  Case cmd == FIDEDUPERANGE
172  Go to found_handler
183  Case cmd == map access
184  Go to found_handler
186  Case cmd == FIONREAD
187  Go to found_handler
190  Case cmd == FS_IOC_RESVSP_32
191  Case cmd == FS_IOC_RESVSP64_32
192  error = just account for different alignment
193  Go to out_fput
194  Case cmd == FS_IOC_UNRESVSP_32
195  Case cmd == FS_IOC_UNRESVSP64_32
196  error = just account for different alignment
198  Go to out_fput
199  Case cmd == FS_IOC_ZERO_RANGE_32
200  error = just account for different alignment
202  Go to out_fput
212  Default
213  If compat_ioctl Then
215  If error != -No ioctl command Then Go to out_fput
219  If Not unlocked_ioctl Then Go to do_ioctl
221  Break
224  If compat_ioctl_check_table(simple reversible transform to make our table more evenly* distributed after sorting.(cmd)) Then Go to found_handler
227  error = Convert common ioctl arguments based on their command number* Please do not add any code in here. Instead, implement* a compat_ioctl operation in the place that handleŃ• the* ioctl for the native case.
228  If error == -No ioctl command Then error = -ENOTTY
231  Go to out_fput
233  found_handler :
234  arg = A pointer passed in from user mode. This should not* be used for syscall parameters, just declare them* as pointers because the syscall entry code will have* appropriately converted them already.
235  do_ioctl :
236  error = 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.
237  out_fput :
238  fdput(f)
239  out :
240  Return error