Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:generic_setlease - sets a lease on an open file*@filp: file pointer*@arg: type of lease to obtain*@flp: input - file_lock to use, output - file_lock inserted*@priv: private data for lm_setup (may be NULL if lm_setup* doesn't require it)* The (input)

Proto:int generic_setlease(struct file *filp, long arg, struct file_lock **flp, void **priv)

Type:int

Parameter:

TypeParameterName
struct file *filp
longarg
struct file_lock **flp
void **priv
1967  inode = locks_inode(filp)
1970  If Not uid_eq(current_fsuid(), i_uid) && Not Check operation authority Then Return -EACCES
1972  If Not S_ISREG(i_mode) Then Return -EINVAL
1974  error = security_file_lock(filp, arg)
1975  If error Then Return error
1979  Case arg == F_UNLCK
1980  Return generic_delete_lease(filp, * priv)
1981  Case arg == F_RDLCK
1982  Case arg == F_WRLCK
1983  If Not lm_break Then
1984  WARN_ON_ONCE(1)
1985  Return -ENOLCK
1988  Return generic_add_lease(filp, arg, flp, priv)
1989  Default
1990  Return -EINVAL
Caller
NameDescribe
vfs_setleasevfs_setlease - sets a lease on an open file*@filp: file pointer*@arg: type of lease to obtain*@lease: file_lock to use when adding a lease*@priv: private info for lm_setup when adding a lease (may be* NULL if lm_setup doesn't require it)