Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\locks.c Create Date:2022-07-28 20:25:34
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_getlk64(struct file *filp, unsigned int cmd, struct flock64 *flock)

Type:int

Parameter:

TypeParameterName
struct file *filp
unsigned intcmd
struct flock64 *flock
2537  fl = Allocate an empty lock structure.
2538  If (fl == NULL) Then Return -ENOMEM
2541  error = -EINVAL
2542  If l_type != F_RDLCK && l_type != F_WRLCK Then Go to out
2545  error = flock64_to_posix_lock(filp, fl, flock)
2546  If error Then Go to out
2549  If cmd == F_OFD_GETLK Then
2550  error = -EINVAL
2551  If l_pid != 0 Then Go to out
2554  cmd = using 'struct flock64'
2555  fl_flags |= lock is "owned" by struct file
2556  fl_owner = filp
2559  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.
2560  If error Then Go to out
2563  l_type = fl_type
2564  If fl_type != F_UNLCK Then posix_lock_to_flock64(flock, fl)
2567  out :
2568  Free a lock which is not in use.
2569  Return error