Lines Matching refs:file_lock
142 static bool lease_breaking(struct file_lock *fl) in lease_breaking()
147 static int target_leasetype(struct file_lock *fl) in target_leasetype()
241 struct file_lock *fl; in locks_dump_ctx_list()
269 struct file_lock *fl; in locks_check_ctx_file_list()
292 static void locks_init_lock_heads(struct file_lock *fl) in locks_init_lock_heads()
301 struct file_lock *locks_alloc_lock(void) in locks_alloc_lock()
303 struct file_lock *fl = kmem_cache_zalloc(filelock_cache, GFP_KERNEL); in locks_alloc_lock()
312 void locks_release_private(struct file_lock *fl) in locks_release_private()
331 void locks_free_lock(struct file_lock *fl) in locks_free_lock()
346 struct file_lock *fl; in locks_dispose_list()
349 fl = list_first_entry(dispose, struct file_lock, fl_list); in locks_dispose_list()
355 void locks_init_lock(struct file_lock *fl) in locks_init_lock()
357 memset(fl, 0, sizeof(struct file_lock)); in locks_init_lock()
366 void locks_copy_conflock(struct file_lock *new, struct file_lock *fl) in locks_copy_conflock()
385 void locks_copy_lock(struct file_lock *new, struct file_lock *fl) in locks_copy_lock()
418 static struct file_lock *
421 struct file_lock *fl; in flock_make_lock()
441 static int assign_type(struct file_lock *fl, long type) in assign_type()
455 static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl, in flock64_to_posix_lock()
505 static int flock_to_posix_lock(struct file *filp, struct file_lock *fl, in flock_to_posix_lock()
520 lease_break_callback(struct file_lock *fl) in lease_break_callback()
527 lease_setup(struct file_lock *fl, void **priv) in lease_setup()
552 static int lease_init(struct file *filp, long type, struct file_lock *fl) in lease_init()
570 static struct file_lock *lease_alloc(struct file *filp, long type) in lease_alloc()
572 struct file_lock *fl = locks_alloc_lock(); in lease_alloc()
588 static inline int locks_overlap(struct file_lock *fl1, struct file_lock *fl2) in locks_overlap()
597 static int posix_same_owner(struct file_lock *fl1, struct file_lock *fl2) in posix_same_owner()
606 static void locks_insert_global_locks(struct file_lock *fl) in locks_insert_global_locks()
619 static void locks_delete_global_locks(struct file_lock *fl) in locks_delete_global_locks()
640 posix_owner_key(struct file_lock *fl) in posix_owner_key()
647 static void locks_insert_global_blocked(struct file_lock *waiter) in locks_insert_global_blocked()
654 static void locks_delete_global_blocked(struct file_lock *waiter) in locks_delete_global_blocked()
666 static void __locks_delete_block(struct file_lock *waiter) in __locks_delete_block()
673 static void locks_delete_block(struct file_lock *waiter) in locks_delete_block()
690 static void __locks_insert_block(struct file_lock *blocker, in __locks_insert_block()
691 struct file_lock *waiter) in __locks_insert_block()
701 static void locks_insert_block(struct file_lock *blocker, in locks_insert_block()
702 struct file_lock *waiter) in locks_insert_block()
714 static void locks_wake_up_blocks(struct file_lock *blocker) in locks_wake_up_blocks()
728 struct file_lock *waiter; in locks_wake_up_blocks()
731 struct file_lock, fl_block); in locks_wake_up_blocks()
742 locks_insert_lock_ctx(struct file_lock *fl, struct list_head *before) in locks_insert_lock_ctx()
749 locks_unlink_lock_ctx(struct file_lock *fl) in locks_unlink_lock_ctx()
757 locks_delete_lock_ctx(struct file_lock *fl, struct list_head *dispose) in locks_delete_lock_ctx()
769 static int locks_conflict(struct file_lock *caller_fl, struct file_lock *sys_fl) in locks_conflict()
781 static int posix_locks_conflict(struct file_lock *caller_fl, struct file_lock *sys_fl) in posix_locks_conflict()
799 static int flock_locks_conflict(struct file_lock *caller_fl, struct file_lock *sys_fl) in flock_locks_conflict()
813 posix_test_lock(struct file *filp, struct file_lock *fl) in posix_test_lock()
815 struct file_lock *cfl; in posix_test_lock()
875 static struct file_lock *what_owner_is_waiting_for(struct file_lock *block_fl) in what_owner_is_waiting_for()
877 struct file_lock *fl; in what_owner_is_waiting_for()
887 static int posix_locks_deadlock(struct file_lock *caller_fl, in posix_locks_deadlock()
888 struct file_lock *block_fl) in posix_locks_deadlock()
917 static int flock_lock_inode(struct inode *inode, struct file_lock *request) in flock_lock_inode()
919 struct file_lock *new_fl = NULL; in flock_lock_inode()
920 struct file_lock *fl; in flock_lock_inode()
988 static int posix_lock_inode(struct inode *inode, struct file_lock *request, in posix_lock_inode()
989 struct file_lock *conflock) in posix_lock_inode()
991 struct file_lock *fl, *tmp; in posix_lock_inode()
992 struct file_lock *new_fl = NULL; in posix_lock_inode()
993 struct file_lock *new_fl2 = NULL; in posix_lock_inode()
994 struct file_lock *left = NULL; in posix_lock_inode()
995 struct file_lock *right = NULL; in posix_lock_inode()
1218 int posix_lock_file(struct file *filp, struct file_lock *fl, in posix_lock_file()
1219 struct file_lock *conflock) in posix_lock_file()
1232 static int posix_lock_inode_wait(struct inode *inode, struct file_lock *fl) in posix_lock_inode_wait()
1263 struct file_lock *fl; in locks_mandatory_locked()
1298 struct file_lock fl; in locks_mandatory_area()
1347 static void lease_clear_pending(struct file_lock *fl, int arg) in lease_clear_pending()
1359 int lease_modify(struct file_lock *fl, int arg, struct list_head *dispose) in lease_modify()
1394 struct file_lock *fl, *tmp; in time_out_leases()
1407 static bool leases_conflict(struct file_lock *lease, struct file_lock *breaker) in leases_conflict()
1417 any_leases_conflict(struct inode *inode, struct file_lock *breaker) in any_leases_conflict()
1420 struct file_lock *fl; in any_leases_conflict()
1448 struct file_lock *new_fl, *fl, *tmp; in __break_lease()
1508 fl = list_first_entry(&ctx->flc_lease, struct file_lock, fl_list); in __break_lease()
1561 struct file_lock *fl; in lease_get_mtime()
1567 struct file_lock, fl_list); in lease_get_mtime()
1604 struct file_lock *fl; in fcntl_getlease()
1660 generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void **priv) in generic_add_lease()
1662 struct file_lock *fl, *my_fl = NULL, *lease; in generic_add_lease()
1779 struct file_lock *fl, *victim = NULL; in generic_delete_lease()
1819 int generic_setlease(struct file *filp, long arg, struct file_lock **flp, in generic_setlease()
1868 vfs_setlease(struct file *filp, long arg, struct file_lock **lease, void **priv) in vfs_setlease()
1879 struct file_lock *fl; in do_fcntl_add_lease()
1926 static int flock_lock_inode_wait(struct inode *inode, struct file_lock *fl) in flock_lock_inode_wait()
1951 int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl) in locks_lock_inode_wait()
1988 struct file_lock *lock; in SYSCALL_DEFINE2()
2041 int vfs_test_lock(struct file *filp, struct file_lock *fl) in vfs_test_lock()
2057 static pid_t locks_translate_pid(struct file_lock *fl, struct pid_namespace *ns) in locks_translate_pid()
2081 static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl) in posix_lock_to_flock()
2103 static void posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl) in posix_lock_to_flock64()
2119 struct file_lock *fl; in fcntl_getlk()
2191 int vfs_lock_file(struct file *filp, unsigned int cmd, struct file_lock *fl, struct file_lock *conf) in vfs_lock_file()
2201 struct file_lock *fl) in do_lock_file_wait()
2226 check_fmode_for_setlk(struct file_lock *fl) in check_fmode_for_setlk()
2246 struct file_lock *file_lock = locks_alloc_lock(); in fcntl_setlk() local
2251 if (file_lock == NULL) in fcntl_setlk()
2262 error = flock_to_posix_lock(filp, file_lock, flock); in fcntl_setlk()
2266 error = check_fmode_for_setlk(file_lock); in fcntl_setlk()
2281 file_lock->fl_flags |= FL_OFDLCK; in fcntl_setlk()
2282 file_lock->fl_owner = filp; in fcntl_setlk()
2290 file_lock->fl_flags |= FL_OFDLCK; in fcntl_setlk()
2291 file_lock->fl_owner = filp; in fcntl_setlk()
2294 file_lock->fl_flags |= FL_SLEEP; in fcntl_setlk()
2297 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk()
2304 if (!error && file_lock->fl_type != F_UNLCK && in fcntl_setlk()
2305 !(file_lock->fl_flags & FL_OFDLCK)) { in fcntl_setlk()
2311 spin_lock(¤t->files->file_lock); in fcntl_setlk()
2313 spin_unlock(¤t->files->file_lock); in fcntl_setlk()
2315 file_lock->fl_type = F_UNLCK; in fcntl_setlk()
2316 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk()
2322 trace_fcntl_setlk(inode, file_lock, error); in fcntl_setlk()
2323 locks_free_lock(file_lock); in fcntl_setlk()
2333 struct file_lock *fl; in fcntl_getlk64()
2377 struct file_lock *file_lock = locks_alloc_lock(); in fcntl_setlk64() local
2382 if (file_lock == NULL) in fcntl_setlk64()
2393 error = flock64_to_posix_lock(filp, file_lock, flock); in fcntl_setlk64()
2397 error = check_fmode_for_setlk(file_lock); in fcntl_setlk64()
2412 file_lock->fl_flags |= FL_OFDLCK; in fcntl_setlk64()
2413 file_lock->fl_owner = filp; in fcntl_setlk64()
2421 file_lock->fl_flags |= FL_OFDLCK; in fcntl_setlk64()
2422 file_lock->fl_owner = filp; in fcntl_setlk64()
2425 file_lock->fl_flags |= FL_SLEEP; in fcntl_setlk64()
2428 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk64()
2435 if (!error && file_lock->fl_type != F_UNLCK && in fcntl_setlk64()
2436 !(file_lock->fl_flags & FL_OFDLCK)) { in fcntl_setlk64()
2442 spin_lock(¤t->files->file_lock); in fcntl_setlk64()
2444 spin_unlock(¤t->files->file_lock); in fcntl_setlk64()
2446 file_lock->fl_type = F_UNLCK; in fcntl_setlk64()
2447 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk64()
2453 locks_free_lock(file_lock); in fcntl_setlk64()
2467 struct file_lock lock; in locks_remove_posix()
2502 struct file_lock fl = { in locks_remove_flock()
2528 struct file_lock *fl, *tmp; in locks_remove_lease()
2579 posix_unblock_lock(struct file_lock *waiter) in posix_unblock_lock()
2600 int vfs_cancel_lock(struct file *filp, struct file_lock *fl) in vfs_cancel_lock()
2618 static void lock_get_status(struct seq_file *f, struct file_lock *fl, in lock_get_status()
2700 struct file_lock *fl, *bfl; in locks_show()
2703 fl = hlist_entry(v, struct file_lock, fl_link); in locks_show()
2720 struct file_lock *fl; in __show_fd_locks()
2804 sizeof(struct file_lock), 0, SLAB_PANIC, NULL); in filelock_init()