tag | line | file | source code |
fl | 71 | fs/locks.c | static int flock_make_lock(struct file *filp, struct file_lock *fl, |
fl | 73 | fs/locks.c | static int posix_make_lock(struct file *filp, struct file_lock *fl, |
fl | 88 | fs/locks.c | static struct file_lock *locks_alloc_lock(struct file_lock *fl); |
fl | 89 | fs/locks.c | static void locks_insert_lock(struct file_lock **pos, struct file_lock *fl); |
fl | 90 | fs/locks.c | static void locks_delete_lock(struct file_lock **fl, unsigned int wait); |
fl | 91 | fs/locks.c | static void locks_insert_block(struct file_lock **block, struct file_lock *fl); |
fl | 123 | fs/locks.c | struct file_lock *fl,file_lock; |
fl | 139 | fs/locks.c | for (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) { |
fl | 140 | fs/locks.c | if (posix_locks_conflict(&file_lock, fl)) { |
fl | 141 | fs/locks.c | flock.l_pid = fl->fl_owner->pid; |
fl | 142 | fs/locks.c | flock.l_start = fl->fl_start; |
fl | 143 | fs/locks.c | flock.l_len = fl->fl_end == OFFSET_MAX ? 0 : |
fl | 144 | fs/locks.c | fl->fl_end - fl->fl_start + 1; |
fl | 146 | fs/locks.c | flock.l_type = fl->fl_type; |
fl | 208 | fs/locks.c | struct file_lock *fl; |
fl | 216 | fs/locks.c | while ((fl = *before) != NULL) { |
fl | 217 | fs/locks.c | if (((fl->fl_flags == F_POSIX) && (fl->fl_owner == task)) || |
fl | 218 | fs/locks.c | ((fl->fl_flags == F_FLOCK) && (fl->fl_file == filp) && |
fl | 222 | fs/locks.c | before = &fl->fl_next; |
fl | 231 | fs/locks.c | static int posix_make_lock(struct file *filp, struct file_lock *fl, |
fl | 243 | fs/locks.c | fl->fl_type = l->l_type; |
fl | 246 | fs/locks.c | fl->fl_type = F_RDLCK; |
fl | 249 | fs/locks.c | fl->fl_type = F_WRLCK; |
fl | 271 | fs/locks.c | fl->fl_start = start; /* we record the absolute position */ |
fl | 272 | fs/locks.c | if ((l->l_len == 0) || ((fl->fl_end = start + l->l_len - 1) < 0)) |
fl | 273 | fs/locks.c | fl->fl_end = OFFSET_MAX; |
fl | 275 | fs/locks.c | fl->fl_flags = F_POSIX; |
fl | 276 | fs/locks.c | fl->fl_file = filp; |
fl | 277 | fs/locks.c | fl->fl_owner = current; |
fl | 278 | fs/locks.c | fl->fl_wait = NULL; /* just for cleanliness */ |
fl | 286 | fs/locks.c | static int flock_make_lock(struct file *filp, struct file_lock *fl, |
fl | 294 | fs/locks.c | fl->fl_type = F_RDLCK; |
fl | 297 | fs/locks.c | fl->fl_type = F_WRLCK; |
fl | 300 | fs/locks.c | fl->fl_type = F_UNLCK; |
fl | 306 | fs/locks.c | fl->fl_flags = F_FLOCK; |
fl | 307 | fs/locks.c | fl->fl_start = 0; |
fl | 308 | fs/locks.c | fl->fl_end = OFFSET_MAX; |
fl | 309 | fs/locks.c | fl->fl_file = filp; |
fl | 310 | fs/locks.c | fl->fl_owner = current; |
fl | 311 | fs/locks.c | fl->fl_wait = NULL; /* just for cleanliness */ |
fl | 386 | fs/locks.c | struct file_lock *fl; |
fl | 388 | fs/locks.c | for (fl = file_lock_table; fl != NULL; fl = fl->fl_nextlink) { |
fl | 389 | fs/locks.c | if (fl->fl_owner == NULL) |
fl | 391 | fs/locks.c | if (fl->fl_owner != my_task) |
fl | 393 | fs/locks.c | if (fl->fl_wait == NULL) |
fl | 395 | fs/locks.c | dlock_wait = fl->fl_wait; |
fl | 404 | fs/locks.c | } while (dlock_wait != fl->fl_wait); |
fl | 416 | fs/locks.c | struct file_lock *fl; |
fl | 425 | fs/locks.c | while ((fl = *before) && (fl->fl_flags == F_FLOCK)) { |
fl | 426 | fs/locks.c | if (caller->fl_file == fl->fl_file) { |
fl | 427 | fs/locks.c | if (caller->fl_type == fl->fl_type) |
fl | 432 | fs/locks.c | before = &fl->fl_next; |
fl | 444 | fs/locks.c | for (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) { |
fl | 445 | fs/locks.c | if (!flock_locks_conflict(new_fl, fl)) |
fl | 453 | fs/locks.c | locks_insert_block(&fl->fl_block, new_fl); |
fl | 484 | fs/locks.c | struct file_lock *fl; |
fl | 493 | fs/locks.c | for (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) { |
fl | 494 | fs/locks.c | if (!posix_locks_conflict(caller, fl)) |
fl | 499 | fs/locks.c | if (fl->fl_flags == F_POSIX) |
fl | 500 | fs/locks.c | if (posix_locks_deadlock(caller->fl_owner, fl->fl_owner)) |
fl | 502 | fs/locks.c | interruptible_sleep_on(&fl->fl_wait); |
fl | 518 | fs/locks.c | while ((fl = *before) && ((fl->fl_flags == F_FLOCK) || |
fl | 519 | fs/locks.c | (caller->fl_owner != fl->fl_owner))) |
fl | 520 | fs/locks.c | before = &fl->fl_next; |
fl | 524 | fs/locks.c | while ((fl = *before) && (caller->fl_owner == fl->fl_owner)) { |
fl | 527 | fs/locks.c | if (caller->fl_type == fl->fl_type) { |
fl | 528 | fs/locks.c | if (fl->fl_end < caller->fl_start - 1) |
fl | 533 | fs/locks.c | if (fl->fl_start > caller->fl_end + 1) |
fl | 541 | fs/locks.c | if (fl->fl_start > caller->fl_start) |
fl | 542 | fs/locks.c | fl->fl_start = caller->fl_start; |
fl | 544 | fs/locks.c | caller->fl_start = fl->fl_start; |
fl | 545 | fs/locks.c | if (fl->fl_end < caller->fl_end) |
fl | 546 | fs/locks.c | fl->fl_end = caller->fl_end; |
fl | 548 | fs/locks.c | caller->fl_end = fl->fl_end; |
fl | 553 | fs/locks.c | caller = fl; |
fl | 559 | fs/locks.c | if (fl->fl_end < caller->fl_start) |
fl | 561 | fs/locks.c | if (fl->fl_start > caller->fl_end) |
fl | 565 | fs/locks.c | if (fl->fl_start < caller->fl_start) |
fl | 566 | fs/locks.c | left = fl; |
fl | 570 | fs/locks.c | if (fl->fl_end > caller->fl_end) { |
fl | 571 | fs/locks.c | right = fl; |
fl | 574 | fs/locks.c | if (fl->fl_start >= caller->fl_start) { |
fl | 586 | fs/locks.c | wake_up(&fl->fl_wait); |
fl | 587 | fs/locks.c | fl->fl_start = caller->fl_start; |
fl | 588 | fs/locks.c | fl->fl_end = caller->fl_end; |
fl | 589 | fs/locks.c | fl->fl_type = caller->fl_type; |
fl | 590 | fs/locks.c | caller = fl; |
fl | 632 | fs/locks.c | static struct file_lock *locks_alloc_lock(struct file_lock *fl) |
fl | 645 | fs/locks.c | tmp->fl_flags = fl->fl_flags; |
fl | 646 | fs/locks.c | tmp->fl_owner = fl->fl_owner; |
fl | 647 | fs/locks.c | tmp->fl_file = fl->fl_file; |
fl | 649 | fs/locks.c | tmp->fl_type = fl->fl_type; |
fl | 650 | fs/locks.c | tmp->fl_start = fl->fl_start; |
fl | 651 | fs/locks.c | tmp->fl_end = fl->fl_end; |
fl | 660 | fs/locks.c | static void locks_insert_lock(struct file_lock **pos, struct file_lock *fl) |
fl | 662 | fs/locks.c | fl->fl_nextlink = file_lock_table; |
fl | 663 | fs/locks.c | fl->fl_prevlink = NULL; |
fl | 665 | fs/locks.c | file_lock_table->fl_prevlink = fl; |
fl | 666 | fs/locks.c | file_lock_table = fl; |
fl | 667 | fs/locks.c | fl->fl_next = *pos; /* insert into file's list */ |
fl | 668 | fs/locks.c | *pos = fl; |
fl | 683 | fs/locks.c | struct file_lock *fl; |
fl | 686 | fs/locks.c | fl = *fl_p; |
fl | 689 | fs/locks.c | if (fl->fl_nextlink != NULL) |
fl | 690 | fs/locks.c | fl->fl_nextlink->fl_prevlink = fl->fl_prevlink; |
fl | 692 | fs/locks.c | if (fl->fl_prevlink != NULL) |
fl | 693 | fs/locks.c | fl->fl_prevlink->fl_nextlink = fl->fl_nextlink; |
fl | 695 | fs/locks.c | file_lock_table = fl->fl_nextlink; |
fl | 697 | fs/locks.c | while ((bfl = fl->fl_block) != NULL) { |
fl | 698 | fs/locks.c | fl->fl_block = bfl->fl_block; |
fl | 705 | fs/locks.c | wake_up(&fl->fl_wait); |
fl | 706 | fs/locks.c | kfree(fl); |
fl | 721 | fs/locks.c | static void locks_insert_block(struct file_lock **block, struct file_lock *fl) |
fl | 728 | fs/locks.c | *block = fl; |
fl | 729 | fs/locks.c | fl->fl_block = NULL; |