taglinefilesource code
fl71fs/locks.cstatic int flock_make_lock(struct file *filp, struct file_lock *fl,
fl73fs/locks.cstatic int posix_make_lock(struct file *filp, struct file_lock *fl,
fl88fs/locks.cstatic struct file_lock *locks_alloc_lock(struct file_lock *fl);
fl89fs/locks.cstatic void locks_insert_lock(struct file_lock **pos, struct file_lock *fl);
fl90fs/locks.cstatic void locks_delete_lock(struct file_lock **fl, unsigned int wait);
fl91fs/locks.cstatic void locks_insert_block(struct file_lock **block, struct file_lock *fl);
fl123fs/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 (posix_locks_conflict(&file_lock, fl)) {
fl141fs/locks.cflock.l_pid = fl->fl_owner->pid;
fl142fs/locks.cflock.l_start = fl->fl_start;
fl143fs/locks.cflock.l_len = fl->fl_end == OFFSET_MAX ? 0 :
fl144fs/locks.cfl->fl_end - fl->fl_start + 1;
fl146fs/locks.cflock.l_type = fl->fl_type;
fl208fs/locks.cstruct file_lock *fl;
fl216fs/locks.cwhile ((fl = *before) != NULL) {
fl217fs/locks.cif (((fl->fl_flags == F_POSIX) && (fl->fl_owner == task)) ||
fl218fs/locks.c((fl->fl_flags == F_FLOCK) && (fl->fl_file == filp) &&
fl222fs/locks.cbefore = &fl->fl_next;
fl231fs/locks.cstatic int posix_make_lock(struct file *filp, struct file_lock *fl,
fl243fs/locks.cfl->fl_type = l->l_type;
fl246fs/locks.cfl->fl_type = F_RDLCK;
fl249fs/locks.cfl->fl_type = F_WRLCK;
fl271fs/locks.cfl->fl_start = start;  /* we record the absolute position */
fl272fs/locks.cif ((l->l_len == 0) || ((fl->fl_end = start + l->l_len - 1) < 0))
fl273fs/locks.cfl->fl_end = OFFSET_MAX;
fl275fs/locks.cfl->fl_flags = F_POSIX;
fl276fs/locks.cfl->fl_file = filp;
fl277fs/locks.cfl->fl_owner = current;
fl278fs/locks.cfl->fl_wait = NULL;    /* just for cleanliness */
fl286fs/locks.cstatic int flock_make_lock(struct file *filp, struct file_lock *fl,
fl294fs/locks.cfl->fl_type = F_RDLCK;
fl297fs/locks.cfl->fl_type = F_WRLCK;
fl300fs/locks.cfl->fl_type = F_UNLCK;
fl306fs/locks.cfl->fl_flags = F_FLOCK;
fl307fs/locks.cfl->fl_start = 0;
fl308fs/locks.cfl->fl_end = OFFSET_MAX;
fl309fs/locks.cfl->fl_file = filp;
fl310fs/locks.cfl->fl_owner = current;
fl311fs/locks.cfl->fl_wait = NULL;    /* just for cleanliness */
fl386fs/locks.cstruct file_lock *fl;
fl388fs/locks.cfor (fl = file_lock_table; fl != NULL; fl = fl->fl_nextlink) {
fl389fs/locks.cif (fl->fl_owner == NULL)
fl391fs/locks.cif (fl->fl_owner != my_task)
fl393fs/locks.cif (fl->fl_wait == NULL)
fl395fs/locks.cdlock_wait = fl->fl_wait;
fl404fs/locks.c} while (dlock_wait != fl->fl_wait);
fl416fs/locks.cstruct file_lock *fl;
fl425fs/locks.cwhile ((fl = *before) && (fl->fl_flags == F_FLOCK)) {
fl426fs/locks.cif (caller->fl_file == fl->fl_file) {
fl427fs/locks.cif (caller->fl_type == fl->fl_type)
fl432fs/locks.cbefore = &fl->fl_next;
fl444fs/locks.cfor (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) {
fl445fs/locks.cif (!flock_locks_conflict(new_fl, fl))
fl453fs/locks.clocks_insert_block(&fl->fl_block, new_fl);
fl484fs/locks.cstruct file_lock *fl;
fl493fs/locks.cfor (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) {
fl494fs/locks.cif (!posix_locks_conflict(caller, fl))
fl499fs/locks.cif (fl->fl_flags == F_POSIX)
fl500fs/locks.cif (posix_locks_deadlock(caller->fl_owner, fl->fl_owner))
fl502fs/locks.cinterruptible_sleep_on(&fl->fl_wait);
fl518fs/locks.cwhile ((fl = *before) && ((fl->fl_flags == F_FLOCK) ||
fl519fs/locks.c(caller->fl_owner != fl->fl_owner)))
fl520fs/locks.cbefore = &fl->fl_next;
fl524fs/locks.cwhile ((fl = *before) && (caller->fl_owner == fl->fl_owner)) {
fl527fs/locks.cif (caller->fl_type == fl->fl_type) {
fl528fs/locks.cif (fl->fl_end < caller->fl_start - 1)
fl533fs/locks.cif (fl->fl_start > caller->fl_end + 1)
fl541fs/locks.cif (fl->fl_start > caller->fl_start)
fl542fs/locks.cfl->fl_start = caller->fl_start;
fl544fs/locks.ccaller->fl_start = fl->fl_start;
fl545fs/locks.cif (fl->fl_end < caller->fl_end)
fl546fs/locks.cfl->fl_end = caller->fl_end;
fl548fs/locks.ccaller->fl_end = fl->fl_end;
fl553fs/locks.ccaller = fl;
fl559fs/locks.cif (fl->fl_end < caller->fl_start)
fl561fs/locks.cif (fl->fl_start > caller->fl_end)
fl565fs/locks.cif (fl->fl_start < caller->fl_start)
fl566fs/locks.cleft = fl;
fl570fs/locks.cif (fl->fl_end > caller->fl_end) {
fl571fs/locks.cright = fl;
fl574fs/locks.cif (fl->fl_start >= caller->fl_start) {
fl586fs/locks.cwake_up(&fl->fl_wait);
fl587fs/locks.cfl->fl_start = caller->fl_start;
fl588fs/locks.cfl->fl_end = caller->fl_end;
fl589fs/locks.cfl->fl_type = caller->fl_type;
fl590fs/locks.ccaller = fl;
fl632fs/locks.cstatic struct file_lock *locks_alloc_lock(struct file_lock *fl)
fl645fs/locks.ctmp->fl_flags = fl->fl_flags;
fl646fs/locks.ctmp->fl_owner = fl->fl_owner;
fl647fs/locks.ctmp->fl_file = fl->fl_file;
fl649fs/locks.ctmp->fl_type = fl->fl_type;
fl650fs/locks.ctmp->fl_start = fl->fl_start;
fl651fs/locks.ctmp->fl_end = fl->fl_end;
fl660fs/locks.cstatic void locks_insert_lock(struct file_lock **pos, struct file_lock *fl)
fl662fs/locks.cfl->fl_nextlink = file_lock_table;
fl663fs/locks.cfl->fl_prevlink = NULL;
fl665fs/locks.cfile_lock_table->fl_prevlink = fl;
fl666fs/locks.cfile_lock_table = fl;
fl667fs/locks.cfl->fl_next = *pos;  /* insert into file's list */
fl668fs/locks.c*pos = fl;
fl683fs/locks.cstruct file_lock *fl;
fl686fs/locks.cfl = *fl_p;
fl689fs/locks.cif (fl->fl_nextlink != NULL)
fl690fs/locks.cfl->fl_nextlink->fl_prevlink = fl->fl_prevlink;
fl692fs/locks.cif (fl->fl_prevlink != NULL)
fl693fs/locks.cfl->fl_prevlink->fl_nextlink = fl->fl_nextlink;
fl695fs/locks.cfile_lock_table = fl->fl_nextlink;
fl697fs/locks.cwhile ((bfl = fl->fl_block) != NULL) {
fl698fs/locks.cfl->fl_block = bfl->fl_block;
fl705fs/locks.cwake_up(&fl->fl_wait);
fl706fs/locks.ckfree(fl);
fl721fs/locks.cstatic void locks_insert_block(struct file_lock **block, struct file_lock *fl)
fl728fs/locks.c*block = fl;
fl729fs/locks.cfl->fl_block = NULL;