Lines Matching refs:request
865 static int flock_lock_inode(struct inode *inode, struct file_lock *request) in flock_lock_inode() argument
874 ctx = locks_get_lock_context(inode, request->fl_type); in flock_lock_inode()
876 if (request->fl_type != F_UNLCK) in flock_lock_inode()
878 return (request->fl_flags & FL_EXISTS) ? -ENOENT : 0; in flock_lock_inode()
881 if (!(request->fl_flags & FL_ACCESS) && (request->fl_type != F_UNLCK)) { in flock_lock_inode()
888 if (request->fl_flags & FL_ACCESS) in flock_lock_inode()
892 if (request->fl_file != fl->fl_file) in flock_lock_inode()
894 if (request->fl_type == fl->fl_type) in flock_lock_inode()
901 if (request->fl_type == F_UNLCK) { in flock_lock_inode()
902 if ((request->fl_flags & FL_EXISTS) && !found) in flock_lock_inode()
909 if (!flock_locks_conflict(request, fl)) in flock_lock_inode()
912 if (!(request->fl_flags & FL_SLEEP)) in flock_lock_inode()
915 locks_insert_block(fl, request); in flock_lock_inode()
918 if (request->fl_flags & FL_ACCESS) in flock_lock_inode()
920 locks_copy_lock(new_fl, request); in flock_lock_inode()
933 static int __posix_lock_file(struct inode *inode, struct file_lock *request, struct file_lock *conf… in __posix_lock_file() argument
945 ctx = locks_get_lock_context(inode, request->fl_type); in __posix_lock_file()
947 return (request->fl_type == F_UNLCK) ? 0 : -ENOMEM; in __posix_lock_file()
955 if (!(request->fl_flags & FL_ACCESS) && in __posix_lock_file()
956 (request->fl_type != F_UNLCK || in __posix_lock_file()
957 request->fl_start != 0 || request->fl_end != OFFSET_MAX)) { in __posix_lock_file()
968 if (request->fl_type != F_UNLCK) { in __posix_lock_file()
970 if (!posix_locks_conflict(request, fl)) in __posix_lock_file()
975 if (!(request->fl_flags & FL_SLEEP)) in __posix_lock_file()
983 if (likely(!posix_locks_deadlock(request, fl))) { in __posix_lock_file()
985 __locks_insert_block(fl, request); in __posix_lock_file()
994 if (request->fl_flags & FL_ACCESS) in __posix_lock_file()
999 if (posix_same_owner(request, fl)) in __posix_lock_file()
1005 if (!posix_same_owner(request, fl)) in __posix_lock_file()
1009 if (request->fl_type == fl->fl_type) { in __posix_lock_file()
1014 if (fl->fl_end < request->fl_start - 1) in __posix_lock_file()
1019 if (fl->fl_start - 1 > request->fl_end) in __posix_lock_file()
1027 if (fl->fl_start > request->fl_start) in __posix_lock_file()
1028 fl->fl_start = request->fl_start; in __posix_lock_file()
1030 request->fl_start = fl->fl_start; in __posix_lock_file()
1031 if (fl->fl_end < request->fl_end) in __posix_lock_file()
1032 fl->fl_end = request->fl_end; in __posix_lock_file()
1034 request->fl_end = fl->fl_end; in __posix_lock_file()
1039 request = fl; in __posix_lock_file()
1045 if (fl->fl_end < request->fl_start) in __posix_lock_file()
1047 if (fl->fl_start > request->fl_end) in __posix_lock_file()
1049 if (request->fl_type == F_UNLCK) in __posix_lock_file()
1051 if (fl->fl_start < request->fl_start) in __posix_lock_file()
1056 if (fl->fl_end > request->fl_end) { in __posix_lock_file()
1060 if (fl->fl_start >= request->fl_start) { in __posix_lock_file()
1078 locks_copy_lock(new_fl, request); in __posix_lock_file()
1079 request = new_fl; in __posix_lock_file()
1081 locks_insert_lock_ctx(request, &fl->fl_list); in __posix_lock_file()
1099 if (request->fl_type == F_UNLCK) { in __posix_lock_file()
1100 if (request->fl_flags & FL_EXISTS) in __posix_lock_file()
1109 locks_copy_lock(new_fl, request); in __posix_lock_file()
1124 right->fl_start = request->fl_end + 1; in __posix_lock_file()
1128 left->fl_end = request->fl_start - 1; in __posix_lock_file()