taglinefilesource code
fl91fs/locks.cstatic int flock_make_lock(struct file *filp, struct file_lock *fl,
fl93fs/locks.cstatic int posix_make_lock(struct file *filp, struct file_lock *fl,
fl108fs/locks.cstatic struct file_lock *locks_alloc_lock(struct file_lock *fl);
fl109fs/locks.cstatic void locks_insert_lock(struct file_lock **pos, struct file_lock *fl);
fl110fs/locks.cstatic void locks_delete_lock(struct file_lock **fl, unsigned int wait);
fl111fs/locks.cstatic char *lock_get_status(struct file_lock *fl, char *p, int id, char *pfx);
fl116fs/locks.cstatic inline void locks_free_lock(struct file_lock *fl)
fl118fs/locks.ckfree(fl);
fl137fs/locks.cstruct file_lock *fl)
fl143fs/locks.cbfl->fl_block = fl;
fl144fs/locks.cfl->fl_block = NULL;
fl150fs/locks.cstruct file_lock *fl)
fl155fs/locks.cif (tfl == fl) {
fl156fs/locks.cbfl->fl_block = fl->fl_block;
fl157fs/locks.cfl->fl_block = NULL;
fl193fs/locks.cstruct file_lock *fl,file_lock;
fl209fs/locks.cfor (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) {
fl210fs/locks.cif (posix_locks_conflict(&file_lock, fl)) {
fl211fs/locks.cflock.l_pid = fl->fl_owner->pid;
fl212fs/locks.cflock.l_start = fl->fl_start;
fl213fs/locks.cflock.l_len = fl->fl_end == OFFSET_MAX ? 0 :
fl214fs/locks.cfl->fl_end - fl->fl_start + 1;
fl216fs/locks.cflock.l_type = fl->fl_type;
fl307fs/locks.cstruct file_lock *fl;
fl315fs/locks.cwhile ((fl = *before) != NULL) {
fl316fs/locks.cif (((fl->fl_flags & F_POSIX) && (fl->fl_owner == task)) ||
fl317fs/locks.c((fl->fl_flags & F_FLOCK) && (fl->fl_file == filp) &&
fl321fs/locks.cbefore = &fl->fl_next;
fl339fs/locks.cstruct file_lock *fl;
fl343fs/locks.cfor (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
fl344fs/locks.cif ((fl->fl_flags & F_POSIX) && (fl->fl_owner != current))
fl366fs/locks.cstruct file_lock *fl;
fl373fs/locks.cfor (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
fl374fs/locks.cif ((fl->fl_flags & F_FLOCK) ||
fl375fs/locks.c((fl->fl_flags & F_POSIX) && (fl->fl_owner == current)))
fl377fs/locks.cif (fl->fl_end < offset ||
fl378fs/locks.cfl->fl_start >= offset + count)
fl385fs/locks.cfl->fl_type == F_WRLCK) {
fl390fs/locks.cif (locks_deadlock(current, fl->fl_owner))
fl392fs/locks.cinterruptible_sleep_on(&fl->fl_wait);
fl410fs/locks.cstatic int posix_make_lock(struct file *filp, struct file_lock *fl,
fl415fs/locks.cfl->fl_flags = F_POSIX;
fl421fs/locks.cfl->fl_type = l->l_type;
fl424fs/locks.cfl->fl_type = F_RDLCK;
fl425fs/locks.cfl->fl_flags |= F_BROKEN;
fl428fs/locks.cfl->fl_type = F_WRLCK;
fl429fs/locks.cfl->fl_flags |= F_BROKEN;
fl451fs/locks.cfl->fl_start = start;  /* we record the absolute position */
fl452fs/locks.cif ((l->l_len == 0) || ((fl->fl_end = start + l->l_len - 1) < 0))
fl453fs/locks.cfl->fl_end = OFFSET_MAX;
fl455fs/locks.cfl->fl_file = filp;
fl456fs/locks.cfl->fl_owner = current;
fl457fs/locks.cfl->fl_wait = NULL;    /* just for cleanliness */
fl465fs/locks.cstatic int flock_make_lock(struct file *filp, struct file_lock *fl,
fl473fs/locks.cfl->fl_type = F_RDLCK;
fl476fs/locks.cfl->fl_type = F_WRLCK;
fl479fs/locks.cfl->fl_type = F_UNLCK;
fl485fs/locks.cfl->fl_flags = F_FLOCK;
fl486fs/locks.cfl->fl_start = 0;
fl487fs/locks.cfl->fl_end = OFFSET_MAX;
fl488fs/locks.cfl->fl_file = filp;
fl489fs/locks.cfl->fl_owner = current;
fl490fs/locks.cfl->fl_wait = NULL;    /* just for cleanliness */
fl570fs/locks.cstruct file_lock *fl;
fl575fs/locks.cfor (fl = file_lock_table; fl != NULL; fl = fl->fl_nextlink) {
fl576fs/locks.cif (fl->fl_owner == NULL || fl->fl_wait == NULL)
fl578fs/locks.cdlock_wait = fl->fl_wait;
fl581fs/locks.cif (fl->fl_owner == my_task) {
fl584fs/locks.cblocked_task = fl->fl_owner;
fl588fs/locks.c} while (dlock_wait != fl->fl_wait);
fl600fs/locks.cstruct file_lock *fl;
fl609fs/locks.cwhile ((fl = *before) && (fl->fl_flags & F_FLOCK)) {
fl610fs/locks.cif (caller->fl_file == fl->fl_file) {
fl611fs/locks.cif (caller->fl_type == fl->fl_type)
fl616fs/locks.cbefore = &fl->fl_next;
fl628fs/locks.cfor (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) {
fl629fs/locks.cif (!flock_locks_conflict(new_fl, fl))
fl646fs/locks.cif (locks_deadlock(new_fl->fl_owner, fl->fl_owner)) {
fl650fs/locks.clocks_insert_block(fl, new_fl);
fl660fs/locks.clocks_delete_block(fl, new_fl);
fl689fs/locks.cstruct file_lock *fl;
fl698fs/locks.cfor (fl = filp->f_inode->i_flock; fl != NULL; fl = fl->fl_next) {
fl699fs/locks.cif (!posix_locks_conflict(caller, fl))
fl704fs/locks.cif (locks_deadlock(caller->fl_owner, fl->fl_owner))
fl706fs/locks.cinterruptible_sleep_on(&fl->fl_wait);
fl722fs/locks.cwhile ((fl = *before) && ((fl->fl_flags & F_FLOCK) ||
fl723fs/locks.c(caller->fl_owner != fl->fl_owner))) {
fl724fs/locks.cbefore = &fl->fl_next;
fl730fs/locks.cwhile ((fl = *before) && (caller->fl_owner == fl->fl_owner)) {
fl733fs/locks.cif (caller->fl_type == fl->fl_type) {
fl734fs/locks.cif (fl->fl_end < caller->fl_start - 1)
fl739fs/locks.cif (fl->fl_start > caller->fl_end + 1)
fl747fs/locks.cif (fl->fl_start > caller->fl_start)
fl748fs/locks.cfl->fl_start = caller->fl_start;
fl750fs/locks.ccaller->fl_start = fl->fl_start;
fl751fs/locks.cif (fl->fl_end < caller->fl_end)
fl752fs/locks.cfl->fl_end = caller->fl_end;
fl754fs/locks.ccaller->fl_end = fl->fl_end;
fl759fs/locks.ccaller = fl;
fl766fs/locks.cif (fl->fl_end < caller->fl_start)
fl768fs/locks.cif (fl->fl_start > caller->fl_end)
fl772fs/locks.cif (fl->fl_start < caller->fl_start)
fl773fs/locks.cleft = fl;
fl777fs/locks.cif (fl->fl_end > caller->fl_end) {
fl778fs/locks.cright = fl;
fl781fs/locks.cif (fl->fl_start >= caller->fl_start) {
fl794fs/locks.cwake_up(&fl->fl_wait);
fl795fs/locks.cfl->fl_start = caller->fl_start;
fl796fs/locks.cfl->fl_end = caller->fl_end;
fl797fs/locks.cfl->fl_type = caller->fl_type;
fl798fs/locks.ccaller = fl;
fl805fs/locks.cbefore = &fl->fl_next;
fl840fs/locks.cstatic struct file_lock *locks_alloc_lock(struct file_lock *fl)
fl853fs/locks.ctmp->fl_flags = fl->fl_flags;
fl854fs/locks.ctmp->fl_owner = fl->fl_owner;
fl855fs/locks.ctmp->fl_file = fl->fl_file;
fl857fs/locks.ctmp->fl_type = fl->fl_type;
fl858fs/locks.ctmp->fl_start = fl->fl_start;
fl859fs/locks.ctmp->fl_end = fl->fl_end;
fl868fs/locks.cstatic void locks_insert_lock(struct file_lock **pos, struct file_lock *fl)
fl870fs/locks.cfl->fl_nextlink = file_lock_table;
fl871fs/locks.cfl->fl_prevlink = NULL;
fl873fs/locks.cfile_lock_table->fl_prevlink = fl;
fl874fs/locks.cfile_lock_table = fl;
fl875fs/locks.cfl->fl_next = *pos;  /* insert into file's list */
fl876fs/locks.c*pos = fl;
fl892fs/locks.cstruct file_lock *fl;
fl896fs/locks.cfl = *fl_p;
fl897fs/locks.c*fl_p = fl->fl_next;
fl898fs/locks.cpfl = fl->fl_prevlink;
fl899fs/locks.cnfl = fl->fl_nextlink;
fl909fs/locks.cwhile ((nfl = fl->fl_block) != NULL) {
fl910fs/locks.cfl->fl_block = nfl->fl_block;
fl917fs/locks.cwake_up(&fl->fl_wait);
fl918fs/locks.ckfree(fl);
fl924fs/locks.cstatic char *lock_get_status(struct file_lock *fl, char *p, int id, char *pfx)
fl929fs/locks.cif (fl->fl_flags & F_POSIX) {
fl931fs/locks.c(fl->fl_flags & F_BROKEN) ? "BROKEN" : "POSIX ",
fl932fs/locks.c((fl->fl_file->f_inode->i_mode & (S_IXGRP | S_ISGID))
fl938fs/locks.cp += sprintf(p, "%s ", (fl->fl_type == F_RDLCK) ? "READ " : "WRITE");
fl940fs/locks.cfl->fl_owner->pid, fl->fl_file->f_inode->i_dev,
fl941fs/locks.cfl->fl_file->f_inode->i_ino, fl->fl_start,
fl942fs/locks.cfl->fl_end);
fl944fs/locks.c(long)fl, (long)fl->fl_prevlink, (long)fl->fl_nextlink,
fl945fs/locks.c(long)fl->fl_next, (long)fl->fl_block, id, pfx);
fl946fs/locks.cif ((wt = fl->fl_wait) != NULL) {
fl950fs/locks.c} while (wt != fl->fl_wait);
fl958fs/locks.cstruct file_lock *fl;
fl964fs/locks.cfor (fl = file_lock_table, i = 1; fl != NULL; fl = fl->fl_nextlink, i++) {
fl965fs/locks.cp = lock_get_status(fl, p, i, "");
fl966fs/locks.cfor (bfl = fl; bfl->fl_block != NULL; bfl = bfl->fl_block)