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:Fill in a file_lock structure with an appropriate FLOCK lock.

Proto:static struct file_lock *flock_make_lock(struct file *filp, unsigned int cmd, struct file_lock *fl)

Type:struct file_lock

Parameter:

TypeParameterName
struct file *filp
unsigned intcmd
struct file_lock *fl
481  type = flock_translate_cmd(cmd)
483  If type < 0 Then Return ERR_PTR(type)
486  If (fl == NULL) Then
487  fl = Allocate an empty lock structure.
488  If (fl == NULL) Then Return ERR_PTR( - ENOMEM)
490  Else
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  Return fl
Caller
NameDescribe
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