tag | line | file | source code |
fl | 46 | fs/locks.c | static int copy_flock(struct file *filp, struct file_lock *fl, struct flock *l); |
fl | 50 | fs/locks.c | static struct file_lock *alloc_lock(struct file_lock **pos, struct file_lock *fl); |
fl | 51 | fs/locks.c | static void free_lock(struct file_lock **fl); |
fl | 63 | fs/locks.c | struct file_lock *fl,file_lock; |
fl | 76 | fs/locks.c | for (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) { |
fl | 77 | fs/locks.c | if (conflict(&file_lock, fl)) { |
fl | 78 | fs/locks.c | flock.l_pid = fl->fl_owner->pid; |
fl | 79 | fs/locks.c | flock.l_start = fl->fl_start; |
fl | 80 | fs/locks.c | flock.l_len = fl->fl_end == OFFSET_MAX ? 0 : |
fl | 81 | fs/locks.c | fl->fl_end - fl->fl_start + 1; |
fl | 82 | fs/locks.c | flock.l_whence = fl->fl_whence; |
fl | 83 | fs/locks.c | flock.l_type = fl->fl_type; |
fl | 102 | fs/locks.c | struct file_lock *fl,file_lock; |
fl | 146 | fs/locks.c | for (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) { |
fl | 147 | fs/locks.c | if (!conflict(&file_lock, fl)) |
fl | 157 | fs/locks.c | if (locks_deadlocked(file_lock.fl_owner->pid,fl->fl_owner->pid)) |
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; fl != NULL; fl = fl->fl_nextlink) { |
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 | 202 | fs/locks.c | } while (dlock_wait != fl->fl_wait); |
fl | 214 | fs/locks.c | struct file_lock *fl; |
fl | 220 | fs/locks.c | while ((fl = *before) && task != fl->fl_owner) |
fl | 221 | fs/locks.c | before = &fl->fl_next; |
fl | 225 | fs/locks.c | while ((fl = *before) && task == fl->fl_owner) |
fl | 234 | 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_wait = NULL; /* just for cleanliness */ |
fl | 307 | fs/locks.c | struct file_lock *fl; |
fl | 318 | fs/locks.c | while ((fl = *before) && caller->fl_owner != fl->fl_owner) |
fl | 319 | fs/locks.c | before = &fl->fl_next; |
fl | 325 | fs/locks.c | while ((fl = *before) && caller->fl_owner == fl->fl_owner) { |
fl | 329 | fs/locks.c | if (caller->fl_type == fl->fl_type) { |
fl | 330 | fs/locks.c | if (fl->fl_end < caller->fl_start - 1) |
fl | 336 | fs/locks.c | if (fl->fl_start > caller->fl_end + 1) |
fl | 345 | fs/locks.c | if (fl->fl_start > caller->fl_start) |
fl | 346 | fs/locks.c | fl->fl_start = caller->fl_start; |
fl | 348 | fs/locks.c | caller->fl_start = fl->fl_start; |
fl | 349 | fs/locks.c | if (fl->fl_end < caller->fl_end) |
fl | 350 | fs/locks.c | fl->fl_end = caller->fl_end; |
fl | 352 | fs/locks.c | caller->fl_end = fl->fl_end; |
fl | 357 | fs/locks.c | caller = fl; |
fl | 364 | fs/locks.c | if (fl->fl_end < caller->fl_start) |
fl | 366 | fs/locks.c | if (fl->fl_start > caller->fl_end) |
fl | 370 | fs/locks.c | if (fl->fl_start < caller->fl_start) |
fl | 371 | fs/locks.c | left = fl; |
fl | 376 | fs/locks.c | if (fl->fl_end > caller->fl_end) { |
fl | 377 | fs/locks.c | right = fl; |
fl | 380 | fs/locks.c | if (fl->fl_start >= caller->fl_start) { |
fl | 394 | fs/locks.c | wake_up(&fl->fl_wait); |
fl | 395 | fs/locks.c | fl->fl_start = caller->fl_start; |
fl | 396 | fs/locks.c | fl->fl_end = caller->fl_end; |
fl | 397 | fs/locks.c | fl->fl_type = caller->fl_type; |
fl | 398 | fs/locks.c | caller = fl; |
fl | 452 | fs/locks.c | struct file_lock *fl) |
fl | 472 | fs/locks.c | tmp->fl_type = fl->fl_type; |
fl | 473 | fs/locks.c | tmp->fl_whence = fl->fl_whence; |
fl | 474 | fs/locks.c | tmp->fl_start = fl->fl_start; |
fl | 475 | fs/locks.c | tmp->fl_end = fl->fl_end; |
fl | 486 | fs/locks.c | struct file_lock *fl; |
fl | 488 | fs/locks.c | fl = *fl_p; |
fl | 491 | fs/locks.c | if (fl->fl_nextlink != NULL) |
fl | 492 | fs/locks.c | fl->fl_nextlink->fl_prevlink = fl->fl_prevlink; |
fl | 494 | fs/locks.c | if (fl->fl_prevlink != NULL) |
fl | 495 | fs/locks.c | fl->fl_prevlink->fl_nextlink = fl->fl_nextlink; |
fl | 497 | fs/locks.c | file_lock_table = fl->fl_nextlink; |
fl | 499 | fs/locks.c | wake_up(&fl->fl_wait); |
fl | 501 | fs/locks.c | kfree(fl); |