Lines Matching refs:file_lock
183 static bool lease_breaking(struct file_lock *fl)
188 static int target_leasetype(struct file_lock *fl)
235 * fl->fl_blocker pointer for file_lock structures that are acting as lock
283 struct file_lock *fl;
311 struct file_lock *fl;
334 static void locks_init_lock_heads(struct file_lock *fl)
344 struct file_lock *locks_alloc_lock(void)
346 struct file_lock *fl = kmem_cache_zalloc(filelock_cache, GFP_KERNEL);
355 void locks_release_private(struct file_lock *fl)
380 void locks_free_lock(struct file_lock *fl)
390 struct file_lock *fl;
393 fl = list_first_entry(dispose, struct file_lock, fl_list);
399 void locks_init_lock(struct file_lock *fl)
401 memset(fl, 0, sizeof(struct file_lock));
407 * Initialize a new lock from an existing file_lock structure.
409 void locks_copy_conflock(struct file_lock *new, struct file_lock *fl)
428 void locks_copy_lock(struct file_lock *new, struct file_lock *fl)
445 static void locks_move_blocks(struct file_lock *new, struct file_lock *fl)
447 struct file_lock *f;
477 /* Fill in a file_lock structure with an appropriate FLOCK lock. */
478 static struct file_lock *
479 flock_make_lock(struct file *filp, unsigned int cmd, struct file_lock *fl)
504 static int assign_type(struct file_lock *fl, long type)
518 static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl,
565 /* Verify a "struct flock" and copy it to a "struct file_lock" as a POSIX
568 static int flock_to_posix_lock(struct file *filp, struct file_lock *fl,
583 lease_break_callback(struct file_lock *fl)
590 lease_setup(struct file_lock *fl, void **priv)
615 static int lease_init(struct file *filp, long type, struct file_lock *fl)
632 /* Allocate a file_lock initialised to this type of lease */
633 static struct file_lock *lease_alloc(struct file *filp, long type)
635 struct file_lock *fl = locks_alloc_lock();
651 static inline int locks_overlap(struct file_lock *fl1, struct file_lock *fl2)
660 static int posix_same_owner(struct file_lock *fl1, struct file_lock *fl2)
666 static void locks_insert_global_locks(struct file_lock *fl)
679 static void locks_delete_global_locks(struct file_lock *fl)
700 posix_owner_key(struct file_lock *fl)
705 static void locks_insert_global_blocked(struct file_lock *waiter)
712 static void locks_delete_global_blocked(struct file_lock *waiter)
724 static void __locks_delete_block(struct file_lock *waiter)
730 static void __locks_wake_up_blocks(struct file_lock *blocker)
733 struct file_lock *waiter;
736 struct file_lock, fl_blocked_member);
758 int locks_delete_block(struct file_lock *waiter)
818 static void __locks_insert_block(struct file_lock *blocker,
819 struct file_lock *waiter,
820 bool conflict(struct file_lock *,
821 struct file_lock *))
823 struct file_lock *fl;
845 static void locks_insert_block(struct file_lock *blocker,
846 struct file_lock *waiter,
847 bool conflict(struct file_lock *,
848 struct file_lock *))
860 static void locks_wake_up_blocks(struct file_lock *blocker)
878 locks_insert_lock_ctx(struct file_lock *fl, struct list_head *before)
885 locks_unlink_lock_ctx(struct file_lock *fl)
893 locks_delete_lock_ctx(struct file_lock *fl, struct list_head *dispose)
905 static bool locks_conflict(struct file_lock *caller_fl,
906 struct file_lock *sys_fl)
918 static bool posix_locks_conflict(struct file_lock *caller_fl,
919 struct file_lock *sys_fl)
937 static bool flock_locks_conflict(struct file_lock *caller_fl,
938 struct file_lock *sys_fl)
952 posix_test_lock(struct file *filp, struct file_lock *fl)
954 struct file_lock *cfl;
1014 static struct file_lock *what_owner_is_waiting_for(struct file_lock *block_fl)
1016 struct file_lock *fl;
1029 static int posix_locks_deadlock(struct file_lock *caller_fl,
1030 struct file_lock *block_fl)
1059 static int flock_lock_inode(struct inode *inode, struct file_lock *request)
1061 struct file_lock *new_fl = NULL;
1062 struct file_lock *fl;
1131 static int posix_lock_inode(struct inode *inode, struct file_lock *request,
1132 struct file_lock *conflock)
1134 struct file_lock *fl, *tmp;
1135 struct file_lock *new_fl = NULL;
1136 struct file_lock *new_fl2 = NULL;
1137 struct file_lock *left = NULL;
1138 struct file_lock *right = NULL;
1149 * We may need two file_lock structures for this operation,
1369 int posix_lock_file(struct file *filp, struct file_lock *fl,
1370 struct file_lock *conflock)
1383 static int posix_lock_inode_wait(struct inode *inode, struct file_lock *fl)
1413 struct file_lock *fl;
1448 struct file_lock fl;
1497 static void lease_clear_pending(struct file_lock *fl, int arg)
1509 int lease_modify(struct file_lock *fl, int arg, struct list_head *dispose)
1544 struct file_lock *fl, *tmp;
1557 static bool leases_conflict(struct file_lock *lease, struct file_lock *breaker)
1580 any_leases_conflict(struct inode *inode, struct file_lock *breaker)
1583 struct file_lock *fl;
1611 struct file_lock *new_fl, *fl, *tmp;
1671 fl = list_first_entry(&ctx->flc_lease, struct file_lock, fl_list);
1725 struct file_lock *fl;
1731 struct file_lock, fl_list);
1767 struct file_lock *fl;
1836 generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void **priv)
1838 struct file_lock *fl, *my_fl = NULL, *lease;
1954 struct file_lock *fl, *victim = NULL;
1987 * @flp: input - file_lock to use, output - file_lock inserted
1994 int generic_setlease(struct file *filp, long arg, struct file_lock **flp,
2041 setlease_notifier(long arg, struct file_lock *lease)
2066 setlease_notifier(long arg, struct file_lock *lease)
2087 * @lease: file_lock to use when adding a lease
2101 vfs_setlease(struct file *filp, long arg, struct file_lock **lease, void **priv)
2114 struct file_lock *fl;
2161 static int flock_lock_inode_wait(struct inode *inode, struct file_lock *fl)
2185 int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl)
2222 struct file_lock *lock;
2275 int vfs_test_lock(struct file *filp, struct file_lock *fl)
2285 * locks_translate_pid - translate a file_lock's fl_pid number into a namespace
2286 * @fl: The file_lock who's fl_pid should be translated
2291 static pid_t locks_translate_pid(struct file_lock *fl, struct pid_namespace *ns)
2315 static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl)
2337 static void posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl)
2353 struct file_lock *fl;
2425 int vfs_lock_file(struct file *filp, unsigned int cmd, struct file_lock *fl, struct file_lock *conf)
2435 struct file_lock *fl)
2459 check_fmode_for_setlk(struct file_lock *fl)
2479 struct file_lock *file_lock = locks_alloc_lock();
2484 if (file_lock == NULL)
2495 error = flock_to_posix_lock(filp, file_lock, flock);
2499 error = check_fmode_for_setlk(file_lock);
2514 file_lock->fl_flags |= FL_OFDLCK;
2515 file_lock->fl_owner = filp;
2523 file_lock->fl_flags |= FL_OFDLCK;
2524 file_lock->fl_owner = filp;
2527 file_lock->fl_flags |= FL_SLEEP;
2530 error = do_lock_file_wait(filp, cmd, file_lock);
2538 if (!error && file_lock->fl_type != F_UNLCK &&
2539 !(file_lock->fl_flags & FL_OFDLCK)) {
2546 spin_lock(&files->file_lock);
2548 spin_unlock(&files->file_lock);
2555 trace_fcntl_setlk(inode, file_lock, error);
2556 locks_free_lock(file_lock);
2566 struct file_lock *fl;
2610 struct file_lock *file_lock = locks_alloc_lock();
2615 if (file_lock == NULL)
2626 error = flock64_to_posix_lock(filp, file_lock, flock);
2630 error = check_fmode_for_setlk(file_lock);
2645 file_lock->fl_flags |= FL_OFDLCK;
2646 file_lock->fl_owner = filp;
2654 file_lock->fl_flags |= FL_OFDLCK;
2655 file_lock->fl_owner = filp;
2658 file_lock->fl_flags |= FL_SLEEP;
2661 error = do_lock_file_wait(filp, cmd, file_lock);
2669 if (!error && file_lock->fl_type != F_UNLCK &&
2670 !(file_lock->fl_flags & FL_OFDLCK)) {
2677 spin_lock(&files->file_lock);
2679 spin_unlock(&files->file_lock);
2686 locks_free_lock(file_lock);
2700 struct file_lock lock;
2735 struct file_lock fl;
2757 struct file_lock *fl, *tmp;
2808 int vfs_cancel_lock(struct file *filp, struct file_lock *fl)
2848 static void lock_get_status(struct seq_file *f, struct file_lock *fl,
2930 struct file_lock *fl, *bfl;
2933 fl = hlist_entry(v, struct file_lock, fl_link);
2950 struct file_lock *fl;
3034 sizeof(struct file_lock), 0, SLAB_PANIC, NULL);