rem: mutex_unlock(&locking->mutex);
add: release_sem_etc(locking->lock, 1, B_DO_NOT_RESCHEDULE);
context: release_advisory_lock(struct vnode *vnode, struct flock *flock){	FUNCTION(("release_advisory_lock(vnode = %p, flock = %p)\n", vnode, flock));	struct advisory_locking *locking = get_advisory_locking(vnode);	if (locking == NULL)		return flock != NULL ? B_BAD_VALUE : B_OK;	team_id team = team_get_current_team_id();	// find matching lock entry	status_t status = B_BAD_VALUE;	struct advisory_lock *lock = NULL;	while ((lock = (struct advisory_lock *)list_get_next_item(&locking->locks, lock)) != NULL) {		if (lock->team == team && (flock == NULL || (flock != NULL			&& lock->offset == flock->l_start			&& lock->length == flock->l_len))) {			// we found our lock, free it			list_remove_item(&locking->locks, lock);			free(lock);			status = B_OK;			break;		}	}	bool removeLocking = list_is_empty(&locking->locks);	release_sem_etc(locking->wait_sem, 1, B_RELEASE_ALL);	put_advisory_locking(locking);	if (status < B_OK)		return status;	if (removeLocking) {		// we can remove the whole advisory locking structure; it's no longer used		mutex_lock(&sVnodeMutex);		locking = vnode->advisory_locking;		if (locking != NULL)			mutex_lock(&locking->mutex);		// the locking could have been changed in the mean time		if (list_is_empty(&locking->locks))			vnode->advisory_locking = NULL;		else {			removeLocking = false;			mutex_unlock(&locking->mutex);		}		mutex_unlock(&sVnodeMutex);	}	if (removeLocking) {		// we've detached the locking from the vnode, so we can safely delete it		mutex_destroy(&locking->mutex);		delete_sem(locking->wait_sem);		free(locking);	}	return B_OK;}