函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:do_lock_file_wait

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

返回类型:int

参数:

类型参数名称
struct file *filp
unsigned intcmd
struct file_lock *fl
2408  error等于security_file_lock(filp, fl_type)
2409  如果error则返回:error
2412  循环
2413  error等于vfs_lock_file - file byte range lock*@filp: The file to apply the lock to*@cmd: type of locking operation (F_SETLK, F_GETLK, etc
2414  如果error不等于Special return value from posix_lock_file() and vfs_lock_file() for* asynchronous locking.退出
2416  error等于wait_event_interruptible - sleep until a condition gets true*@wq_head: the waitqueue to wait on*@condition: a C expression for the event to wait for* The process is put to sleep (TASK_INTERRUPTIBLE) until the(fl_wait, ! The lock, that is blocking us )
2417  如果error退出
2420  locks_delete_lock - stop waiting for a file lock*@waiter: the lock which was waiting* lockd/nfsd need to disconnect the lock while working on it.
2422  返回:error
调用者
名称描述
fcntl_setlkApply the lock described by l to an open file descriptor.* This implements both the F_SETLK and F_SETLKW commands 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().