函数逻辑报告 |
Source Code:fs\locks.c |
Create Date:2022-07-29 10:59:25 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:Try to create a FLOCK lock on filp
函数原型:static int flock_lock_inode(struct inode *inode, struct file_lock *request)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct inode * | inode | |
struct file_lock * | request |
1041 | error等于0 |
1042 | bool found = false |
1045 | ctx等于locks_get_lock_context(inode, fl_type) |
1046 | 如果非ctx则 |
1049 | 返回:如果fl_flags按位与when unlocking, test for existence 则负ENOENT否则0 |
1052 | 如果非fl_flags按位与 trying to lock, just looking 的值且fl_type不等于F_UNLCK则 |
1058 | percpu_down_read( & file_rwsem) |
1059 | 加自旋锁 |
1060 | 如果fl_flags按位与 trying to lock, just looking 则转到:find_conflict |
1068 | found = true |
1069 | locks_delete_lock_ctx(fl, & dispose) |
1070 | 退出 |
1079 | find_conflict : |
1081 | 如果非Determine if lock sys_fl blocks lock caller_fl. FLOCK specific* checking before calling the locks_conflict().则继续下一循环 |
1084 | 如果非fl_flags按位与A blocking lock 的值则转到:out |
1086 | error等于Special return value from posix_lock_file() and vfs_lock_file() for* asynchronous locking. |
1088 | 转到:out |
1090 | 如果fl_flags按位与 trying to lock, just looking 则转到:out |
1092 | locks_copy_lock(new_fl, request) |
1093 | locks_move_blocks(new_fl, request) |
1094 | locks_insert_lock_ctx(new_fl, & flc_flock) |
1095 | new_fl = NULL |
1096 | error等于0 |
1098 | out : |
1099 | 自旋锁解锁 |
1100 | percpu_up_read( & file_rwsem) |
1103 | locks_dispose_list( & dispose) |
1104 | trace_flock_lock_inode(inode, request, error) |
1105 | 返回:error |
名称 | 描述 |
---|---|
flock_lock_inode_wait | lock_lock_inode_wait - Apply a FLOCK-style lock to a file*@inode: inode of the file to apply to*@fl: The lock to be applied* Apply a FLOCK style lock request to an inode. |
locks_remove_flock | The i_flctx must be valid when calling into here |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |