| Function report | 
| Source Code: fs\locks.c | Create Date:2022-07-28 20:25:29 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:posix_lock_inode
Proto:static int posix_lock_inode(struct inode *inode, struct file_lock *request, struct file_lock *conflock)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| 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 | If Not (fl_flags & trying to lock, just looking ) && ( fl_type != F_UNLCK || fl_start != 0 || fl_end != OFFSET_MAX ) Then | 
| 1138 | percpu_down_read( & file_rwsem) | 
| 1147 | If Not Determine if lock sys_fl blocks lock caller_fl. POSIX specific* checking before calling the locks_conflict(). Then Continue | 
| 1152 | If Not (fl_flags & A blocking lock ) Then Go to out | 
| 1171 | Go to out | 
| 1176 | error = 0 | 
| 1177 | If fl_flags & trying to lock, just looking Then Go to out | 
| 1182 | If Check whether two locks have the same owner. Then Break | 
| 1188 | If Not Check whether two locks have the same owner. Then Break | 
| 1224 | Else | 
| 1247 | If added Then | 
| 1248 | locks_delete_lock_ctx(fl, & dispose) | 
| 1249 | Continue | 
| 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 | If Not added Then | 
| 1283 | If fl_flags & when unlocking, test for existence Then error = -ENOENT | 
| 1285 | Go to out | 
| 1288 | If Not new_fl Then | 
| 1292 | locks_copy_lock(new_fl, request) | 
| 1293 | locks_move_blocks(new_fl, request) | 
| 1296 | new_fl = NULL | 
| 1298 | If right Then | 
| 1304 | new_fl2 = NULL | 
| 1305 | locks_copy_lock(left, right) | 
| 1311 | If left Then | 
| 1315 | out : | 
| 1316 | spin_unlock( & flc_lock) | 
| 1317 | percpu_up_read( & file_rwsem) | 
| 1321 | If new_fl Then Free a lock which is not in use. | 
| 1323 | If new_fl2 Then Free a lock which is not in use. | 
| 1325 | locks_dispose_list( & dispose) | 
| 1326 | trace_posix_lock_inode(inode, request, error) | 
| 1328 | Return error | 
| Name | Describe | 
|---|---|
| posix_lock_file | Apply a POSIX-style lock to a file | 
| 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. | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |