taglinefilesource code
fl76fs/locks.cstatic int flock_make_lock(struct file *filp, struct file_lock *fl,
fl78fs/locks.cstatic int posix_make_lock(struct file *filp, struct file_lock *fl,
fl93fs/locks.cstatic struct file_lock *locks_alloc_lock(struct file_lock *fl);
fl94fs/locks.cstatic void locks_insert_lock(struct file_lock **pos, struct file_lock *fl);
fl95fs/locks.cstatic void locks_delete_lock(struct file_lock **fl, unsigned int wait);
fl100fs/locks.cstatic inline void locks_free_lock(struct file_lock **fl)
fl102fs/locks.ckfree(*fl);
fl103fs/locks.c*fl = NULL;           /* Just in case */
fl121fs/locks.cstruct file_lock *fl)
fl129fs/locks.c*block = fl;
fl130fs/locks.cfl->fl_block = NULL;
fl136fs/locks.cstruct file_lock *fl)
fl141fs/locks.cif (bfl == fl) {
fl142fs/locks.c*block = fl->fl_block;
fl143fs/locks.cfl->fl_block = NULL;
fl178fs/locks.cstruct file_lock *fl,file_lock;
fl194fs/locks.cfor (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) {
fl195fs/locks.cif (posix_locks_conflict(&file_lock, fl)) {
fl196fs/locks.cflock.l_pid = fl->fl_owner->pid;
fl197fs/locks.cflock.l_start = fl->fl_start;
fl198fs/locks.cflock.l_len = fl->fl_end == OFFSET_MAX ? 0 :
fl199fs/locks.cfl->fl_end - fl->fl_start + 1;
fl201fs/locks.cflock.l_type = fl->fl_type;
fl263fs/locks.cstruct file_lock *fl;
fl271fs/locks.cwhile ((fl = *before) != NULL) {
fl272fs/locks.cif (((fl->fl_flags == F_POSIX) && (fl->fl_owner == task)) ||
fl273fs/locks.c((fl->fl_flags == F_FLOCK) && (fl->fl_file == filp) &&
fl277fs/locks.cbefore = &fl->fl_next;
fl286fs/locks.cstatic int posix_make_lock(struct file *filp, struct file_lock *fl,
fl298fs/locks.cfl->fl_type = l->l_type;
fl301fs/locks.cfl->fl_type = F_RDLCK;
fl304fs/locks.cfl->fl_type = F_WRLCK;
fl326fs/locks.cfl->fl_start = start;  /* we record the absolute position */
fl327fs/locks.cif ((l->l_len == 0) || ((fl->fl_end = start + l->l_len - 1) < 0))
fl328fs/locks.cfl->fl_end = OFFSET_MAX;
fl330fs/locks.cfl->fl_flags = F_POSIX;
fl331fs/locks.cfl->fl_file = filp;
fl332fs/locks.cfl->fl_owner = current;
fl333fs/locks.cfl->fl_wait = NULL;    /* just for cleanliness */
fl341fs/locks.cstatic int flock_make_lock(struct file *filp, struct file_lock *fl,
fl349fs/locks.cfl->fl_type = F_RDLCK;
fl352fs/locks.cfl->fl_type = F_WRLCK;
fl355fs/locks.cfl->fl_type = F_UNLCK;
fl361fs/locks.cfl->fl_flags = F_FLOCK;
fl362fs/locks.cfl->fl_start = 0;
fl363fs/locks.cfl->fl_end = OFFSET_MAX;
fl364fs/locks.cfl->fl_file = filp;
fl365fs/locks.cfl->fl_owner = current;
fl366fs/locks.cfl->fl_wait = NULL;    /* just for cleanliness */
fl446fs/locks.cstruct file_lock *fl;
fl448fs/locks.cfor (fl = file_lock_table; fl != NULL; fl = fl->fl_nextlink) {
fl449fs/locks.cif (fl->fl_owner == NULL)
fl451fs/locks.cif (fl->fl_owner != my_task)
fl453fs/locks.cif (fl->fl_wait == NULL)
fl455fs/locks.cdlock_wait = fl->fl_wait;
fl464fs/locks.c} while (dlock_wait != fl->fl_wait);
fl476fs/locks.cstruct file_lock *fl;
fl485fs/locks.cwhile ((fl = *before) && (fl->fl_flags == F_FLOCK)) {
fl486fs/locks.cif (caller->fl_file == fl->fl_file) {
fl487fs/locks.cif (caller->fl_type == fl->fl_type)
fl492fs/locks.cbefore = &fl->fl_next;
fl504fs/locks.cfor (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) {
fl505fs/locks.cif (!flock_locks_conflict(new_fl, fl))
fl518fs/locks.clocks_insert_block(&fl->fl_block, new_fl);
fl529fs/locks.clocks_delete_block(&fl->fl_block, new_fl);
fl558fs/locks.cstruct file_lock *fl;
fl567fs/locks.cfor (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) {
fl568fs/locks.cif (!posix_locks_conflict(caller, fl))
fl573fs/locks.cif (fl->fl_flags == F_POSIX)
fl574fs/locks.cif (posix_locks_deadlock(caller->fl_owner, fl->fl_owner))
fl576fs/locks.cinterruptible_sleep_on(&fl->fl_wait);
fl592fs/locks.cwhile ((fl = *before) && ((fl->fl_flags == F_FLOCK) ||
fl593fs/locks.c(caller->fl_owner != fl->fl_owner))) {
fl594fs/locks.cbefore = &fl->fl_next;
fl600fs/locks.cwhile ((fl = *before) && (caller->fl_owner == fl->fl_owner)) {
fl603fs/locks.cif (caller->fl_type == fl->fl_type) {
fl604fs/locks.cif (fl->fl_end < caller->fl_start - 1)
fl609fs/locks.cif (fl->fl_start > caller->fl_end + 1)
fl617fs/locks.cif (fl->fl_start > caller->fl_start)
fl618fs/locks.cfl->fl_start = caller->fl_start;
fl620fs/locks.ccaller->fl_start = fl->fl_start;
fl621fs/locks.cif (fl->fl_end < caller->fl_end)
fl622fs/locks.cfl->fl_end = caller->fl_end;
fl624fs/locks.ccaller->fl_end = fl->fl_end;
fl629fs/locks.ccaller = fl;
fl635fs/locks.cif (fl->fl_end < caller->fl_start)
fl637fs/locks.cif (fl->fl_start > caller->fl_end)
fl641fs/locks.cif (fl->fl_start < caller->fl_start)
fl642fs/locks.cleft = fl;
fl646fs/locks.cif (fl->fl_end > caller->fl_end) {
fl647fs/locks.cright = fl;
fl650fs/locks.cif (fl->fl_start >= caller->fl_start) {
fl662fs/locks.cwake_up(&fl->fl_wait);
fl663fs/locks.cfl->fl_start = caller->fl_start;
fl664fs/locks.cfl->fl_end = caller->fl_end;
fl665fs/locks.cfl->fl_type = caller->fl_type;
fl666fs/locks.ccaller = fl;
fl720fs/locks.cstatic struct file_lock *locks_alloc_lock(struct file_lock *fl)
fl733fs/locks.ctmp->fl_flags = fl->fl_flags;
fl734fs/locks.ctmp->fl_owner = fl->fl_owner;
fl735fs/locks.ctmp->fl_file = fl->fl_file;
fl737fs/locks.ctmp->fl_type = fl->fl_type;
fl738fs/locks.ctmp->fl_start = fl->fl_start;
fl739fs/locks.ctmp->fl_end = fl->fl_end;
fl748fs/locks.cstatic void locks_insert_lock(struct file_lock **pos, struct file_lock *fl)
fl750fs/locks.cfl->fl_nextlink = file_lock_table;
fl751fs/locks.cfl->fl_prevlink = NULL;
fl753fs/locks.cfile_lock_table->fl_prevlink = fl;
fl754fs/locks.cfile_lock_table = fl;
fl755fs/locks.cfl->fl_next = *pos;  /* insert into file's list */
fl756fs/locks.c*pos = fl;
fl771fs/locks.cstruct file_lock *fl;
fl774fs/locks.cfl = *fl_p;
fl777fs/locks.cif (fl->fl_nextlink != NULL)
fl778fs/locks.cfl->fl_nextlink->fl_prevlink = fl->fl_prevlink;
fl780fs/locks.cif (fl->fl_prevlink != NULL)
fl781fs/locks.cfl->fl_prevlink->fl_nextlink = fl->fl_nextlink;
fl783fs/locks.cfile_lock_table = fl->fl_nextlink;
fl786fs/locks.cwhile ((bfl = fl->fl_block) != NULL) {
fl787fs/locks.cfl->fl_block = bfl->fl_block;
fl794fs/locks.cwake_up(&fl->fl_wait);
fl795fs/locks.ckfree(fl);