tag | line | file | source code |
fl | 33 | fs/locks.c | static int copy_flock(struct file *filp, struct file_lock *fl, struct flock *l, |
fl | 38 | fs/locks.c | static struct file_lock *alloc_lock(struct file_lock **pos, struct file_lock *fl, |
fl | 40 | fs/locks.c | static void free_lock(struct file_lock **fl); |
fl | 53 | fs/locks.c | struct file_lock *fl,file_lock; |
fl | 66 | fs/locks.c | for (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) { |
fl | 67 | fs/locks.c | if (conflict(&file_lock, fl)) { |
fl | 68 | fs/locks.c | flock.l_pid = fl->fl_owner->pid; |
fl | 69 | fs/locks.c | flock.l_start = fl->fl_start; |
fl | 70 | fs/locks.c | flock.l_len = fl->fl_end == OFFSET_MAX ? 0 : |
fl | 71 | fs/locks.c | fl->fl_end - fl->fl_start + 1; |
fl | 72 | fs/locks.c | flock.l_whence = fl->fl_whence; |
fl | 73 | fs/locks.c | flock.l_type = fl->fl_type; |
fl | 92 | fs/locks.c | struct file_lock *fl,file_lock; |
fl | 136 | fs/locks.c | for (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) { |
fl | 137 | fs/locks.c | if (!conflict(&file_lock, fl)) |
fl | 147 | fs/locks.c | if (locks_deadlocked(file_lock.fl_owner->pid,fl->fl_owner->pid)) return -EDEADLOCK; |
fl | 149 | fs/locks.c | interruptible_sleep_on(&fl->fl_wait); |
fl | 176 | fs/locks.c | struct file_lock *fl; |
fl | 177 | fs/locks.c | for (fl = file_lock_table; fl != NULL; fl = fl->fl_nextlink) { |
fl | 178 | fs/locks.c | if (fl->fl_owner == NULL) continue; /* not a used lock */ |
fl | 179 | fs/locks.c | if (fl->fl_owner->pid != my_pid) continue; |
fl | 180 | fs/locks.c | if (fl->fl_wait == NULL) continue; /* no queues */ |
fl | 181 | fs/locks.c | dlock_wait = fl->fl_wait; |
fl | 189 | fs/locks.c | } while (dlock_wait != fl->fl_wait); |
fl | 202 | fs/locks.c | struct file_lock *fl; |
fl | 208 | fs/locks.c | while ((fl = *before) && (task != fl->fl_owner || fd != fl->fl_fd)) |
fl | 209 | fs/locks.c | before = &fl->fl_next; |
fl | 213 | fs/locks.c | while ((fl = *before) && task == fl->fl_owner && fd == fl->fl_fd) |
fl | 222 | fs/locks.c | static int copy_flock(struct file *filp, struct file_lock *fl, struct flock *l, |
fl | 240 | fs/locks.c | fl->fl_type = l->l_type; |
fl | 241 | fs/locks.c | fl->fl_start = start; /* we record the absolute position */ |
fl | 242 | fs/locks.c | fl->fl_whence = 0; /* FIXME: do we record {l_start} as passed? */ |
fl | 243 | fs/locks.c | if (l->l_len == 0 || (fl->fl_end = start + l->l_len - 1) < 0) |
fl | 244 | fs/locks.c | fl->fl_end = OFFSET_MAX; |
fl | 245 | fs/locks.c | fl->fl_owner = current; |
fl | 246 | fs/locks.c | fl->fl_fd = fd; |
fl | 247 | fs/locks.c | fl->fl_wait = NULL; /* just for cleanliness */ |
fl | 298 | fs/locks.c | struct file_lock *fl; |
fl | 309 | fs/locks.c | while ((fl = *before) && |
fl | 310 | fs/locks.c | (caller->fl_owner != fl->fl_owner || |
fl | 311 | fs/locks.c | caller->fl_fd != fl->fl_fd)) |
fl | 312 | fs/locks.c | before = &fl->fl_next; |
fl | 318 | fs/locks.c | while ( (fl = *before) |
fl | 319 | fs/locks.c | && caller->fl_owner == fl->fl_owner |
fl | 320 | fs/locks.c | && caller->fl_fd == fl->fl_fd) { |
fl | 324 | fs/locks.c | if (caller->fl_type == fl->fl_type) { |
fl | 325 | fs/locks.c | if (fl->fl_end < caller->fl_start - 1) |
fl | 331 | fs/locks.c | if (fl->fl_start > caller->fl_end + 1) |
fl | 340 | fs/locks.c | if (fl->fl_start > caller->fl_start) |
fl | 341 | fs/locks.c | fl->fl_start = caller->fl_start; |
fl | 343 | fs/locks.c | caller->fl_start = fl->fl_start; |
fl | 344 | fs/locks.c | if (fl->fl_end < caller->fl_end) |
fl | 345 | fs/locks.c | fl->fl_end = caller->fl_end; |
fl | 347 | fs/locks.c | caller->fl_end = fl->fl_end; |
fl | 352 | fs/locks.c | caller = fl; |
fl | 359 | fs/locks.c | if (fl->fl_end < caller->fl_start) |
fl | 361 | fs/locks.c | if (fl->fl_start > caller->fl_end) |
fl | 365 | fs/locks.c | if (fl->fl_start < caller->fl_start) |
fl | 366 | fs/locks.c | left = fl; |
fl | 371 | fs/locks.c | if (fl->fl_end > caller->fl_end) { |
fl | 372 | fs/locks.c | right = fl; |
fl | 375 | fs/locks.c | if (fl->fl_start >= caller->fl_start) { |
fl | 389 | fs/locks.c | wake_up(&fl->fl_wait); |
fl | 390 | fs/locks.c | fl->fl_start = caller->fl_start; |
fl | 391 | fs/locks.c | fl->fl_end = caller->fl_end; |
fl | 392 | fs/locks.c | fl->fl_type = caller->fl_type; |
fl | 393 | fs/locks.c | caller = fl; |
fl | 451 | fs/locks.c | struct file_lock *fl, |
fl | 483 | fs/locks.c | tmp->fl_type = fl->fl_type; |
fl | 484 | fs/locks.c | tmp->fl_whence = fl->fl_whence; |
fl | 485 | fs/locks.c | tmp->fl_start = fl->fl_start; |
fl | 486 | fs/locks.c | tmp->fl_end = fl->fl_end; |
fl | 497 | fs/locks.c | struct file_lock *fl; |
fl | 499 | fs/locks.c | fl = *fl_p; |
fl | 500 | fs/locks.c | if (fl->fl_owner == NULL) /* sanity check */ |
fl | 505 | fs/locks.c | fl->fl_next = file_lock_free_list; /* add to free list */ |
fl | 506 | fs/locks.c | file_lock_free_list = fl; |
fl | 507 | fs/locks.c | fl->fl_owner = NULL; /* for sanity checks */ |
fl | 509 | fs/locks.c | wake_up(&fl->fl_wait); |