Lines Matching refs:file_lock

72 static struct file_lock *file_lock(struct file_lock_core *flc)  in file_lock()  function
74 return container_of(flc, struct file_lock, c); in file_lock()
273 struct file_lock *locks_alloc_lock(void) in locks_alloc_lock()
275 struct file_lock *fl = kmem_cache_zalloc(filelock_cache, GFP_KERNEL); in locks_alloc_lock()
296 void locks_release_private(struct file_lock *fl) in locks_release_private()
350 void locks_free_lock(struct file_lock *fl) in locks_free_lock()
375 locks_free_lock(file_lock(flc)); in locks_dispose_list()
379 void locks_init_lock(struct file_lock *fl) in locks_init_lock()
381 memset(fl, 0, sizeof(struct file_lock)); in locks_init_lock()
396 void locks_copy_conflock(struct file_lock *new, struct file_lock *fl) in locks_copy_conflock()
415 void locks_copy_lock(struct file_lock *new, struct file_lock *fl) in locks_copy_lock()
432 static void locks_move_blocks(struct file_lock *new, struct file_lock *fl) in locks_move_blocks()
434 struct file_lock *f; in locks_move_blocks()
465 static void flock_make_lock(struct file *filp, struct file_lock *fl, int type) in flock_make_lock()
491 static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl, in flock64_to_posix_lock()
541 static int flock_to_posix_lock(struct file *filp, struct file_lock *fl, in flock_to_posix_lock()
621 static inline int locks_overlap(struct file_lock *fl1, struct file_lock *fl2) in locks_overlap()
704 struct file_lock *fl; in __locks_wake_up_blocks()
709 fl = file_lock(waiter); in __locks_wake_up_blocks()
776 int locks_delete_block(struct file_lock *waiter) in locks_delete_block()
880 locks_free_lock(file_lock(fl)); in locks_delete_lock_ctx()
902 struct file_lock *caller_fl = file_lock(caller_flc); in posix_locks_conflict()
903 struct file_lock *sys_fl = file_lock(sys_flc); in posix_locks_conflict()
921 static bool posix_test_locks_conflict(struct file_lock *caller_fl, in posix_test_locks_conflict()
922 struct file_lock *sys_fl) in posix_test_locks_conflict()
952 posix_test_lock(struct file *filp, struct file_lock *fl) in posix_test_lock()
954 struct file_lock *cfl; in posix_test_lock()
1042 static bool posix_locks_deadlock(struct file_lock *caller_fl, in posix_locks_deadlock()
1043 struct file_lock *block_fl) in posix_locks_deadlock()
1074 static int flock_lock_inode(struct inode *inode, struct file_lock *request) in flock_lock_inode()
1076 struct file_lock *new_fl = NULL; in flock_lock_inode()
1077 struct file_lock *fl; in flock_lock_inode()
1146 static int posix_lock_inode(struct inode *inode, struct file_lock *request, in posix_lock_inode()
1147 struct file_lock *conflock) in posix_lock_inode()
1149 struct file_lock *fl, *tmp; in posix_lock_inode()
1150 struct file_lock *new_fl = NULL; in posix_lock_inode()
1151 struct file_lock *new_fl2 = NULL; in posix_lock_inode()
1152 struct file_lock *left = NULL; in posix_lock_inode()
1153 struct file_lock *right = NULL; in posix_lock_inode()
1399 int posix_lock_file(struct file *filp, struct file_lock *fl, in posix_lock_file()
1400 struct file_lock *conflock) in posix_lock_file()
1413 static int posix_lock_inode_wait(struct inode *inode, struct file_lock *fl) in posix_lock_inode_wait()
2079 static int flock_lock_inode_wait(struct inode *inode, struct file_lock *fl) in flock_lock_inode_wait()
2103 int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl) in locks_lock_inode_wait()
2138 struct file_lock fl; in SYSCALL_DEFINE2()
2198 int vfs_test_lock(struct file *filp, struct file_lock *fl) in vfs_test_lock()
2242 static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl) in posix_lock_to_flock()
2264 static void posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl) in posix_lock_to_flock64()
2280 struct file_lock *fl; in fcntl_getlk()
2354 int vfs_lock_file(struct file *filp, unsigned int cmd, struct file_lock *fl, struct file_lock *conf) in vfs_lock_file()
2365 struct file_lock *fl) in do_lock_file_wait()
2389 check_fmode_for_setlk(struct file_lock *fl) in check_fmode_for_setlk()
2409 struct file_lock *file_lock = locks_alloc_lock(); in fcntl_setlk() local
2414 if (file_lock == NULL) in fcntl_setlk()
2417 error = flock_to_posix_lock(filp, file_lock, flock); in fcntl_setlk()
2421 error = check_fmode_for_setlk(file_lock); in fcntl_setlk()
2436 file_lock->c.flc_flags |= FL_OFDLCK; in fcntl_setlk()
2437 file_lock->c.flc_owner = filp; in fcntl_setlk()
2445 file_lock->c.flc_flags |= FL_OFDLCK; in fcntl_setlk()
2446 file_lock->c.flc_owner = filp; in fcntl_setlk()
2449 file_lock->c.flc_flags |= FL_SLEEP; in fcntl_setlk()
2452 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk()
2460 if (!error && file_lock->c.flc_type != F_UNLCK && in fcntl_setlk()
2461 !(file_lock->c.flc_flags & FL_OFDLCK)) { in fcntl_setlk()
2468 spin_lock(&files->file_lock); in fcntl_setlk()
2470 spin_unlock(&files->file_lock); in fcntl_setlk()
2477 trace_fcntl_setlk(inode, file_lock, error); in fcntl_setlk()
2478 locks_free_lock(file_lock); in fcntl_setlk()
2488 struct file_lock *fl; in fcntl_getlk64()
2532 struct file_lock *file_lock = locks_alloc_lock(); in fcntl_setlk64() local
2536 if (file_lock == NULL) in fcntl_setlk64()
2539 error = flock64_to_posix_lock(filp, file_lock, flock); in fcntl_setlk64()
2543 error = check_fmode_for_setlk(file_lock); in fcntl_setlk64()
2558 file_lock->c.flc_flags |= FL_OFDLCK; in fcntl_setlk64()
2559 file_lock->c.flc_owner = filp; in fcntl_setlk64()
2567 file_lock->c.flc_flags |= FL_OFDLCK; in fcntl_setlk64()
2568 file_lock->c.flc_owner = filp; in fcntl_setlk64()
2571 file_lock->c.flc_flags |= FL_SLEEP; in fcntl_setlk64()
2574 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk64()
2582 if (!error && file_lock->c.flc_type != F_UNLCK && in fcntl_setlk64()
2583 !(file_lock->c.flc_flags & FL_OFDLCK)) { in fcntl_setlk64()
2590 spin_lock(&files->file_lock); in fcntl_setlk64()
2592 spin_unlock(&files->file_lock); in fcntl_setlk64()
2599 locks_free_lock(file_lock); in fcntl_setlk64()
2613 struct file_lock lock; in locks_remove_posix()
2648 struct file_lock fl; in locks_remove_flock()
2721 int vfs_cancel_lock(struct file *filp, struct file_lock *fl) in vfs_cancel_lock()
2769 struct file_lock *fl = file_lock(flc); in lock_get_status()
2989 sizeof(struct file_lock), 0, SLAB_PANIC, NULL); in filelock_init()