tag | line | file | source code |
fl | 27 | fs/locks.c | static int copy_flock(struct file *filp, struct file_lock *fl, struct flock *l, |
fl | 32 | fs/locks.c | static struct file_lock *alloc_lock(struct file_lock **pos, struct file_lock *fl, |
fl | 34 | fs/locks.c | static void free_lock(struct file_lock **fl); |
fl | 48 | fs/locks.c | struct file_lock *fl; |
fl | 50 | fs/locks.c | for (fl = &file_lock_table[0]; fl < file_lock_table + NR_FILE_LOCKS - 1; fl++) { |
fl | 51 | fs/locks.c | fl->fl_next = fl + 1; |
fl | 52 | fs/locks.c | fl->fl_owner = NULL; |
fl | 64 | fs/locks.c | struct file_lock *fl,file_lock; |
fl | 77 | fs/locks.c | for (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) { |
fl | 78 | fs/locks.c | if (conflict(&file_lock, fl)) { |
fl | 79 | fs/locks.c | flock.l_pid = fl->fl_owner->pid; |
fl | 80 | fs/locks.c | flock.l_start = fl->fl_start; |
fl | 81 | fs/locks.c | flock.l_len = fl->fl_end == OFFSET_MAX ? 0 : |
fl | 82 | fs/locks.c | fl->fl_end - fl->fl_start + 1; |
fl | 83 | fs/locks.c | flock.l_whence = fl->fl_whence; |
fl | 84 | fs/locks.c | flock.l_type = fl->fl_type; |
fl | 103 | fs/locks.c | struct file_lock *fl,file_lock; |
fl | 147 | fs/locks.c | for (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) { |
fl | 148 | fs/locks.c | if (!conflict(&file_lock, fl)) |
fl | 158 | fs/locks.c | if (locks_deadlocked(file_lock.fl_owner->pid,fl->fl_owner->pid)) return -EDEADLOCK; |
fl | 160 | fs/locks.c | interruptible_sleep_on(&fl->fl_wait); |
fl | 187 | fs/locks.c | struct file_lock *fl; |
fl | 188 | fs/locks.c | for (fl = &file_lock_table[0]; fl < file_lock_table + NR_FILE_LOCKS - 1; fl++) { |
fl | 189 | fs/locks.c | if (fl->fl_owner == NULL) continue; /* not a used lock */ |
fl | 190 | fs/locks.c | if (fl->fl_owner->pid != my_pid) continue; |
fl | 191 | fs/locks.c | if (fl->fl_wait == NULL) continue; /* no queues */ |
fl | 192 | fs/locks.c | dlock_wait = fl->fl_wait; |
fl | 200 | fs/locks.c | } while (dlock_wait != fl->fl_wait); |
fl | 213 | fs/locks.c | struct file_lock *fl; |
fl | 219 | fs/locks.c | while ((fl = *before) && (task != fl->fl_owner || fd != fl->fl_fd)) |
fl | 220 | fs/locks.c | before = &fl->fl_next; |
fl | 224 | fs/locks.c | while ((fl = *before) && task == fl->fl_owner && fd == fl->fl_fd) |
fl | 233 | fs/locks.c | static int copy_flock(struct file *filp, struct file_lock *fl, struct flock *l, |
fl | 251 | fs/locks.c | fl->fl_type = l->l_type; |
fl | 252 | fs/locks.c | fl->fl_start = start; /* we record the absolute position */ |
fl | 253 | fs/locks.c | fl->fl_whence = 0; /* FIXME: do we record {l_start} as passed? */ |
fl | 254 | fs/locks.c | if (l->l_len == 0 || (fl->fl_end = start + l->l_len - 1) < 0) |
fl | 255 | fs/locks.c | fl->fl_end = OFFSET_MAX; |
fl | 256 | fs/locks.c | fl->fl_owner = current; |
fl | 257 | fs/locks.c | fl->fl_fd = fd; |
fl | 258 | fs/locks.c | fl->fl_wait = NULL; /* just for cleanliness */ |
fl | 309 | fs/locks.c | struct file_lock *fl; |
fl | 320 | fs/locks.c | while ((fl = *before) && |
fl | 321 | fs/locks.c | (caller->fl_owner != fl->fl_owner || |
fl | 322 | fs/locks.c | caller->fl_fd != fl->fl_fd)) |
fl | 323 | fs/locks.c | before = &fl->fl_next; |
fl | 329 | fs/locks.c | while ( (fl = *before) |
fl | 330 | fs/locks.c | && caller->fl_owner == fl->fl_owner |
fl | 331 | fs/locks.c | && caller->fl_fd == fl->fl_fd) { |
fl | 335 | fs/locks.c | if (caller->fl_type == fl->fl_type) { |
fl | 336 | fs/locks.c | if (fl->fl_end < caller->fl_start - 1) |
fl | 342 | fs/locks.c | if (fl->fl_start > caller->fl_end + 1) |
fl | 351 | fs/locks.c | if (fl->fl_start > caller->fl_start) |
fl | 352 | fs/locks.c | fl->fl_start = caller->fl_start; |
fl | 354 | fs/locks.c | caller->fl_start = fl->fl_start; |
fl | 355 | fs/locks.c | if (fl->fl_end < caller->fl_end) |
fl | 356 | fs/locks.c | fl->fl_end = caller->fl_end; |
fl | 358 | fs/locks.c | caller->fl_end = fl->fl_end; |
fl | 363 | fs/locks.c | caller = fl; |
fl | 370 | fs/locks.c | if (fl->fl_end < caller->fl_start) |
fl | 372 | fs/locks.c | if (fl->fl_start > caller->fl_end) |
fl | 376 | fs/locks.c | if (fl->fl_start < caller->fl_start) |
fl | 377 | fs/locks.c | left = fl; |
fl | 382 | fs/locks.c | if (fl->fl_end > caller->fl_end) { |
fl | 383 | fs/locks.c | right = fl; |
fl | 386 | fs/locks.c | if (fl->fl_start >= caller->fl_start) { |
fl | 400 | fs/locks.c | wake_up(&fl->fl_wait); |
fl | 401 | fs/locks.c | fl->fl_start = caller->fl_start; |
fl | 402 | fs/locks.c | fl->fl_end = caller->fl_end; |
fl | 403 | fs/locks.c | fl->fl_type = caller->fl_type; |
fl | 404 | fs/locks.c | caller = fl; |
fl | 459 | fs/locks.c | struct file_lock *fl, |
fl | 473 | fs/locks.c | *tmp = *fl; |
fl | 490 | fs/locks.c | struct file_lock *fl; |
fl | 492 | fs/locks.c | fl = *fl_p; |
fl | 493 | fs/locks.c | if (fl->fl_owner == NULL) /* sanity check */ |
fl | 498 | fs/locks.c | fl->fl_next = file_lock_free_list; /* add to free list */ |
fl | 499 | fs/locks.c | file_lock_free_list = fl; |
fl | 500 | fs/locks.c | fl->fl_owner = NULL; /* for sanity checks */ |
fl | 502 | fs/locks.c | wake_up(&fl->fl_wait); |