Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:int fcntl_getlk(struct file *filp, unsigned int cmd, struct flock *flock)

Type:int

Parameter:

TypeParameterName
struct file *filp
unsigned intcmd
struct flock *flock
2325  fl = Allocate an empty lock structure.
2326  If (fl == NULL) Then Return -ENOMEM
2328  error = -EINVAL
2329  If l_type != F_RDLCK && l_type != F_WRLCK Then Go to out
2332  error = Verify a "struct flock" and copy it to a "struct file_lock" as a POSIX* style lock.
2333  If error Then Go to out
2336  If cmd == F_OFD_GETLK Then
2337  error = -EINVAL
2338  If l_pid != 0 Then Go to 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  If error Then Go to out
2350  l_type = fl_type
2351  If fl_type != F_UNLCK Then
2352  error = posix_lock_to_flock(flock, fl)
2353  If error Then Go to out
2356  out :
2357  Free a lock which is not in use.
2358  Return error
Caller
NameDescribe
do_compat_fcntl64