函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sys_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.

函数原型:SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)

返回类型:

参数:

2190  f等于fdget(fd)
2195  error等于负EBADF
2196  如果非file则转到:out
2199  can_sleep等于非cmd按位与LOCK_NB的值
2200  cmd与等于LOCK_NB的反
2201  unlock等于cmd恒等于LOCK_UN
2203  如果非unlock且非cmd按位与LOCK_MAND的值且非f_mode按位与le is open for reading 按位或le is open for writing 的值的值则转到:out_putf
2207  lock等于Fill in a file_lock structure with an appropriate FLOCK lock.
2208  如果是错误
2209  error等于错误
2210  转到:out_putf
2213  如果can_sleepfl_flags或等于A blocking lock
2216  error等于security_file_lock(file, fl_type)
2217  如果error则转到:out_free
2220  如果flockerror等于flock(file, (can_sleep) ? F_SETLKW : F_SETLK, lock)
2224  否则error等于locks_lock_file_wait(file, lock)
2227  out_free :
2228  Free a lock which is not in use.
2230  out_putf :
2231  fdput(f)
2232  out :
2233  返回:error