函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:do_compat_fcntl64

函数原型:static long do_compat_fcntl64(unsigned int fd, unsigned int cmd, compat_ulong_t arg)

返回类型:long

参数:

类型参数名称
unsigned intfd
unsigned intcmd
compat_ulong_targ
613  f等于fdget_raw(fd)
615  err等于负EBADF
617  如果非file则返回:err
620  如果此条件成立可能性小(为编译器优化)(f_mode & File is opened with O_PATH; almost nothing can be done with it )则
621  如果非check_fcntl_cmd(cmd)则转到:out_put
625  err等于security_file_fcntl(file, cmd, arg)
626  如果err则转到:out_put
630  :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  如果err退出
634  err等于fcntl_getlk(file, convert_fcntl_cmd(cmd), & flock)
635  如果err退出
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  如果非errerr等于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  退出
641  :cmd恒等于using 'struct flock64'
642  :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  如果err退出
646  err等于fcntl_getlk(file, convert_fcntl_cmd(cmd), & flock)
647  如果非errerr等于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  退出
650  :cmd恒等于F_SETLK
651  :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  如果err退出
655  err等于fcntl_setlk(fd, file, convert_fcntl_cmd(cmd), & flock)
656  退出
657  :cmd恒等于F_SETLK64
658  :cmd恒等于F_SETLKW64
659  :cmd恒等于F_OFD_SETLK
660  :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  如果err退出
664  err等于fcntl_setlk(fd, file, convert_fcntl_cmd(cmd), & flock)
665  退出
666  默认
667  err等于do_fcntl(fd, cmd, arg, file)
668  退出
670  out_put :
671  fdput(f)
672  返回:err
调用者
名称描述
COMPAT_SYSCALL_DEFINE3
COMPAT_SYSCALL_DEFINE3