Lines Matching refs:request
869 static int flock_lock_inode(struct inode *inode, struct file_lock *request) in flock_lock_inode() argument
878 ctx = locks_get_lock_context(inode, request->fl_type); in flock_lock_inode()
880 if (request->fl_type != F_UNLCK) in flock_lock_inode()
882 return (request->fl_flags & FL_EXISTS) ? -ENOENT : 0; in flock_lock_inode()
885 if (!(request->fl_flags & FL_ACCESS) && (request->fl_type != F_UNLCK)) { in flock_lock_inode()
892 if (request->fl_flags & FL_ACCESS) in flock_lock_inode()
896 if (request->fl_file != fl->fl_file) in flock_lock_inode()
898 if (request->fl_type == fl->fl_type) in flock_lock_inode()
905 if (request->fl_type == F_UNLCK) { in flock_lock_inode()
906 if ((request->fl_flags & FL_EXISTS) && !found) in flock_lock_inode()
913 if (!flock_locks_conflict(request, fl)) in flock_lock_inode()
916 if (!(request->fl_flags & FL_SLEEP)) in flock_lock_inode()
919 locks_insert_block(fl, request); in flock_lock_inode()
922 if (request->fl_flags & FL_ACCESS) in flock_lock_inode()
924 locks_copy_lock(new_fl, request); 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() argument
949 ctx = locks_get_lock_context(inode, request->fl_type); in __posix_lock_file()
951 return (request->fl_type == F_UNLCK) ? 0 : -ENOMEM; in __posix_lock_file()
959 if (!(request->fl_flags & FL_ACCESS) && in __posix_lock_file()
960 (request->fl_type != F_UNLCK || in __posix_lock_file()
961 request->fl_start != 0 || request->fl_end != OFFSET_MAX)) { in __posix_lock_file()
972 if (request->fl_type != F_UNLCK) { in __posix_lock_file()
974 if (!posix_locks_conflict(request, fl)) in __posix_lock_file()
979 if (!(request->fl_flags & FL_SLEEP)) in __posix_lock_file()
987 if (likely(!posix_locks_deadlock(request, fl))) { in __posix_lock_file()
989 __locks_insert_block(fl, request); in __posix_lock_file()
998 if (request->fl_flags & FL_ACCESS) in __posix_lock_file()
1003 if (posix_same_owner(request, fl)) in __posix_lock_file()
1009 if (!posix_same_owner(request, fl)) in __posix_lock_file()
1013 if (request->fl_type == fl->fl_type) { in __posix_lock_file()
1018 if (fl->fl_end < request->fl_start - 1) in __posix_lock_file()
1023 if (fl->fl_start - 1 > request->fl_end) in __posix_lock_file()
1031 if (fl->fl_start > request->fl_start) in __posix_lock_file()
1032 fl->fl_start = request->fl_start; in __posix_lock_file()
1034 request->fl_start = fl->fl_start; in __posix_lock_file()
1035 if (fl->fl_end < request->fl_end) in __posix_lock_file()
1036 fl->fl_end = request->fl_end; in __posix_lock_file()
1038 request->fl_end = fl->fl_end; in __posix_lock_file()
1043 request = fl; in __posix_lock_file()
1049 if (fl->fl_end < request->fl_start) in __posix_lock_file()
1051 if (fl->fl_start > request->fl_end) in __posix_lock_file()
1053 if (request->fl_type == F_UNLCK) in __posix_lock_file()
1055 if (fl->fl_start < request->fl_start) in __posix_lock_file()
1060 if (fl->fl_end > request->fl_end) { in __posix_lock_file()
1064 if (fl->fl_start >= request->fl_start) { in __posix_lock_file()
1082 locks_copy_lock(new_fl, request); in __posix_lock_file()
1083 request = new_fl; in __posix_lock_file()
1085 locks_insert_lock_ctx(request, &fl->fl_list); in __posix_lock_file()
1103 if (request->fl_type == F_UNLCK) { in __posix_lock_file()
1104 if (request->fl_flags & FL_EXISTS) in __posix_lock_file()
1113 locks_copy_lock(new_fl, request); in __posix_lock_file()
1128 right->fl_start = request->fl_end + 1; in __posix_lock_file()
1132 left->fl_end = request->fl_start - 1; in __posix_lock_file()