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()
247 static void locks_init_lock_heads(struct file_lock *fl) in locks_init_lock_heads()
256 struct file_lock *locks_alloc_lock(void) in locks_alloc_lock()
258 struct file_lock *fl = kmem_cache_zalloc(filelock_cache, GFP_KERNEL); in locks_alloc_lock()
267 void locks_release_private(struct file_lock *fl) in locks_release_private()
286 void locks_free_lock(struct file_lock *fl) in locks_free_lock()
301 struct file_lock *fl; in locks_dispose_list()
304 fl = list_first_entry(dispose, struct file_lock, fl_list); in locks_dispose_list()
310 void locks_init_lock(struct file_lock *fl) in locks_init_lock()
312 memset(fl, 0, sizeof(struct file_lock)); in locks_init_lock()
321 void locks_copy_conflock(struct file_lock *new, struct file_lock *fl) in locks_copy_conflock()
340 void locks_copy_lock(struct file_lock *new, struct file_lock *fl) in locks_copy_lock()
373 static struct file_lock *
376 struct file_lock *fl; in flock_make_lock()
396 static int assign_type(struct file_lock *fl, long type) in assign_type()
410 static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl, in flock64_to_posix_lock()
460 static int flock_to_posix_lock(struct file *filp, struct file_lock *fl, in flock_to_posix_lock()
475 lease_break_callback(struct file_lock *fl) in lease_break_callback()
482 lease_setup(struct file_lock *fl, void **priv) in lease_setup()
507 static int lease_init(struct file *filp, long type, struct file_lock *fl) in lease_init()
525 static struct file_lock *lease_alloc(struct file *filp, long type) in lease_alloc()
527 struct file_lock *fl = locks_alloc_lock(); in lease_alloc()
543 static inline int locks_overlap(struct file_lock *fl1, struct file_lock *fl2) in locks_overlap()
552 static int posix_same_owner(struct file_lock *fl1, struct file_lock *fl2) in posix_same_owner()
561 static void locks_insert_global_locks(struct file_lock *fl) in locks_insert_global_locks()
570 static void locks_delete_global_locks(struct file_lock *fl) in locks_delete_global_locks()
585 posix_owner_key(struct file_lock *fl) in posix_owner_key()
592 static void locks_insert_global_blocked(struct file_lock *waiter) in locks_insert_global_blocked()
599 static void locks_delete_global_blocked(struct file_lock *waiter) in locks_delete_global_blocked()
611 static void __locks_delete_block(struct file_lock *waiter) in __locks_delete_block()
618 static void locks_delete_block(struct file_lock *waiter) in locks_delete_block()
635 static void __locks_insert_block(struct file_lock *blocker, in __locks_insert_block()
636 struct file_lock *waiter) in __locks_insert_block()
646 static void locks_insert_block(struct file_lock *blocker, in locks_insert_block()
647 struct file_lock *waiter) in locks_insert_block()
659 static void locks_wake_up_blocks(struct file_lock *blocker) in locks_wake_up_blocks()
673 struct file_lock *waiter; in locks_wake_up_blocks()
676 struct file_lock, fl_block); in locks_wake_up_blocks()
687 locks_insert_lock_ctx(struct file_lock *fl, struct list_head *before) in locks_insert_lock_ctx()
695 locks_unlink_lock_ctx(struct file_lock *fl) in locks_unlink_lock_ctx()
707 locks_delete_lock_ctx(struct file_lock *fl, struct list_head *dispose) in locks_delete_lock_ctx()
719 static int locks_conflict(struct file_lock *caller_fl, struct file_lock *sys_fl) in locks_conflict()
731 static int posix_locks_conflict(struct file_lock *caller_fl, struct file_lock *sys_fl) in posix_locks_conflict()
749 static int flock_locks_conflict(struct file_lock *caller_fl, struct file_lock *sys_fl) in flock_locks_conflict()
763 posix_test_lock(struct file *filp, struct file_lock *fl) in posix_test_lock()
765 struct file_lock *cfl; in posix_test_lock()
827 static struct file_lock *what_owner_is_waiting_for(struct file_lock *block_fl) in what_owner_is_waiting_for()
829 struct file_lock *fl; in what_owner_is_waiting_for()
839 static int posix_locks_deadlock(struct file_lock *caller_fl, in posix_locks_deadlock()
840 struct file_lock *block_fl) in posix_locks_deadlock()
869 static int flock_lock_inode(struct inode *inode, struct file_lock *request) in flock_lock_inode()
871 struct file_lock *new_fl = NULL; in flock_lock_inode()
872 struct file_lock *fl; in flock_lock_inode()
937 static int __posix_lock_file(struct inode *inode, struct file_lock *request, struct file_lock *conf… in __posix_lock_file()
939 struct file_lock *fl, *tmp; in __posix_lock_file()
940 struct file_lock *new_fl = NULL; in __posix_lock_file()
941 struct file_lock *new_fl2 = NULL; in __posix_lock_file()
942 struct file_lock *left = NULL; in __posix_lock_file()
943 struct file_lock *right = NULL; in __posix_lock_file()
1162 int posix_lock_file(struct file *filp, struct file_lock *fl, in posix_lock_file()
1163 struct file_lock *conflock) in posix_lock_file()
1176 static int posix_lock_inode_wait(struct inode *inode, struct file_lock *fl) in posix_lock_inode_wait()
1206 struct file_lock *fl; in locks_mandatory_locked()
1245 struct file_lock fl; in locks_mandatory_area()
1293 static void lease_clear_pending(struct file_lock *fl, int arg) in lease_clear_pending()
1305 int lease_modify(struct file_lock *fl, int arg, struct list_head *dispose) in lease_modify()
1340 struct file_lock *fl, *tmp; in time_out_leases()
1353 static bool leases_conflict(struct file_lock *lease, struct file_lock *breaker) in leases_conflict()
1363 any_leases_conflict(struct inode *inode, struct file_lock *breaker) in any_leases_conflict()
1366 struct file_lock *fl; in any_leases_conflict()
1394 struct file_lock *new_fl, *fl, *tmp; in __break_lease()
1453 fl = list_first_entry(&ctx->flc_lease, struct file_lock, fl_list); in __break_lease()
1501 struct file_lock *fl; in lease_get_mtime()
1508 struct file_lock, fl_list); in lease_get_mtime()
1548 struct file_lock *fl; in fcntl_getlease()
1601 generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void **priv) in generic_add_lease()
1603 struct file_lock *fl, *my_fl = NULL, *lease; in generic_add_lease()
1718 struct file_lock *fl, *victim = NULL; in generic_delete_lease()
1756 int generic_setlease(struct file *filp, long arg, struct file_lock **flp, in generic_setlease()
1805 vfs_setlease(struct file *filp, long arg, struct file_lock **lease, void **priv) in vfs_setlease()
1816 struct file_lock *fl; in do_fcntl_add_lease()
1863 static int flock_lock_inode_wait(struct inode *inode, struct file_lock *fl) in flock_lock_inode_wait()
1888 int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl) in locks_lock_inode_wait()
1927 struct file_lock *lock; in SYSCALL_DEFINE2()
1980 int vfs_test_lock(struct file *filp, struct file_lock *fl) in vfs_test_lock()
1989 static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl) in posix_lock_to_flock()
2011 static void posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl) in posix_lock_to_flock64()
2027 struct file_lock file_lock; in fcntl_getlk() local
2038 error = flock_to_posix_lock(filp, &file_lock, &flock); in fcntl_getlk()
2048 file_lock.fl_flags |= FL_OFDLCK; in fcntl_getlk()
2049 file_lock.fl_owner = filp; in fcntl_getlk()
2052 error = vfs_test_lock(filp, &file_lock); in fcntl_getlk()
2056 flock.l_type = file_lock.fl_type; in fcntl_getlk()
2057 if (file_lock.fl_type != F_UNLCK) { in fcntl_getlk()
2058 error = posix_lock_to_flock(&flock, &file_lock); in fcntl_getlk()
2066 locks_release_private(&file_lock); in fcntl_getlk()
2104 int vfs_lock_file(struct file *filp, unsigned int cmd, struct file_lock *fl, struct file_lock *conf) in vfs_lock_file()
2114 struct file_lock *fl) in do_lock_file_wait()
2139 check_fmode_for_setlk(struct file_lock *fl) in check_fmode_for_setlk()
2159 struct file_lock *file_lock = locks_alloc_lock(); in fcntl_setlk() local
2165 if (file_lock == NULL) in fcntl_setlk()
2185 error = flock_to_posix_lock(filp, file_lock, &flock); in fcntl_setlk()
2189 error = check_fmode_for_setlk(file_lock); in fcntl_setlk()
2204 file_lock->fl_flags |= FL_OFDLCK; in fcntl_setlk()
2205 file_lock->fl_owner = filp; in fcntl_setlk()
2213 file_lock->fl_flags |= FL_OFDLCK; in fcntl_setlk()
2214 file_lock->fl_owner = filp; in fcntl_setlk()
2217 file_lock->fl_flags |= FL_SLEEP; in fcntl_setlk()
2220 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk()
2226 if (!error && file_lock->fl_type != F_UNLCK) { in fcntl_setlk()
2232 spin_lock(¤t->files->file_lock); in fcntl_setlk()
2234 spin_unlock(¤t->files->file_lock); in fcntl_setlk()
2236 file_lock->fl_type = F_UNLCK; in fcntl_setlk()
2237 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk()
2243 locks_free_lock(file_lock); in fcntl_setlk()
2253 struct file_lock file_lock; in fcntl_getlk64() local
2264 error = flock64_to_posix_lock(filp, &file_lock, &flock); in fcntl_getlk64()
2274 file_lock.fl_flags |= FL_OFDLCK; in fcntl_getlk64()
2275 file_lock.fl_owner = filp; in fcntl_getlk64()
2278 error = vfs_test_lock(filp, &file_lock); in fcntl_getlk64()
2282 flock.l_type = file_lock.fl_type; in fcntl_getlk64()
2283 if (file_lock.fl_type != F_UNLCK) in fcntl_getlk64()
2284 posix_lock_to_flock64(&flock, &file_lock); in fcntl_getlk64()
2290 locks_release_private(&file_lock); in fcntl_getlk64()
2301 struct file_lock *file_lock = locks_alloc_lock(); in fcntl_setlk64() local
2307 if (file_lock == NULL) in fcntl_setlk64()
2327 error = flock64_to_posix_lock(filp, file_lock, &flock); in fcntl_setlk64()
2331 error = check_fmode_for_setlk(file_lock); in fcntl_setlk64()
2346 file_lock->fl_flags |= FL_OFDLCK; in fcntl_setlk64()
2347 file_lock->fl_owner = filp; in fcntl_setlk64()
2355 file_lock->fl_flags |= FL_OFDLCK; in fcntl_setlk64()
2356 file_lock->fl_owner = filp; in fcntl_setlk64()
2359 file_lock->fl_flags |= FL_SLEEP; in fcntl_setlk64()
2362 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk64()
2368 if (!error && file_lock->fl_type != F_UNLCK) { in fcntl_setlk64()
2374 spin_lock(¤t->files->file_lock); in fcntl_setlk64()
2376 spin_unlock(¤t->files->file_lock); in fcntl_setlk64()
2378 file_lock->fl_type = F_UNLCK; in fcntl_setlk64()
2379 error = do_lock_file_wait(filp, cmd, file_lock); in fcntl_setlk64()
2385 locks_free_lock(file_lock); in fcntl_setlk64()
2397 struct file_lock lock; in locks_remove_posix()
2431 struct file_lock fl = { in locks_remove_flock()
2457 struct file_lock *fl, *tmp; in locks_remove_lease()
2499 posix_unblock_lock(struct file_lock *waiter) in posix_unblock_lock()
2520 int vfs_cancel_lock(struct file *filp, struct file_lock *fl) in vfs_cancel_lock()
2538 static void lock_get_status(struct seq_file *f, struct file_lock *fl, in lock_get_status()
2617 struct file_lock *fl, *bfl; in locks_show()
2619 fl = hlist_entry(v, struct file_lock, fl_link); in locks_show()
2633 struct file_lock *fl; in __show_fd_locks()
2729 sizeof(struct file_lock), 0, SLAB_PANIC, NULL); in filelock_init()