Lines Matching refs:file_lock

143 static bool lease_breaking(struct file_lock *fl)  in lease_breaking()
148 static int target_leasetype(struct file_lock *fl) in target_leasetype()
243 static void locks_init_lock_heads(struct file_lock *fl) in locks_init_lock_heads()
252 struct file_lock *locks_alloc_lock(void) in locks_alloc_lock()
254 struct file_lock *fl = kmem_cache_zalloc(filelock_cache, GFP_KERNEL); in locks_alloc_lock()
263 void locks_release_private(struct file_lock *fl) in locks_release_private()
282 void locks_free_lock(struct file_lock *fl) in locks_free_lock()
297 struct file_lock *fl; in locks_dispose_list()
300 fl = list_first_entry(dispose, struct file_lock, fl_list); in locks_dispose_list()
306 void locks_init_lock(struct file_lock *fl) in locks_init_lock()
308 memset(fl, 0, sizeof(struct file_lock)); in locks_init_lock()
317 void locks_copy_conflock(struct file_lock *new, struct file_lock *fl) in locks_copy_conflock()
336 void locks_copy_lock(struct file_lock *new, struct file_lock *fl) in locks_copy_lock()
369 static struct file_lock *
372 struct file_lock *fl; in flock_make_lock()
392 static int assign_type(struct file_lock *fl, long type) in assign_type()
406 static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl, in flock64_to_posix_lock()
456 static int flock_to_posix_lock(struct file *filp, struct file_lock *fl, in flock_to_posix_lock()
471 lease_break_callback(struct file_lock *fl) in lease_break_callback()
478 lease_setup(struct file_lock *fl, void **priv) in lease_setup()
503 static int lease_init(struct file *filp, long type, struct file_lock *fl) in lease_init()
521 static struct file_lock *lease_alloc(struct file *filp, long type) in lease_alloc()
523 struct file_lock *fl = locks_alloc_lock(); in lease_alloc()
539 static inline int locks_overlap(struct file_lock *fl1, struct file_lock *fl2) in locks_overlap()
548 static int posix_same_owner(struct file_lock *fl1, struct file_lock *fl2) in posix_same_owner()
557 static void locks_insert_global_locks(struct file_lock *fl) in locks_insert_global_locks()
566 static void locks_delete_global_locks(struct file_lock *fl) in locks_delete_global_locks()
581 posix_owner_key(struct file_lock *fl) in posix_owner_key()
588 static void locks_insert_global_blocked(struct file_lock *waiter) in locks_insert_global_blocked()
595 static void locks_delete_global_blocked(struct file_lock *waiter) in locks_delete_global_blocked()
607 static void __locks_delete_block(struct file_lock *waiter) in __locks_delete_block()
614 static void locks_delete_block(struct file_lock *waiter) in locks_delete_block()
631 static void __locks_insert_block(struct file_lock *blocker, in __locks_insert_block()
632 struct file_lock *waiter) in __locks_insert_block()
642 static void locks_insert_block(struct file_lock *blocker, in locks_insert_block()
643 struct file_lock *waiter) in locks_insert_block()
655 static void locks_wake_up_blocks(struct file_lock *blocker) in locks_wake_up_blocks()
669 struct file_lock *waiter; in locks_wake_up_blocks()
672 struct file_lock, fl_block); in locks_wake_up_blocks()
683 locks_insert_lock_ctx(struct file_lock *fl, struct list_head *before) in locks_insert_lock_ctx()
691 locks_unlink_lock_ctx(struct file_lock *fl) in locks_unlink_lock_ctx()
703 locks_delete_lock_ctx(struct file_lock *fl, struct list_head *dispose) in locks_delete_lock_ctx()
715 static int locks_conflict(struct file_lock *caller_fl, struct file_lock *sys_fl) in locks_conflict()
727 static int posix_locks_conflict(struct file_lock *caller_fl, struct file_lock *sys_fl) in posix_locks_conflict()
745 static int flock_locks_conflict(struct file_lock *caller_fl, struct file_lock *sys_fl) in flock_locks_conflict()
759 posix_test_lock(struct file *filp, struct file_lock *fl) in posix_test_lock()
761 struct file_lock *cfl; in posix_test_lock()
823 static struct file_lock *what_owner_is_waiting_for(struct file_lock *block_fl) in what_owner_is_waiting_for()
825 struct file_lock *fl; in what_owner_is_waiting_for()
835 static int posix_locks_deadlock(struct file_lock *caller_fl, in posix_locks_deadlock()
836 struct file_lock *block_fl) in posix_locks_deadlock()
865 static int flock_lock_inode(struct inode *inode, struct file_lock *request) in flock_lock_inode()
867 struct file_lock *new_fl = NULL; in flock_lock_inode()
868 struct file_lock *fl; in flock_lock_inode()
933 static int __posix_lock_file(struct inode *inode, struct file_lock *request, struct file_lock *conf… in __posix_lock_file()
935 struct file_lock *fl, *tmp; in __posix_lock_file()
936 struct file_lock *new_fl = NULL; in __posix_lock_file()
937 struct file_lock *new_fl2 = NULL; in __posix_lock_file()
938 struct file_lock *left = NULL; in __posix_lock_file()
939 struct file_lock *right = NULL; in __posix_lock_file()
1158 int posix_lock_file(struct file *filp, struct file_lock *fl, in posix_lock_file()
1159 struct file_lock *conflock) in posix_lock_file()
1173 int posix_lock_inode_wait(struct inode *inode, struct file_lock *fl) in posix_lock_inode_wait()
1204 struct file_lock *fl; in locks_mandatory_locked()
1243 struct file_lock fl; in locks_mandatory_area()
1291 static void lease_clear_pending(struct file_lock *fl, int arg) in lease_clear_pending()
1303 int lease_modify(struct file_lock *fl, int arg, struct list_head *dispose) in lease_modify()
1338 struct file_lock *fl, *tmp; in time_out_leases()
1351 static bool leases_conflict(struct file_lock *lease, struct file_lock *breaker) in leases_conflict()
1361 any_leases_conflict(struct inode *inode, struct file_lock *breaker) in any_leases_conflict()
1364 struct file_lock *fl; in any_leases_conflict()
1392 struct file_lock *new_fl, *fl, *tmp; in __break_lease()
1450 fl = list_first_entry(&ctx->flc_lease, struct file_lock, fl_list); in __break_lease()
1498 struct file_lock *fl; in lease_get_mtime()
1504 struct file_lock, fl_list); in lease_get_mtime()
1544 struct file_lock *fl; in fcntl_getlease()
1595 generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void **priv) in generic_add_lease()
1597 struct file_lock *fl, *my_fl = NULL, *lease; in generic_add_lease()
1712 struct file_lock *fl, *victim = NULL; in generic_delete_lease()
1750 int generic_setlease(struct file *filp, long arg, struct file_lock **flp, in generic_setlease()
1800 vfs_setlease(struct file *filp, long arg, struct file_lock **lease, void **priv) in vfs_setlease()
1811 struct file_lock *fl; in do_fcntl_add_lease()
1858 int flock_lock_inode_wait(struct inode *inode, struct file_lock *fl) in flock_lock_inode_wait()
1899 struct file_lock *lock; in SYSCALL_DEFINE2()
1952 int vfs_test_lock(struct file *filp, struct file_lock *fl) in vfs_test_lock()
1961 static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl) in posix_lock_to_flock()
1983 static void posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl) in posix_lock_to_flock64()
1999 struct file_lock file_lock; in fcntl_getlk() local
2010 error = flock_to_posix_lock(filp, &file_lock, &flock); in fcntl_getlk()
2020 file_lock.fl_flags |= FL_OFDLCK; in fcntl_getlk()
2021 file_lock.fl_owner = filp; in fcntl_getlk()
2024 error = vfs_test_lock(filp, &file_lock); in fcntl_getlk()
2028 flock.l_type = file_lock.fl_type; in fcntl_getlk()
2029 if (file_lock.fl_type != F_UNLCK) { in fcntl_getlk()
2030 error = posix_lock_to_flock(&flock, &file_lock); in fcntl_getlk()
2038 locks_release_private(&file_lock); in fcntl_getlk()
2076 int vfs_lock_file(struct file *filp, unsigned int cmd, struct file_lock *fl, struct file_lock *conf) in vfs_lock_file()
2086 struct file_lock *fl) in do_lock_file_wait()
2111 check_fmode_for_setlk(struct file_lock *fl) in check_fmode_for_setlk()
2131 struct file_lock *file_lock = locks_alloc_lock(); in fcntl_setlk() local
2137 if (file_lock == NULL) in fcntl_setlk()
2157 error = flock_to_posix_lock(filp, file_lock, &flock); in fcntl_setlk()
2161 error = check_fmode_for_setlk(file_lock); in fcntl_setlk()
2176 file_lock->fl_flags |= FL_OFDLCK; in fcntl_setlk()
2177 file_lock->fl_owner = filp; in fcntl_setlk()
2185 file_lock->fl_flags |= FL_OFDLCK; in fcntl_setlk()
2186 file_lock->fl_owner = filp; in fcntl_setlk()
2189 file_lock->fl_flags |= FL_SLEEP; in fcntl_setlk()
2192 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk()
2198 if (!error && file_lock->fl_type != F_UNLCK) { in fcntl_setlk()
2204 spin_lock(&current->files->file_lock); in fcntl_setlk()
2206 spin_unlock(&current->files->file_lock); in fcntl_setlk()
2208 file_lock->fl_type = F_UNLCK; in fcntl_setlk()
2209 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk()
2215 locks_free_lock(file_lock); in fcntl_setlk()
2225 struct file_lock file_lock; in fcntl_getlk64() local
2236 error = flock64_to_posix_lock(filp, &file_lock, &flock); in fcntl_getlk64()
2246 file_lock.fl_flags |= FL_OFDLCK; in fcntl_getlk64()
2247 file_lock.fl_owner = filp; in fcntl_getlk64()
2250 error = vfs_test_lock(filp, &file_lock); in fcntl_getlk64()
2254 flock.l_type = file_lock.fl_type; in fcntl_getlk64()
2255 if (file_lock.fl_type != F_UNLCK) in fcntl_getlk64()
2256 posix_lock_to_flock64(&flock, &file_lock); in fcntl_getlk64()
2262 locks_release_private(&file_lock); in fcntl_getlk64()
2273 struct file_lock *file_lock = locks_alloc_lock(); in fcntl_setlk64() local
2279 if (file_lock == NULL) in fcntl_setlk64()
2299 error = flock64_to_posix_lock(filp, file_lock, &flock); in fcntl_setlk64()
2303 error = check_fmode_for_setlk(file_lock); in fcntl_setlk64()
2318 file_lock->fl_flags |= FL_OFDLCK; in fcntl_setlk64()
2319 file_lock->fl_owner = filp; in fcntl_setlk64()
2327 file_lock->fl_flags |= FL_OFDLCK; in fcntl_setlk64()
2328 file_lock->fl_owner = filp; in fcntl_setlk64()
2331 file_lock->fl_flags |= FL_SLEEP; in fcntl_setlk64()
2334 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk64()
2340 if (!error && file_lock->fl_type != F_UNLCK) { in fcntl_setlk64()
2346 spin_lock(&current->files->file_lock); in fcntl_setlk64()
2348 spin_unlock(&current->files->file_lock); in fcntl_setlk64()
2350 file_lock->fl_type = F_UNLCK; in fcntl_setlk64()
2351 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk64()
2357 locks_free_lock(file_lock); in fcntl_setlk64()
2369 struct file_lock lock; in locks_remove_posix()
2402 struct file_lock fl = { in locks_remove_flock()
2431 struct file_lock *fl, *tmp; in locks_remove_lease()
2470 posix_unblock_lock(struct file_lock *waiter) in posix_unblock_lock()
2491 int vfs_cancel_lock(struct file *filp, struct file_lock *fl) in vfs_cancel_lock()
2509 static void lock_get_status(struct seq_file *f, struct file_lock *fl, in lock_get_status()
2588 struct file_lock *fl, *bfl; in locks_show()
2590 fl = hlist_entry(v, struct file_lock, fl_link); in locks_show()
2604 struct file_lock *fl; in __show_fd_locks()
2700 sizeof(struct file_lock), 0, SLAB_PANIC, NULL); in filelock_init()