函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:flock64_to_posix_lock

函数原型:static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl, struct flock64 *l)

返回类型:int

参数:

类型参数名称
struct file *filp
struct file_lock *fl
struct flock64 *l
522  :l_whence恒等于seek relative to beginning of file
523  fl_start等于0
524  退出
525  :l_whence恒等于seek relative to current file position
526  fl_start等于f_pos
527  退出
528  :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  退出
531  默认
532  返回:负EINVAL
534  如果l_start大于OFFSET_MAXfl_start则返回:负EOVERFLOW
536  fl_start加等于l_start
537  如果fl_start小于0则返回:负EINVAL
542  如果l_len大于0则
543  如果l_len减1大于OFFSET_MAXfl_start则返回:负EOVERFLOW
545  fl_end等于fl_startl_len减1
547  否则如果l_len小于0则
548  如果fl_startl_len小于0则返回:负EINVAL
550  fl_end等于fl_start减1
551  fl_start加等于l_len
552  否则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  返回:assign_type(fl, l_type)
调用者
名称描述
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().