tag | line | file | source code |
fl | 91 | fs/locks.c | static int flock_make_lock(struct file *filp, struct file_lock *fl, |
fl | 93 | fs/locks.c | static int posix_make_lock(struct file *filp, struct file_lock *fl, |
fl | 108 | fs/locks.c | static struct file_lock *locks_alloc_lock(struct file_lock *fl); |
fl | 109 | fs/locks.c | static void locks_insert_lock(struct file_lock **pos, struct file_lock *fl); |
fl | 110 | fs/locks.c | static void locks_delete_lock(struct file_lock **fl, unsigned int wait); |
fl | 111 | fs/locks.c | static char *lock_get_status(struct file_lock *fl, char *p, int id, char *pfx); |
fl | 116 | fs/locks.c | static inline void locks_free_lock(struct file_lock *fl) |
fl | 118 | fs/locks.c | kfree(fl); |
fl | 137 | fs/locks.c | struct file_lock *fl) |
fl | 143 | fs/locks.c | bfl->fl_block = fl; |
fl | 144 | fs/locks.c | fl->fl_block = NULL; |
fl | 150 | fs/locks.c | struct file_lock *fl) |
fl | 155 | fs/locks.c | if (tfl == fl) { |
fl | 156 | fs/locks.c | bfl->fl_block = fl->fl_block; |
fl | 157 | fs/locks.c | fl->fl_block = NULL; |
fl | 193 | fs/locks.c | struct file_lock *fl,file_lock; |
fl | 209 | fs/locks.c | for (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) { |
fl | 210 | fs/locks.c | if (posix_locks_conflict(&file_lock, fl)) { |
fl | 211 | fs/locks.c | flock.l_pid = fl->fl_owner->pid; |
fl | 212 | fs/locks.c | flock.l_start = fl->fl_start; |
fl | 213 | fs/locks.c | flock.l_len = fl->fl_end == OFFSET_MAX ? 0 : |
fl | 214 | fs/locks.c | fl->fl_end - fl->fl_start + 1; |
fl | 216 | fs/locks.c | flock.l_type = fl->fl_type; |
fl | 307 | fs/locks.c | struct file_lock *fl; |
fl | 315 | fs/locks.c | while ((fl = *before) != NULL) { |
fl | 316 | fs/locks.c | if (((fl->fl_flags & F_POSIX) && (fl->fl_owner == task)) || |
fl | 317 | fs/locks.c | ((fl->fl_flags & F_FLOCK) && (fl->fl_file == filp) && |
fl | 321 | fs/locks.c | before = &fl->fl_next; |
fl | 339 | fs/locks.c | struct file_lock *fl; |
fl | 343 | fs/locks.c | for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) { |
fl | 344 | fs/locks.c | if ((fl->fl_flags & F_POSIX) && (fl->fl_owner != current)) |
fl | 366 | fs/locks.c | struct file_lock *fl; |
fl | 373 | fs/locks.c | for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) { |
fl | 374 | fs/locks.c | if ((fl->fl_flags & F_FLOCK) || |
fl | 375 | fs/locks.c | ((fl->fl_flags & F_POSIX) && (fl->fl_owner == current))) |
fl | 377 | fs/locks.c | if (fl->fl_end < offset || |
fl | 378 | fs/locks.c | fl->fl_start >= offset + count) |
fl | 385 | fs/locks.c | fl->fl_type == F_WRLCK) { |
fl | 390 | fs/locks.c | if (locks_deadlock(current, fl->fl_owner)) |
fl | 392 | fs/locks.c | interruptible_sleep_on(&fl->fl_wait); |
fl | 410 | fs/locks.c | static int posix_make_lock(struct file *filp, struct file_lock *fl, |
fl | 415 | fs/locks.c | fl->fl_flags = F_POSIX; |
fl | 421 | fs/locks.c | fl->fl_type = l->l_type; |
fl | 424 | fs/locks.c | fl->fl_type = F_RDLCK; |
fl | 425 | fs/locks.c | fl->fl_flags |= F_BROKEN; |
fl | 428 | fs/locks.c | fl->fl_type = F_WRLCK; |
fl | 429 | fs/locks.c | fl->fl_flags |= F_BROKEN; |
fl | 451 | fs/locks.c | fl->fl_start = start; /* we record the absolute position */ |
fl | 452 | fs/locks.c | if ((l->l_len == 0) || ((fl->fl_end = start + l->l_len - 1) < 0)) |
fl | 453 | fs/locks.c | fl->fl_end = OFFSET_MAX; |
fl | 455 | fs/locks.c | fl->fl_file = filp; |
fl | 456 | fs/locks.c | fl->fl_owner = current; |
fl | 457 | fs/locks.c | fl->fl_wait = NULL; /* just for cleanliness */ |
fl | 465 | fs/locks.c | static int flock_make_lock(struct file *filp, struct file_lock *fl, |
fl | 473 | fs/locks.c | fl->fl_type = F_RDLCK; |
fl | 476 | fs/locks.c | fl->fl_type = F_WRLCK; |
fl | 479 | fs/locks.c | fl->fl_type = F_UNLCK; |
fl | 485 | fs/locks.c | fl->fl_flags = F_FLOCK; |
fl | 486 | fs/locks.c | fl->fl_start = 0; |
fl | 487 | fs/locks.c | fl->fl_end = OFFSET_MAX; |
fl | 488 | fs/locks.c | fl->fl_file = filp; |
fl | 489 | fs/locks.c | fl->fl_owner = current; |
fl | 490 | fs/locks.c | fl->fl_wait = NULL; /* just for cleanliness */ |
fl | 570 | fs/locks.c | struct file_lock *fl; |
fl | 575 | fs/locks.c | for (fl = file_lock_table; fl != NULL; fl = fl->fl_nextlink) { |
fl | 576 | fs/locks.c | if (fl->fl_owner == NULL || fl->fl_wait == NULL) |
fl | 578 | fs/locks.c | dlock_wait = fl->fl_wait; |
fl | 581 | fs/locks.c | if (fl->fl_owner == my_task) { |
fl | 584 | fs/locks.c | blocked_task = fl->fl_owner; |
fl | 588 | fs/locks.c | } while (dlock_wait != fl->fl_wait); |
fl | 600 | fs/locks.c | struct file_lock *fl; |
fl | 609 | fs/locks.c | while ((fl = *before) && (fl->fl_flags & F_FLOCK)) { |
fl | 610 | fs/locks.c | if (caller->fl_file == fl->fl_file) { |
fl | 611 | fs/locks.c | if (caller->fl_type == fl->fl_type) |
fl | 616 | fs/locks.c | before = &fl->fl_next; |
fl | 628 | fs/locks.c | for (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) { |
fl | 629 | fs/locks.c | if (!flock_locks_conflict(new_fl, fl)) |
fl | 646 | fs/locks.c | if (locks_deadlock(new_fl->fl_owner, fl->fl_owner)) { |
fl | 650 | fs/locks.c | locks_insert_block(fl, new_fl); |
fl | 660 | fs/locks.c | locks_delete_block(fl, new_fl); |
fl | 689 | fs/locks.c | struct file_lock *fl; |
fl | 698 | fs/locks.c | for (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) { |
fl | 699 | fs/locks.c | if (!posix_locks_conflict(caller, fl)) |
fl | 704 | fs/locks.c | if (locks_deadlock(caller->fl_owner, fl->fl_owner)) |
fl | 706 | fs/locks.c | interruptible_sleep_on(&fl->fl_wait); |
fl | 722 | fs/locks.c | while ((fl = *before) && ((fl->fl_flags & F_FLOCK) || |
fl | 723 | fs/locks.c | (caller->fl_owner != fl->fl_owner))) { |
fl | 724 | fs/locks.c | before = &fl->fl_next; |
fl | 730 | fs/locks.c | while ((fl = *before) && (caller->fl_owner == fl->fl_owner)) { |
fl | 733 | fs/locks.c | if (caller->fl_type == fl->fl_type) { |
fl | 734 | fs/locks.c | if (fl->fl_end < caller->fl_start - 1) |
fl | 739 | fs/locks.c | if (fl->fl_start > caller->fl_end + 1) |
fl | 747 | fs/locks.c | if (fl->fl_start > caller->fl_start) |
fl | 748 | fs/locks.c | fl->fl_start = caller->fl_start; |
fl | 750 | fs/locks.c | caller->fl_start = fl->fl_start; |
fl | 751 | fs/locks.c | if (fl->fl_end < caller->fl_end) |
fl | 752 | fs/locks.c | fl->fl_end = caller->fl_end; |
fl | 754 | fs/locks.c | caller->fl_end = fl->fl_end; |
fl | 759 | fs/locks.c | caller = fl; |
fl | 766 | fs/locks.c | if (fl->fl_end < caller->fl_start) |
fl | 768 | fs/locks.c | if (fl->fl_start > caller->fl_end) |
fl | 772 | fs/locks.c | if (fl->fl_start < caller->fl_start) |
fl | 773 | fs/locks.c | left = fl; |
fl | 777 | fs/locks.c | if (fl->fl_end > caller->fl_end) { |
fl | 778 | fs/locks.c | right = fl; |
fl | 781 | fs/locks.c | if (fl->fl_start >= caller->fl_start) { |
fl | 794 | fs/locks.c | wake_up(&fl->fl_wait); |
fl | 795 | fs/locks.c | fl->fl_start = caller->fl_start; |
fl | 796 | fs/locks.c | fl->fl_end = caller->fl_end; |
fl | 797 | fs/locks.c | fl->fl_type = caller->fl_type; |
fl | 798 | fs/locks.c | caller = fl; |
fl | 805 | fs/locks.c | before = &fl->fl_next; |
fl | 840 | fs/locks.c | static struct file_lock *locks_alloc_lock(struct file_lock *fl) |
fl | 853 | fs/locks.c | tmp->fl_flags = fl->fl_flags; |
fl | 854 | fs/locks.c | tmp->fl_owner = fl->fl_owner; |
fl | 855 | fs/locks.c | tmp->fl_file = fl->fl_file; |
fl | 857 | fs/locks.c | tmp->fl_type = fl->fl_type; |
fl | 858 | fs/locks.c | tmp->fl_start = fl->fl_start; |
fl | 859 | fs/locks.c | tmp->fl_end = fl->fl_end; |
fl | 868 | fs/locks.c | static void locks_insert_lock(struct file_lock **pos, struct file_lock *fl) |
fl | 870 | fs/locks.c | fl->fl_nextlink = file_lock_table; |
fl | 871 | fs/locks.c | fl->fl_prevlink = NULL; |
fl | 873 | fs/locks.c | file_lock_table->fl_prevlink = fl; |
fl | 874 | fs/locks.c | file_lock_table = fl; |
fl | 875 | fs/locks.c | fl->fl_next = *pos; /* insert into file's list */ |
fl | 876 | fs/locks.c | *pos = fl; |
fl | 892 | fs/locks.c | struct file_lock *fl; |
fl | 896 | fs/locks.c | fl = *fl_p; |
fl | 897 | fs/locks.c | *fl_p = fl->fl_next; |
fl | 898 | fs/locks.c | pfl = fl->fl_prevlink; |
fl | 899 | fs/locks.c | nfl = fl->fl_nextlink; |
fl | 909 | fs/locks.c | while ((nfl = fl->fl_block) != NULL) { |
fl | 910 | fs/locks.c | fl->fl_block = nfl->fl_block; |
fl | 917 | fs/locks.c | wake_up(&fl->fl_wait); |
fl | 918 | fs/locks.c | kfree(fl); |
fl | 924 | fs/locks.c | static char *lock_get_status(struct file_lock *fl, char *p, int id, char *pfx) |
fl | 929 | fs/locks.c | if (fl->fl_flags & F_POSIX) { |
fl | 931 | fs/locks.c | (fl->fl_flags & F_BROKEN) ? "BROKEN" : "POSIX ", |
fl | 932 | fs/locks.c | ((fl->fl_file->f_inode->i_mode & (S_IXGRP | S_ISGID)) |
fl | 938 | fs/locks.c | p += sprintf(p, "%s ", (fl->fl_type == F_RDLCK) ? "READ " : "WRITE"); |
fl | 940 | fs/locks.c | fl->fl_owner->pid, fl->fl_file->f_inode->i_dev, |
fl | 941 | fs/locks.c | fl->fl_file->f_inode->i_ino, fl->fl_start, |
fl | 942 | fs/locks.c | fl->fl_end); |
fl | 944 | fs/locks.c | (long)fl, (long)fl->fl_prevlink, (long)fl->fl_nextlink, |
fl | 945 | fs/locks.c | (long)fl->fl_next, (long)fl->fl_block, id, pfx); |
fl | 946 | fs/locks.c | if ((wt = fl->fl_wait) != NULL) { |
fl | 950 | fs/locks.c | } while (wt != fl->fl_wait); |
fl | 958 | fs/locks.c | struct file_lock *fl; |
fl | 964 | fs/locks.c | for (fl = file_lock_table, i = 1; fl != NULL; fl = fl->fl_nextlink, i++) { |
fl | 965 | fs/locks.c | p = lock_get_status(fl, p, i, ""); |
fl | 966 | fs/locks.c | for (bfl = fl; bfl->fl_block != NULL; bfl = bfl->fl_block) |