FreeBSD/sys/kern/kern_lockf.c
/*
 * Walk the list of locks for an inode and
 * return the first blocking lock.
 */
Walk the list of locks for an inode and
return the first blocking lock.
Walk the list of locks for an inode and return the first blocking lock .
static struct lockf_entry *
lf_getblock(struct lockf *state, struct lockf_entry *lock)
{
	struct lockf_entry *overlap;
	LIST_FOREACH(overlap, &state->ls_active, lf_link) {
		if (overlap->lf_start > lock->lf_end)
			break;
		if (!lf_blocks(lock, overlap))
			continue;
		return (overlap);
	}
	return (NOLOCKF);
}
static struct lockf_entry * lf_getblock ( struct lockf * state , struct lockf_entry * lock ) { struct lockf_entry * overlap ; LIST_FOREACH ( overlap , & state -> ls_active , lf_link ) { if ( overlap -> lf_start > lock -> lf_end ) break ; if ( ! lf_blocks ( lock , overlap ) ) continue ; return ( overlap ) ; } return ( NOLOCKF ) ; }
Walk the list of locks for an inode and
 return the first blocking lock.
Walk the list of locks for an inode and return the first blocking lock .
/*
		 * We may assume that the active list is sorted by
		 * lf_start.
		 */