taglinefilesource code
fl23fs/locks.cstatic int copy_flock(struct file *filp, struct file_lock *fl, struct flock *l);
fl29fs/locks.cstatic void free_lock(struct file *filp, struct file_lock *fl);
fl40fs/locks.cstruct file_lock *fl;
fl42fs/locks.cfor (fl = &file_lock_table[0]; fl < file_lock_table + NR_FILE_LOCKS - 1; fl++) {
fl43fs/locks.cfl->fl_next = fl + 1;
fl44fs/locks.cfl->fl_owner = NULL;
fl55fs/locks.cstruct file_lock *fl,file_lock;
fl66fs/locks.cfor (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) {
fl67fs/locks.cif (conflict(&file_lock, fl)) {
fl68fs/locks.cflock.l_pid = fl->fl_owner->pid;
fl69fs/locks.cflock.l_start = fl->fl_start;
fl70fs/locks.cflock.l_len = fl->fl_end == OFFSET_MAX ? 0 :
fl71fs/locks.cfl->fl_end - fl->fl_start + 1;
fl72fs/locks.cflock.l_whence = fl->fl_whence;
fl73fs/locks.cflock.l_type = fl->fl_type;
fl91fs/locks.cstruct file_lock *fl,file_lock;
fl139fs/locks.cfor (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) {
fl140fs/locks.cif (!conflict(&file_lock, fl))
fl148fs/locks.cinterruptible_sleep_on(&fl->fl_wait);
fl167fs/locks.cstruct file_lock *fl,*next;
fl169fs/locks.cfor (fl = filp->f_inode->i_flock; fl != NULL; ) {
fl174fs/locks.cnext = fl->fl_next;
fl175fs/locks.cif (fl->fl_owner == task)
fl176fs/locks.cfree_lock(filp, fl);
fl177fs/locks.cfl = next;
fl186fs/locks.cstatic int copy_flock(struct file *filp, struct file_lock *fl, struct flock *l)
fl205fs/locks.cfl->fl_type = l->l_type;
fl206fs/locks.cfl->fl_start = start;  /* we record the absolute position */
fl207fs/locks.cfl->fl_whence = 0;  /* FIXME: do we record {l_start} as passed? */
fl208fs/locks.cif (l->l_len == 0 || (fl->fl_end = start + l->l_len - 1) < 0)
fl209fs/locks.cfl->fl_end = OFFSET_MAX;
fl210fs/locks.cfl->fl_owner = current;
fl211fs/locks.cfl->fl_wait = NULL;    /* just for cleanliness */
fl259fs/locks.cstruct file_lock *fl,*new;
fl276fs/locks.cfor (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) {
fl277fs/locks.cif (caller->fl_owner != fl->fl_owner)
fl279fs/locks.cif (caller == fl)
fl281fs/locks.cif (!overlap(caller, fl)) {
fl285fs/locks.cif (caller->fl_type != fl->fl_type)
fl287fs/locks.cif (caller->fl_end + 1 == fl->fl_start) {
fl288fs/locks.cfl->fl_start = caller->fl_start;
fl290fs/locks.ccaller = fl;
fl292fs/locks.c} else if (caller->fl_start - 1 == fl->fl_end) {
fl293fs/locks.cfl->fl_end = caller->fl_end;
fl295fs/locks.ccaller = fl;
fl304fs/locks.cif (caller->fl_type != fl->fl_type) {
fl305fs/locks.cif (caller->fl_start > fl->fl_start && caller->fl_end < fl->fl_end) {
fl311fs/locks.cif ((new = alloc_lock(filp, fl)) == NULL) {
fl315fs/locks.cfl->fl_end = caller->fl_start - 1;
fl319fs/locks.cif (caller->fl_start <= fl->fl_start && caller->fl_end >= fl->fl_end) {
fl323fs/locks.cfree_lock(filp, fl);
fl326fs/locks.cif (caller->fl_end < fl->fl_end) {
fl327fs/locks.cfl->fl_start = caller->fl_end + 1;
fl329fs/locks.c} else if (caller->fl_start > fl->fl_start) {
fl330fs/locks.cfl->fl_end = caller->fl_start - 1;
fl340fs/locks.cif (caller->fl_start < fl->fl_start) {
fl341fs/locks.cfl->fl_start = caller->fl_start;
fl344fs/locks.cif (caller->fl_end > fl->fl_end) {
fl345fs/locks.cfl->fl_end = caller->fl_end;
fl349fs/locks.ccaller = fl;
fl373fs/locks.cstruct file_lock *fl,*next;
fl375fs/locks.cfor (fl = filp->f_inode->i_flock; fl != NULL; ) {
fl376fs/locks.cif (caller->fl_owner != fl->fl_owner || !overlap(caller, fl)) {
fl377fs/locks.cfl = fl->fl_next;
fl381fs/locks.cif (caller->fl_start > fl->fl_start && caller->fl_end < fl->fl_end) {
fl386fs/locks.cif ((next = alloc_lock(filp, fl)) == NULL)
fl388fs/locks.cfl->fl_end = caller->fl_start - 1;
fl409fs/locks.cnext = fl->fl_next;
fl410fs/locks.cif (caller->fl_start <= fl->fl_start && caller->fl_end >= fl->fl_end) {
fl411fs/locks.cfree_lock(filp, fl);
fl412fs/locks.c} else if (caller->fl_start > fl->fl_start) {
fl413fs/locks.cfl->fl_end = caller->fl_start - 1;
fl416fs/locks.cfl->fl_start = caller->fl_end + 1;
fl418fs/locks.cif (caller->fl_start >= fl->fl_start && caller->fl_end <= fl->fl_end)
fl420fs/locks.cfl = next;
fl455fs/locks.cstatic void free_lock(struct file *filp, struct file_lock *fl)
fl459fs/locks.cif (fl->fl_owner == NULL)  /* sanity check */
fl468fs/locks.cif (*fl_p == fl)
fl477fs/locks.cfl->fl_next = file_lock_free_list;  /* add to free list */
fl478fs/locks.cfile_lock_free_list = fl;
fl479fs/locks.cfl->fl_owner = NULL;      /* for sanity checks */
fl481fs/locks.cwake_up(&fl->fl_wait);