函数逻辑报告 |
Source Code:fs\locks.c |
Create Date:2022-07-29 10:59:27 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:posix_lock_inode
函数原型:static int posix_lock_inode(struct inode *inode, struct file_lock *request, struct file_lock *conflock)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct inode * | inode | |
struct file_lock * | request | |
struct file_lock * | conflock |
1118 | bool added = false |
1121 | ctx等于locks_get_lock_context(inode, fl_type) |
1131 | 如果非fl_flags按位与 trying to lock, just looking 的值且fl_type不等于F_UNLCK或fl_start不等于0或fl_end不等于OFFSET_MAX的值则 |
1138 | percpu_down_read( & file_rwsem) |
1139 | 加自旋锁 |
1147 | 如果非Determine if lock sys_fl blocks lock caller_fl. POSIX specific* checking before calling the locks_conflict().则继续下一循环 |
1152 | 如果非fl_flags按位与A blocking lock 的值则转到:out |
1159 | 加自旋锁 |
1170 | 自旋锁解锁 |
1171 | 转到:out |
1176 | error等于0 |
1177 | 如果fl_flags按位与 trying to lock, just looking 则转到:out |
1224 | 否则 |
1247 | 如果added则 |
1248 | locks_delete_lock_ctx(fl, & dispose) |
1249 | 继续下一循环 |
1261 | locks_copy_lock(new_fl, request) |
1263 | new_fl = NULL |
1265 | locks_delete_lock_ctx(fl, & dispose) |
1266 | added = true |
1280 | error等于0 |
1281 | 如果非added则 |
1283 | 如果fl_flags按位与when unlocking, test for existence 则error等于负ENOENT |
1285 | 转到:out |
1288 | 如果非new_fl则 |
1292 | locks_copy_lock(new_fl, request) |
1293 | locks_move_blocks(new_fl, request) |
1296 | new_fl = NULL |
1298 | 如果right则 |
1304 | new_fl2 = NULL |
1305 | locks_copy_lock(left, right) |
1311 | 如果left则 |
1315 | out : |
1316 | 自旋锁解锁 |
1317 | percpu_up_read( & file_rwsem) |
1325 | locks_dispose_list( & dispose) |
1326 | trace_posix_lock_inode(inode, request, error) |
1328 | 返回:error |
名称 | 描述 |
---|---|
posix_lock_file | 文件加POSIX锁 |
posix_lock_inode_wait | posix_lock_inode_wait - Apply a POSIX-style lock to a file*@inode: inode of file to which lock request should be applied*@fl: The lock to be applied* Apply a POSIX style lock request to an inode. |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |