int
rf_State_LastState(RF_RaidAccessDesc_t *desc)
{
	void    (*callbackFunc) (RF_CBParam_t) = desc->callbackFunc;
	RF_CBParam_t callbackArg;

	callbackArg.p = desc->callbackArg;

	/*
	 * We don't support non-async IO.
	 */
	KASSERT(desc->async_flag);

	/*
	 * That's all the IO for this one... unbusy the 'disk'.
	 */

	rf_disk_unbusy(desc);

	/*
	 * Wakeup any requests waiting to go.
	 */

	rf_lock_mutex2(desc->raidPtr->mutex);
	desc->raidPtr->openings++;
	rf_unlock_mutex2(desc->raidPtr->mutex);

	rf_lock_mutex2(desc->raidPtr->iodone_lock);
	rf_signal_cond2(desc->raidPtr->iodone_cv);
	rf_unlock_mutex2(desc->raidPtr->iodone_lock);

	/*
	 * The parity_map hook has to go here, because the iodone
	 * callback goes straight into the kintf layer.
	 */
	if (desc->raidPtr->parity_map != NULL &&
	    desc->type == RF_IO_TYPE_WRITE)
		rf_paritymap_end(desc->raidPtr->parity_map, 
		    desc->raidAddress, desc->numBlocks);

	/* printf("Calling biodone on 0x%x\n",desc->bp); */
	biodone(desc->bp);	/* access came through ioctl */

	if (callbackFunc)
		callbackFunc(callbackArg);
	rf_FreeRaidAccDesc(desc);

	return RF_FALSE;
}
Beispiel #2
0
int
rf_State_LastState(RF_RaidAccessDesc_t *desc)
{
	void (*callbackFunc) (RF_CBParam_t) = desc->callbackFunc;
	RF_CBParam_t callbackArg;

	callbackArg.p = desc->callbackArg;

	/*
	 * If this is not an async request, wake up the caller.
	 */
	if (desc->async_flag == 0)
		wakeup(desc->bp);

	/*
	 * That's all the IO for this one... Unbusy the 'disk'.
	 */

	rf_disk_unbusy(desc);

	/*
	 * Wakeup any requests waiting to go.
	 */

	RF_LOCK_MUTEX(((RF_Raid_t *) desc->raidPtr)->mutex);
	((RF_Raid_t *) desc->raidPtr)->openings++;
	RF_UNLOCK_MUTEX(((RF_Raid_t *) desc->raidPtr)->mutex);

	/* Wake up any pending I/O. */
	raidstart(((RF_Raid_t *) desc->raidPtr));

	/* printf("%s: Calling biodone on 0x%x.\n", __func__, desc->bp); */
	splassert(IPL_BIO);
	biodone(desc->bp);	/* Access came through ioctl. */

	if (callbackFunc)
		callbackFunc(callbackArg);
	rf_FreeRaidAccDesc(desc);

	return RF_FALSE;
}