tag | line | file | source code |
fl | 25 | fs/locks.c | static int copy_flock(struct file *filp, struct file_lock *fl, struct flock *l, |
fl | 30 | fs/locks.c | static struct file_lock *alloc_lock(struct file_lock **pos, struct file_lock *fl, |
fl | 32 | fs/locks.c | static void free_lock(struct file_lock **fl); |
fl | 43 | fs/locks.c | struct file_lock *fl; |
fl | 45 | fs/locks.c | for (fl = &file_lock_table[0]; fl < file_lock_table + NR_FILE_LOCKS - 1; fl++) { |
fl | 46 | fs/locks.c | fl->fl_next = fl + 1; |
fl | 47 | fs/locks.c | fl->fl_owner = NULL; |
fl | 59 | fs/locks.c | struct file_lock *fl,file_lock; |
fl | 72 | fs/locks.c | for (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) { |
fl | 73 | fs/locks.c | if (conflict(&file_lock, fl)) { |
fl | 74 | fs/locks.c | flock.l_pid = fl->fl_owner->pid; |
fl | 75 | fs/locks.c | flock.l_start = fl->fl_start; |
fl | 76 | fs/locks.c | flock.l_len = fl->fl_end == OFFSET_MAX ? 0 : |
fl | 77 | fs/locks.c | fl->fl_end - fl->fl_start + 1; |
fl | 78 | fs/locks.c | flock.l_whence = fl->fl_whence; |
fl | 79 | fs/locks.c | flock.l_type = fl->fl_type; |
fl | 98 | fs/locks.c | struct file_lock *fl,file_lock; |
fl | 142 | fs/locks.c | for (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) { |
fl | 143 | fs/locks.c | if (!conflict(&file_lock, fl)) |
fl | 153 | fs/locks.c | interruptible_sleep_on(&fl->fl_wait); |
fl | 176 | fs/locks.c | struct file_lock *fl; |
fl | 182 | fs/locks.c | while ((fl = *before) && (task != fl->fl_owner || fd != fl->fl_fd)) |
fl | 183 | fs/locks.c | before = &fl->fl_next; |
fl | 187 | fs/locks.c | while ((fl = *before) && task == fl->fl_owner && fd == fl->fl_fd) |
fl | 196 | fs/locks.c | static int copy_flock(struct file *filp, struct file_lock *fl, struct flock *l, |
fl | 216 | fs/locks.c | fl->fl_type = l->l_type; |
fl | 217 | fs/locks.c | fl->fl_start = start; /* we record the absolute position */ |
fl | 218 | fs/locks.c | fl->fl_whence = 0; /* FIXME: do we record {l_start} as passed? */ |
fl | 219 | fs/locks.c | if (l->l_len == 0 || (fl->fl_end = start + l->l_len - 1) < 0) |
fl | 220 | fs/locks.c | fl->fl_end = OFFSET_MAX; |
fl | 221 | fs/locks.c | fl->fl_owner = current; |
fl | 222 | fs/locks.c | fl->fl_fd = fd; |
fl | 223 | fs/locks.c | fl->fl_wait = NULL; /* just for cleanliness */ |
fl | 274 | fs/locks.c | struct file_lock *fl; |
fl | 285 | fs/locks.c | while ((fl = *before) && |
fl | 286 | fs/locks.c | (caller->fl_owner != fl->fl_owner || |
fl | 287 | fs/locks.c | caller->fl_fd != fl->fl_fd)) |
fl | 288 | fs/locks.c | before = &fl->fl_next; |
fl | 294 | fs/locks.c | while ( (fl = *before) |
fl | 295 | fs/locks.c | && caller->fl_owner == fl->fl_owner |
fl | 296 | fs/locks.c | && caller->fl_fd == fl->fl_fd) { |
fl | 300 | fs/locks.c | if (caller->fl_type == fl->fl_type) { |
fl | 301 | fs/locks.c | if (fl->fl_end < caller->fl_start - 1) |
fl | 307 | fs/locks.c | if (fl->fl_start > caller->fl_end + 1) |
fl | 316 | fs/locks.c | if (fl->fl_start > caller->fl_start) |
fl | 317 | fs/locks.c | fl->fl_start = caller->fl_start; |
fl | 319 | fs/locks.c | caller->fl_start = fl->fl_start; |
fl | 320 | fs/locks.c | if (fl->fl_end < caller->fl_end) |
fl | 321 | fs/locks.c | fl->fl_end = caller->fl_end; |
fl | 323 | fs/locks.c | caller->fl_end = fl->fl_end; |
fl | 328 | fs/locks.c | caller = fl; |
fl | 335 | fs/locks.c | if (fl->fl_end < caller->fl_start) |
fl | 337 | fs/locks.c | if (fl->fl_start > caller->fl_end) |
fl | 341 | fs/locks.c | if (fl->fl_start < caller->fl_start) |
fl | 342 | fs/locks.c | left = fl; |
fl | 347 | fs/locks.c | if (fl->fl_end > caller->fl_end) { |
fl | 348 | fs/locks.c | right = fl; |
fl | 351 | fs/locks.c | if (fl->fl_start >= caller->fl_start) { |
fl | 365 | fs/locks.c | wake_up(&fl->fl_wait); |
fl | 366 | fs/locks.c | fl->fl_start = caller->fl_start; |
fl | 367 | fs/locks.c | fl->fl_end = caller->fl_end; |
fl | 368 | fs/locks.c | fl->fl_type = caller->fl_type; |
fl | 369 | fs/locks.c | caller = fl; |
fl | 410 | fs/locks.c | struct file_lock *fl, |
fl | 424 | fs/locks.c | *tmp = *fl; |
fl | 441 | fs/locks.c | struct file_lock *fl; |
fl | 443 | fs/locks.c | fl = *fl_p; |
fl | 444 | fs/locks.c | if (fl->fl_owner == NULL) /* sanity check */ |
fl | 449 | fs/locks.c | fl->fl_next = file_lock_free_list; /* add to free list */ |
fl | 450 | fs/locks.c | file_lock_free_list = fl; |
fl | 451 | fs/locks.c | fl->fl_owner = NULL; /* for sanity checks */ |
fl | 453 | fs/locks.c | wake_up(&fl->fl_wait); |