Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:flock64_to_posix_lock

Proto:static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl, struct flock64 *l)

Type:int

Parameter:

TypeParameterName
struct file *filp
struct file_lock *fl
struct flock64 *l
522  Case l_whence == seek relative to beginning of file
523  fl_start = 0
524  Break
525  Case l_whence == seek relative to current file position
526  fl_start = f_pos
527  Break
528  Case l_whence == seek relative to end of file
529  fl_start = NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they
530  Break
531  Default
532  Return -EINVAL
534  If l_start > OFFSET_MAX - fl_start Then Return -EOVERFLOW
536  fl_start += l_start
537  If fl_start < 0 Then Return -EINVAL
542  If l_len > 0 Then
543  If l_len - 1 > OFFSET_MAX - fl_start Then Return -EOVERFLOW
545  fl_end = fl_start + l_len - 1
547  Else if l_len < 0 Then
548  If fl_start + l_len < 0 Then Return -EINVAL
550  fl_end = fl_start - 1
551  fl_start += l_len
552  Else fl_end = OFFSET_MAX
555  fl_owner = files
556  fl_pid = tgid
557  fl_file = filp
558  fl_flags = FL_POSIX
559  Callbacks for filesystems = NULL
560  Callbacks for lockmanagers = NULL
562  Return assign_type(fl, l_type)
Caller
NameDescribe
flock_to_posix_lockVerify a "struct flock" and copy it to a "struct file_lock" as a POSIX* style lock.
fcntl_getlk64Report the first existing lock that would conflict with l.* This implements the F_GETLK command of fcntl().
fcntl_setlk64Apply the lock described by l to an open file descriptor.* This implements both the F_SETLK and F_SETLKW commands of fcntl().