FreeBSD/sys/kern/kern_rangelock.c
/*
 * Unlock the sub-range of granted lock.
 */
Unlock the sub-range of granted lock.
Unlock the sub - range of granted lock .
void *
rangelock_unlock_range(struct rangelock *lock, void *cookie, off_t start,
    off_t end, struct mtx *ilk)
{
	struct rl_q_entry *entry;
	MPASS(lock != NULL && cookie != NULL && ilk != NULL);
	entry = cookie;
	KASSERT(entry->rl_q_flags & RL_LOCK_GRANTED,
	    ("Unlocking non-granted lock"));
	KASSERT(entry->rl_q_start == start, ("wrong start"));
	KASSERT(entry->rl_q_end >= end, ("wrong end"));
	mtx_lock(ilk);
	if (entry->rl_q_end == end) {
		rangelock_unlock_locked(lock, cookie, ilk);
		return (NULL);
	}
	entry->rl_q_end = end;
	rangelock_calc_block(lock);
	mtx_unlock(ilk);
	return (cookie);
}
void * rangelock_unlock_range ( struct rangelock * lock , void * cookie , off_t start , off_t end , struct mtx * ilk ) { struct rl_q_entry * entry ; MPASS ( lock != NULL && cookie != NULL && ilk != NULL ) ; entry = cookie ; KASSERT ( entry -> rl_q_flags & RL_LOCK_GRANTED , ( " " ) ) ; KASSERT ( entry -> rl_q_start == start , ( " " ) ) ; KASSERT ( entry -> rl_q_end >= end , ( " " ) ) ; mtx_lock ( ilk ) ; if ( entry -> rl_q_end == end ) { rangelock_unlock_locked ( lock , cookie , ilk ) ; return ( NULL ) ; } entry -> rl_q_end = end ; rangelock_calc_block ( lock ) ; mtx_unlock ( ilk ) ; return ( cookie ) ; }
Unlock the sub-range of granted lock.
Unlock the sub - range of granted lock .