Lines Matching refs:file_lock
78 static bool lease_breaking(struct file_lock *fl) in lease_breaking()
83 static int target_leasetype(struct file_lock *fl) in target_leasetype()
207 struct file_lock *fl; in locks_dump_ctx_list()
235 struct file_lock *fl; in locks_check_ctx_file_list()
258 static void locks_init_lock_heads(struct file_lock *fl) in locks_init_lock_heads()
268 struct file_lock *locks_alloc_lock(void) in locks_alloc_lock()
270 struct file_lock *fl = kmem_cache_zalloc(filelock_cache, GFP_KERNEL); in locks_alloc_lock()
279 void locks_release_private(struct file_lock *fl) in locks_release_private()
315 struct file_lock *fl; in locks_owner_has_blockers()
332 void locks_free_lock(struct file_lock *fl) in locks_free_lock()
342 struct file_lock *fl; in locks_dispose_list()
345 fl = list_first_entry(dispose, struct file_lock, fl_list); in locks_dispose_list()
351 void locks_init_lock(struct file_lock *fl) in locks_init_lock()
353 memset(fl, 0, sizeof(struct file_lock)); in locks_init_lock()
361 void locks_copy_conflock(struct file_lock *new, struct file_lock *fl) in locks_copy_conflock()
380 void locks_copy_lock(struct file_lock *new, struct file_lock *fl) in locks_copy_lock()
397 static void locks_move_blocks(struct file_lock *new, struct file_lock *fl) in locks_move_blocks()
399 struct file_lock *f; in locks_move_blocks()
428 static struct file_lock *
429 flock_make_lock(struct file *filp, unsigned int cmd, struct file_lock *fl) in flock_make_lock()
454 static int assign_type(struct file_lock *fl, long type) in assign_type()
468 static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl, in flock64_to_posix_lock()
518 static int flock_to_posix_lock(struct file *filp, struct file_lock *fl, in flock_to_posix_lock()
533 lease_break_callback(struct file_lock *fl) in lease_break_callback()
540 lease_setup(struct file_lock *fl, void **priv) in lease_setup()
565 static int lease_init(struct file *filp, long type, struct file_lock *fl) in lease_init()
583 static struct file_lock *lease_alloc(struct file *filp, long type) in lease_alloc()
585 struct file_lock *fl = locks_alloc_lock(); in lease_alloc()
601 static inline int locks_overlap(struct file_lock *fl1, struct file_lock *fl2) in locks_overlap()
610 static int posix_same_owner(struct file_lock *fl1, struct file_lock *fl2) in posix_same_owner()
616 static void locks_insert_global_locks(struct file_lock *fl) in locks_insert_global_locks()
629 static void locks_delete_global_locks(struct file_lock *fl) in locks_delete_global_locks()
650 posix_owner_key(struct file_lock *fl) in posix_owner_key()
655 static void locks_insert_global_blocked(struct file_lock *waiter) in locks_insert_global_blocked()
662 static void locks_delete_global_blocked(struct file_lock *waiter) in locks_delete_global_blocked()
674 static void __locks_delete_block(struct file_lock *waiter) in __locks_delete_block()
680 static void __locks_wake_up_blocks(struct file_lock *blocker) in __locks_wake_up_blocks()
683 struct file_lock *waiter; in __locks_wake_up_blocks()
686 struct file_lock, fl_blocked_member); in __locks_wake_up_blocks()
708 int locks_delete_block(struct file_lock *waiter) in locks_delete_block()
768 static void __locks_insert_block(struct file_lock *blocker, in __locks_insert_block() argument
769 struct file_lock *waiter, in __locks_insert_block()
770 bool conflict(struct file_lock *, in __locks_insert_block() argument
771 struct file_lock *)) in __locks_insert_block()
773 struct file_lock *fl; in __locks_insert_block()
795 static void locks_insert_block(struct file_lock *blocker, in locks_insert_block() argument
796 struct file_lock *waiter, in locks_insert_block()
797 bool conflict(struct file_lock *, in locks_insert_block() argument
798 struct file_lock *)) in locks_insert_block()
810 static void locks_wake_up_blocks(struct file_lock *blocker) in locks_wake_up_blocks()
828 locks_insert_lock_ctx(struct file_lock *fl, struct list_head *before) in locks_insert_lock_ctx()
835 locks_unlink_lock_ctx(struct file_lock *fl) in locks_unlink_lock_ctx()
843 locks_delete_lock_ctx(struct file_lock *fl, struct list_head *dispose) in locks_delete_lock_ctx()
855 static bool locks_conflict(struct file_lock *caller_fl, in locks_conflict()
856 struct file_lock *sys_fl) in locks_conflict()
868 static bool posix_locks_conflict(struct file_lock *caller_fl, in posix_locks_conflict()
869 struct file_lock *sys_fl) in posix_locks_conflict()
887 static bool flock_locks_conflict(struct file_lock *caller_fl, in flock_locks_conflict()
888 struct file_lock *sys_fl) in flock_locks_conflict()
900 posix_test_lock(struct file *filp, struct file_lock *fl) in posix_test_lock()
902 struct file_lock *cfl; in posix_test_lock()
975 static struct file_lock *what_owner_is_waiting_for(struct file_lock *block_fl) in what_owner_is_waiting_for()
977 struct file_lock *fl; in what_owner_is_waiting_for()
990 static int posix_locks_deadlock(struct file_lock *caller_fl, in posix_locks_deadlock()
991 struct file_lock *block_fl) in posix_locks_deadlock()
1020 static int flock_lock_inode(struct inode *inode, struct file_lock *request) in flock_lock_inode()
1022 struct file_lock *new_fl = NULL; in flock_lock_inode()
1023 struct file_lock *fl; in flock_lock_inode()
1092 static int posix_lock_inode(struct inode *inode, struct file_lock *request, in posix_lock_inode()
1093 struct file_lock *conflock) in posix_lock_inode()
1095 struct file_lock *fl, *tmp; in posix_lock_inode()
1096 struct file_lock *new_fl = NULL; in posix_lock_inode()
1097 struct file_lock *new_fl2 = NULL; in posix_lock_inode()
1098 struct file_lock *left = NULL; in posix_lock_inode()
1099 struct file_lock *right = NULL; in posix_lock_inode()
1344 int posix_lock_file(struct file *filp, struct file_lock *fl, in posix_lock_file()
1345 struct file_lock *conflock) in posix_lock_file()
1358 static int posix_lock_inode_wait(struct inode *inode, struct file_lock *fl) in posix_lock_inode_wait()
1375 static void lease_clear_pending(struct file_lock *fl, int arg) in lease_clear_pending()
1387 int lease_modify(struct file_lock *fl, int arg, struct list_head *dispose) in lease_modify()
1422 struct file_lock *fl, *tmp; in time_out_leases()
1435 static bool leases_conflict(struct file_lock *lease, struct file_lock *breaker) in leases_conflict()
1458 any_leases_conflict(struct inode *inode, struct file_lock *breaker) in any_leases_conflict()
1461 struct file_lock *fl; in any_leases_conflict()
1489 struct file_lock *new_fl, *fl, *tmp; in __break_lease()
1549 fl = list_first_entry(&ctx->flc_lease, struct file_lock, fl_list); in __break_lease()
1603 struct file_lock *fl; in lease_get_mtime()
1609 struct file_lock, fl_list); in lease_get_mtime()
1645 struct file_lock *fl; in fcntl_getlease()
1717 generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void **priv) in generic_add_lease()
1719 struct file_lock *fl, *my_fl = NULL, *lease; in generic_add_lease()
1835 struct file_lock *fl, *victim = NULL; in generic_delete_lease()
1875 int generic_setlease(struct file *filp, long arg, struct file_lock **flp, in generic_setlease()
1922 setlease_notifier(long arg, struct file_lock *lease) in setlease_notifier()
1947 setlease_notifier(long arg, struct file_lock *lease) in setlease_notifier()
1982 vfs_setlease(struct file *filp, long arg, struct file_lock **lease, void **priv) in vfs_setlease()
1995 struct file_lock *fl; in do_fcntl_add_lease()
2042 static int flock_lock_inode_wait(struct inode *inode, struct file_lock *fl) in flock_lock_inode_wait()
2066 int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl) in locks_lock_inode_wait()
2101 struct file_lock *lock; in SYSCALL_DEFINE2()
2167 int vfs_test_lock(struct file *filp, struct file_lock *fl) in vfs_test_lock()
2183 static pid_t locks_translate_pid(struct file_lock *fl, struct pid_namespace *ns) in locks_translate_pid()
2207 static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl) in posix_lock_to_flock()
2229 static void posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl) in posix_lock_to_flock64()
2245 struct file_lock *fl; in fcntl_getlk()
2316 int vfs_lock_file(struct file *filp, unsigned int cmd, struct file_lock *fl, struct file_lock *conf) in vfs_lock_file()
2326 struct file_lock *fl) in do_lock_file_wait()
2350 check_fmode_for_setlk(struct file_lock *fl) in check_fmode_for_setlk()
2370 struct file_lock *file_lock = locks_alloc_lock(); in fcntl_setlk() local
2375 if (file_lock == NULL) in fcntl_setlk()
2378 error = flock_to_posix_lock(filp, file_lock, flock); in fcntl_setlk()
2382 error = check_fmode_for_setlk(file_lock); in fcntl_setlk()
2397 file_lock->fl_flags |= FL_OFDLCK; in fcntl_setlk()
2398 file_lock->fl_owner = filp; in fcntl_setlk()
2406 file_lock->fl_flags |= FL_OFDLCK; in fcntl_setlk()
2407 file_lock->fl_owner = filp; in fcntl_setlk()
2410 file_lock->fl_flags |= FL_SLEEP; in fcntl_setlk()
2413 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk()
2420 if (!error && file_lock->fl_type != F_UNLCK && in fcntl_setlk()
2421 !(file_lock->fl_flags & FL_OFDLCK)) { in fcntl_setlk()
2428 spin_lock(&files->file_lock); in fcntl_setlk()
2430 spin_unlock(&files->file_lock); in fcntl_setlk()
2432 file_lock->fl_type = F_UNLCK; in fcntl_setlk()
2433 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk()
2439 trace_fcntl_setlk(inode, file_lock, error); in fcntl_setlk()
2440 locks_free_lock(file_lock); in fcntl_setlk()
2450 struct file_lock *fl; in fcntl_getlk64()
2494 struct file_lock *file_lock = locks_alloc_lock(); in fcntl_setlk64() local
2498 if (file_lock == NULL) in fcntl_setlk64()
2501 error = flock64_to_posix_lock(filp, file_lock, flock); in fcntl_setlk64()
2505 error = check_fmode_for_setlk(file_lock); in fcntl_setlk64()
2520 file_lock->fl_flags |= FL_OFDLCK; in fcntl_setlk64()
2521 file_lock->fl_owner = filp; in fcntl_setlk64()
2529 file_lock->fl_flags |= FL_OFDLCK; in fcntl_setlk64()
2530 file_lock->fl_owner = filp; in fcntl_setlk64()
2533 file_lock->fl_flags |= FL_SLEEP; in fcntl_setlk64()
2536 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk64()
2543 if (!error && file_lock->fl_type != F_UNLCK && in fcntl_setlk64()
2544 !(file_lock->fl_flags & FL_OFDLCK)) { in fcntl_setlk64()
2551 spin_lock(&files->file_lock); in fcntl_setlk64()
2553 spin_unlock(&files->file_lock); in fcntl_setlk64()
2555 file_lock->fl_type = F_UNLCK; in fcntl_setlk64()
2556 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk64()
2562 locks_free_lock(file_lock); in fcntl_setlk64()
2576 struct file_lock lock; in locks_remove_posix()
2611 struct file_lock fl; in locks_remove_flock()
2633 struct file_lock *fl, *tmp; in locks_remove_lease()
2684 int vfs_cancel_lock(struct file *filp, struct file_lock *fl) in vfs_cancel_lock()
2701 static void lock_get_status(struct seq_file *f, struct file_lock *fl, in lock_get_status()
2773 static struct file_lock *get_next_blocked_member(struct file_lock *node) in get_next_blocked_member()
2775 struct file_lock *tmp; in get_next_blocked_member()
2794 struct file_lock *cur, *tmp; in locks_show()
2798 cur = hlist_entry(v, struct file_lock, fl_link); in locks_show()
2817 struct file_lock, fl_blocked_member); in locks_show()
2839 struct file_lock *fl; in __show_fd_locks()
2923 sizeof(struct file_lock), 0, SLAB_PANIC, NULL); in filelock_init()