函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Fill in a file_lock structure with an appropriate FLOCK lock.

函数原型:static struct file_lock *flock_make_lock(struct file *filp, unsigned int cmd, struct file_lock *fl)

返回类型:struct file_lock

参数:

类型参数名称
struct file *filp
unsigned intcmd
struct file_lock *fl
481  type等于flock_translate_cmd(cmd)
483  如果type小于0则返回:错误号
486  如果(fl == NULL)则
487  fl等于Allocate an empty lock structure.
488  如果(fl == NULL)则返回:错误号
490  否则
491  locks_init_lock(fl)
494  fl_file等于filp
495  fl_owner等于filp
496  fl_pid等于tgid
497  fl_flags等于FL_FLOCK
498  fl_type等于type
499  fl_end等于OFFSET_MAX
501  返回:fl
调用者
名称描述
SYSCALL_DEFINE2sys_flock: - flock() system call.*@fd: the file descriptor to lock.*@cmd: the type of lock to apply.* Apply a %FL_FLOCK style lock to an open file descriptor.* The @cmd can be one of:* - %LOCK_SH -- a shared lock.* - %LOCK_EX -- an exclusive lock.
locks_remove_flockThe i_flctx must be valid when calling into here