Lines Matching refs:file_lock

79 static bool lease_breaking(struct file_lock *fl)
84 static int target_leasetype(struct file_lock *fl)
160 * fl->fl_blocker pointer for file_lock structures that are acting as lock
208 struct file_lock *fl;
236 struct file_lock *fl;
259 static void locks_init_lock_heads(struct file_lock *fl)
269 struct file_lock *locks_alloc_lock(void)
271 struct file_lock *fl = kmem_cache_zalloc(filelock_cache, GFP_KERNEL);
280 void locks_release_private(struct file_lock *fl)
316 struct file_lock *fl;
333 void locks_free_lock(struct file_lock *fl)
343 struct file_lock *fl;
346 fl = list_first_entry(dispose, struct file_lock, fl_list);
352 void locks_init_lock(struct file_lock *fl)
354 memset(fl, 0, sizeof(struct file_lock));
360 * Initialize a new lock from an existing file_lock structure.
362 void locks_copy_conflock(struct file_lock *new, struct file_lock *fl)
381 void locks_copy_lock(struct file_lock *new, struct file_lock *fl)
398 static void locks_move_blocks(struct file_lock *new, struct file_lock *fl)
400 struct file_lock *f;
428 /* Fill in a file_lock structure with an appropriate FLOCK lock. */
429 static void flock_make_lock(struct file *filp, struct file_lock *fl, int type)
441 static int assign_type(struct file_lock *fl, int type)
455 static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl,
502 /* Verify a "struct flock" and copy it to a "struct file_lock" as a POSIX
505 static int flock_to_posix_lock(struct file *filp, struct file_lock *fl,
520 lease_break_callback(struct file_lock *fl)
527 lease_setup(struct file_lock *fl, void **priv)
552 static int lease_init(struct file *filp, int type, struct file_lock *fl)
569 /* Allocate a file_lock initialised to this type of lease */
570 static struct file_lock *lease_alloc(struct file *filp, int type)
572 struct file_lock *fl = locks_alloc_lock();
588 static inline int locks_overlap(struct file_lock *fl1, struct file_lock *fl2)
597 static int posix_same_owner(struct file_lock *fl1, struct file_lock *fl2)
603 static void locks_insert_global_locks(struct file_lock *fl)
616 static void locks_delete_global_locks(struct file_lock *fl)
637 posix_owner_key(struct file_lock *fl)
642 static void locks_insert_global_blocked(struct file_lock *waiter)
649 static void locks_delete_global_blocked(struct file_lock *waiter)
661 static void __locks_delete_block(struct file_lock *waiter)
667 static void __locks_wake_up_blocks(struct file_lock *blocker)
670 struct file_lock *waiter;
673 struct file_lock, fl_blocked_member);
695 int locks_delete_block(struct file_lock *waiter)
755 static void __locks_insert_block(struct file_lock *blocker,
756 struct file_lock *waiter,
757 bool conflict(struct file_lock *,
758 struct file_lock *))
760 struct file_lock *fl;
782 static void locks_insert_block(struct file_lock *blocker,
783 struct file_lock *waiter,
784 bool conflict(struct file_lock *,
785 struct file_lock *))
797 static void locks_wake_up_blocks(struct file_lock *blocker)
815 locks_insert_lock_ctx(struct file_lock *fl, struct list_head *before)
822 locks_unlink_lock_ctx(struct file_lock *fl)
830 locks_delete_lock_ctx(struct file_lock *fl, struct list_head *dispose)
842 static bool locks_conflict(struct file_lock *caller_fl,
843 struct file_lock *sys_fl)
855 static bool posix_locks_conflict(struct file_lock *caller_fl,
856 struct file_lock *sys_fl)
874 static bool posix_test_locks_conflict(struct file_lock *caller_fl,
875 struct file_lock *sys_fl)
889 static bool flock_locks_conflict(struct file_lock *caller_fl,
890 struct file_lock *sys_fl)
902 posix_test_lock(struct file *filp, struct file_lock *fl)
904 struct file_lock *cfl;
977 static struct file_lock *what_owner_is_waiting_for(struct file_lock *block_fl)
979 struct file_lock *fl;
992 static int posix_locks_deadlock(struct file_lock *caller_fl,
993 struct file_lock *block_fl)
1022 static int flock_lock_inode(struct inode *inode, struct file_lock *request)
1024 struct file_lock *new_fl = NULL;
1025 struct file_lock *fl;
1094 static int posix_lock_inode(struct inode *inode, struct file_lock *request,
1095 struct file_lock *conflock)
1097 struct file_lock *fl, *tmp;
1098 struct file_lock *new_fl = NULL;
1099 struct file_lock *new_fl2 = NULL;
1100 struct file_lock *left = NULL;
1101 struct file_lock *right = NULL;
1114 * We may need two file_lock structures for this operation,
1346 int posix_lock_file(struct file *filp, struct file_lock *fl,
1347 struct file_lock *conflock)
1360 static int posix_lock_inode_wait(struct inode *inode, struct file_lock *fl)
1377 static void lease_clear_pending(struct file_lock *fl, int arg)
1389 int lease_modify(struct file_lock *fl, int arg, struct list_head *dispose)
1424 struct file_lock *fl, *tmp;
1437 static bool leases_conflict(struct file_lock *lease, struct file_lock *breaker)
1460 any_leases_conflict(struct inode *inode, struct file_lock *breaker)
1463 struct file_lock *fl;
1491 struct file_lock *new_fl, *fl, *tmp;
1551 fl = list_first_entry(&ctx->flc_lease, struct file_lock, fl_list);
1605 struct file_lock *fl;
1611 struct file_lock, fl_list);
1647 struct file_lock *fl;
1719 generic_add_lease(struct file *filp, int arg, struct file_lock **flp, void **priv)
1721 struct file_lock *fl, *my_fl = NULL, *lease;
1830 struct file_lock *fl, *victim = NULL;
1863 * @flp: input - file_lock to use, output - file_lock inserted
1870 int generic_setlease(struct file *filp, int arg, struct file_lock **flp,
1917 setlease_notifier(int arg, struct file_lock *lease)
1939 * @lease: file_lock to use when adding a lease
1953 vfs_setlease(struct file *filp, int arg, struct file_lock **lease, void **priv)
1966 struct file_lock *fl;
2013 static int flock_lock_inode_wait(struct inode *inode, struct file_lock *fl)
2037 int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl)
2072 struct file_lock fl;
2132 int vfs_test_lock(struct file *filp, struct file_lock *fl)
2143 * locks_translate_pid - translate a file_lock's fl_pid number into a namespace
2144 * @fl: The file_lock who's fl_pid should be translated
2149 static pid_t locks_translate_pid(struct file_lock *fl, struct pid_namespace *ns)
2173 static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl)
2195 static void posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl)
2211 struct file_lock *fl;
2283 int vfs_lock_file(struct file *filp, unsigned int cmd, struct file_lock *fl, struct file_lock *conf)
2294 struct file_lock *fl)
2318 check_fmode_for_setlk(struct file_lock *fl)
2338 struct file_lock *file_lock = locks_alloc_lock();
2343 if (file_lock == NULL)
2346 error = flock_to_posix_lock(filp, file_lock, flock);
2350 error = check_fmode_for_setlk(file_lock);
2365 file_lock->fl_flags |= FL_OFDLCK;
2366 file_lock->fl_owner = filp;
2374 file_lock->fl_flags |= FL_OFDLCK;
2375 file_lock->fl_owner = filp;
2378 file_lock->fl_flags |= FL_SLEEP;
2381 error = do_lock_file_wait(filp, cmd, file_lock);
2388 if (!error && file_lock->fl_type != F_UNLCK &&
2389 !(file_lock->fl_flags & FL_OFDLCK)) {
2396 spin_lock(&files->file_lock);
2398 spin_unlock(&files->file_lock);
2400 file_lock->fl_type = F_UNLCK;
2401 error = do_lock_file_wait(filp, cmd, file_lock);
2407 trace_fcntl_setlk(inode, file_lock, error);
2408 locks_free_lock(file_lock);
2418 struct file_lock *fl;
2462 struct file_lock *file_lock = locks_alloc_lock();
2466 if (file_lock == NULL)
2469 error = flock64_to_posix_lock(filp, file_lock, flock);
2473 error = check_fmode_for_setlk(file_lock);
2488 file_lock->fl_flags |= FL_OFDLCK;
2489 file_lock->fl_owner = filp;
2497 file_lock->fl_flags |= FL_OFDLCK;
2498 file_lock->fl_owner = filp;
2501 file_lock->fl_flags |= FL_SLEEP;
2504 error = do_lock_file_wait(filp, cmd, file_lock);
2511 if (!error && file_lock->fl_type != F_UNLCK &&
2512 !(file_lock->fl_flags & FL_OFDLCK)) {
2519 spin_lock(&files->file_lock);
2521 spin_unlock(&files->file_lock);
2523 file_lock->fl_type = F_UNLCK;
2524 error = do_lock_file_wait(filp, cmd, file_lock);
2530 locks_free_lock(file_lock);
2544 struct file_lock lock;
2579 struct file_lock fl;
2601 struct file_lock *fl, *tmp;
2652 int vfs_cancel_lock(struct file *filp, struct file_lock *fl)
2693 static void lock_get_status(struct seq_file *f, struct file_lock *fl,
2765 static struct file_lock *get_next_blocked_member(struct file_lock *node)
2767 struct file_lock *tmp;
2786 struct file_lock *cur, *tmp;
2790 cur = hlist_entry(v, struct file_lock, fl_link);
2809 struct file_lock, fl_blocked_member);
2831 struct file_lock *fl;
2915 sizeof(struct file_lock), 0, SLAB_PANIC, NULL);