Lines Matching refs:lf
448 struct lockf **lf = lock->lf_head; in lf_coalesce_adjacent() local
450 while (*lf != NOLOCKF) { in lf_coalesce_adjacent()
452 if ((*lf == lock) || in lf_coalesce_adjacent()
453 ((*lf)->lf_id != lock->lf_id) || in lf_coalesce_adjacent()
454 ((*lf)->lf_type != lock->lf_type)) { in lf_coalesce_adjacent()
455 lf = &(*lf)->lf_next; in lf_coalesce_adjacent()
463 if (LF_END(*lf) < OFF_MAX && in lf_coalesce_adjacent()
464 (LF_END(*lf) + 1) == lock->lf_start) { in lf_coalesce_adjacent()
465 struct lockf *adjacent = *lf; in lf_coalesce_adjacent()
468 lock->lf_start = (*lf)->lf_start; in lf_coalesce_adjacent()
469 *lf = lock; in lf_coalesce_adjacent()
470 lf = &(*lf)->lf_next; in lf_coalesce_adjacent()
479 (LF_END(lock) + 1) == (*lf)->lf_start) { in lf_coalesce_adjacent()
480 struct lockf *adjacent = *lf; in lf_coalesce_adjacent()
483 lock->lf_end = (*lf)->lf_end; in lf_coalesce_adjacent()
484 lock->lf_next = (*lf)->lf_next; in lf_coalesce_adjacent()
485 lf = &lock->lf_next; in lf_coalesce_adjacent()
494 lf = &(*lf)->lf_next; in lf_coalesce_adjacent()
994 struct lockf *lf = *head; in lf_clearlock() local
998 if (lf == NOLOCKF) { in lf_clearlock()
1010 while ((ovcase = lf_findoverlap(lf, unlock, SELF, &prev, &overlap)) != OVERLAP_NONE) { in lf_clearlock()
1049 lf = overlap->lf_next; in lf_clearlock()
1057 lf = overlap->lf_next; in lf_clearlock()
1093 struct lockf *lf = *head; in lf_transferlock() local
1097 if (lf == NOLOCKF) { in lf_transferlock()
1109 while ((ovcase = lf_findoverlap(lf, transfer, SELF, &prev, &overlap)) != OVERLAP_NONE) { in lf_transferlock()
1121 lf = overlap->lf_next; in lf_transferlock()
1209 struct lockf **prev, *overlap, *lf = *(lock->lf_head); in lf_getblock() local
1212 lf_findoverlap(lf, lock, OTHERS, &prev, &overlap) != OVERLAP_NONE; in lf_getblock()
1213 lf = overlap->lf_next) { in lf_getblock()
1283 lf_findoverlap(struct lockf *lf, struct lockf *lock, int type, in lf_findoverlap() argument
1288 *overlap = lf; in lf_findoverlap()
1289 if (lf == NOLOCKF) { in lf_findoverlap()
1299 while (lf != NOLOCKF) { in lf_findoverlap()
1300 if (((type & SELF) && lf->lf_id != lock->lf_id) || in lf_findoverlap()
1301 ((type & OTHERS) && lf->lf_id == lock->lf_id)) { in lf_findoverlap()
1315 *prev = &lf->lf_next; in lf_findoverlap()
1316 *overlap = lf = lf->lf_next; in lf_findoverlap()
1326 lf_print("\tchecking", lf); in lf_findoverlap()
1332 const off_t lfstart = lf->lf_start; in lf_findoverlap()
1333 const off_t lfend = LF_END(lf); in lf_findoverlap()
1346 *prev = &lf->lf_next; in lf_findoverlap()
1347 *overlap = lf = lf->lf_next; in lf_findoverlap()
1516 #define GET_LF_OWNER_PID(lf) (proc_pid((lf)->lf_owner)) argument
1579 struct lockf *lf, *blk; in lf_printlist() local
1587 for (lf = lock->lf_vnode->v_lockf; lf; lf = lf->lf_next) { in lf_printlist()
1588 printf("\tlock %p for ", (void *)lf); in lf_printlist()
1589 if (lf->lf_flags & F_POSIX) { in lf_printlist()
1591 lf->lf_id, GET_LF_OWNER_PID(lf)); in lf_printlist()
1592 } else if (lf->lf_flags & F_OFD_LOCK) { in lf_printlist()
1594 lf->lf_id, GET_LF_OWNER_PID(lf)); in lf_printlist()
1596 printf("id %p", (void *)lf->lf_id); in lf_printlist()
1599 lf->lf_type == F_RDLCK ? "shared" : in lf_printlist()
1600 lf->lf_type == F_WRLCK ? "exclusive" : in lf_printlist()
1601 lf->lf_type == F_UNLCK ? "unlock" : in lf_printlist()
1602 "unknown", (uint64_t)lf->lf_start, (uint64_t)lf->lf_end); in lf_printlist()
1603 TAILQ_FOREACH(blk, &lf->lf_blkhd, lf_block) { in lf_printlist()