函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Report the first existing lock that would conflict with l.* This implements the F_GETLK command of fcntl().

函数原型:int fcntl_getlk(struct file *filp, unsigned int cmd, struct flock *flock)

返回类型:int

参数:

类型参数名称
struct file *filp
unsigned intcmd
struct flock *flock
2325  fl等于Allocate an empty lock structure.
2326  如果(fl == NULL)则返回:负ENOMEM
2328  error等于负EINVAL
2329  如果l_type不等于F_RDLCKl_type不等于F_WRLCK则转到:out
2332  error等于Verify a "struct flock" and copy it to a "struct file_lock" as a POSIX* style lock.
2333  如果error则转到:out
2336  如果cmd恒等于F_OFD_GETLK
2337  error等于负EINVAL
2338  如果l_pid不等于0则转到:out
2341  cmd等于F_GETLK
2342  fl_flags或等于lock is "owned" by struct file
2343  fl_owner等于filp
2346  error等于vfs_test_lock - test file byte range lock*@filp: The file to test lock for*@fl: The lock to test; also used to hold result* Returns -ERRNO on failure. Indicates presence of conflicting lock by* setting conf->fl_type to something other than F_UNLCK.
2347  如果error则转到:out
2350  l_type等于fl_type
2351  如果fl_type不等于F_UNLCK
2352  error等于posix_lock_to_flock(flock, fl)
2353  如果error则转到:out
2356  out :
2357  Free a lock which is not in use.
2358  返回:error
调用者
名称描述
do_compat_fcntl64