Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:do_compat_fcntl64

Proto:static long do_compat_fcntl64(unsigned int fd, unsigned int cmd, compat_ulong_t arg)

Type:long

Parameter:

TypeParameterName
unsigned intfd
unsigned intcmd
compat_ulong_targ
613  f = fdget_raw(fd)
615  err = -EBADF
617  If Not file Then Return err
620  If Value for the false possibility is greater at compile time(f_mode & File is opened with O_PATH; almost nothing can be done with it ) Then
621  If Not check_fcntl_cmd(cmd) Then Go to out_put
625  err = security_file_fcntl(file, cmd, arg)
626  If err Then Go to out_put
630  Case cmd == F_GETLK
631  err = get_compat_flock( & flock, 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.)
632  If err Then Break
634  err = fcntl_getlk(file, convert_fcntl_cmd(cmd), & flock)
635  If err Then Break
637  err = GETLK was successful and we need to return the data, but it needs to fit in* the compat structure.* l_start shouldn't be too big, unless the original start + end is greater than* COMPAT_OFF_T_MAX, in which case the app was asking for trouble, so we return
638  If Not err Then err = put_compat_flock( & flock, 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.)
640  Break
641  Case cmd == using 'struct flock64'
642  Case cmd == F_OFD_GETLK
643  err = get_compat_flock64( & flock, 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.)
644  If err Then Break
646  err = fcntl_getlk(file, convert_fcntl_cmd(cmd), & flock)
647  If Not err Then err = put_compat_flock64( & flock, 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.)
649  Break
650  Case cmd == F_SETLK
651  Case cmd == F_SETLKW
652  err = get_compat_flock( & flock, 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.)
653  If err Then Break
655  err = fcntl_setlk(fd, file, convert_fcntl_cmd(cmd), & flock)
656  Break
657  Case cmd == F_SETLK64
658  Case cmd == F_SETLKW64
659  Case cmd == F_OFD_SETLK
660  Case cmd == F_OFD_SETLKW
661  err = get_compat_flock64( & flock, 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.)
662  If err Then Break
664  err = fcntl_setlk(fd, file, convert_fcntl_cmd(cmd), & flock)
665  Break
666  Default
667  err = do_fcntl(fd, cmd, arg, file)
668  Break
670  out_put :
671  fdput(f)
672  Return err
Caller
NameDescribe
COMPAT_SYSCALL_DEFINE3
COMPAT_SYSCALL_DEFINE3