} else { IO_BUF_ERR(bp, ENOSPC, raidPtr->raidid); return (ENOSPC); }
rf_DoAccess(    RF_Raid_t * raidPtr,    RF_IoType_t type,    int async_flag,    RF_RaidAddr_t raidAddress,    RF_SectorCount_t numBlocks,    caddr_t bufPtr,    void *bp_in,    RF_DagHeader_t ** paramDAG,    RF_AccessStripeMapHeader_t ** paramASM,    RF_RaidAccessFlags_t flags,    RF_RaidAccessDesc_t ** paramDesc,    void (*cbF) (struct buf *),    void *cbA)/*type should be read or writeasync_flag should be RF_TRUE or RF_FALSEbp_in is a buf pointer.  void * to facilitate ignoring it outside the kernel*/{	int     tid;	RF_RaidAccessDesc_t *desc;	caddr_t lbufPtr = bufPtr;	struct buf *bp = (struct buf *) bp_in;#if DFSTRACE > 0	struct {		RF_uint64 raidAddr;		int     numBlocks;		char    type;	}       dfsrecord;#endif				/* DFSTRACE > 0 */	raidAddress += rf_raidSectorOffset;	if (!raidPtr->valid) {		RF_ERRORMSG("RAIDframe driver not successfully configured.  Rejecting access.\n");		IO_BUF_ERR(bp, EINVAL, raidPtr->raidid);		return (EINVAL);	}#if defined(_KERNEL) && DFSTRACE > 0	if (rf_DFSTraceAccesses) {		dfsrecord.raidAddr = raidAddress;		dfsrecord.numBlocks = numBlocks;		dfsrecord.type = type;		dfs_log(DFS_NOTE, (char *) &dfsrecord, sizeof(dfsrecord), 0);	}#endif				/* _KERNEL && DFSTRACE > 0 */	rf_get_threadid(tid);	if (rf_accessDebug) {		printf("logBytes is: %d %d %d\n", raidPtr->raidid,		    raidPtr->logBytesPerSector,		    (int) rf_RaidAddressToByte(raidPtr, numBlocks));		printf("[%d] %s raidAddr %d (stripeid %d-%d) numBlocks %d (%d bytes) buf 0x%lx\n", tid,		    (type == RF_IO_TYPE_READ) ? "READ" : "WRITE", (int) raidAddress,		    (int) rf_RaidAddressToStripeID(&raidPtr->Layout, raidAddress),		    (int) rf_RaidAddressToStripeID(&raidPtr->Layout, raidAddress + numBlocks - 1),		    (int) numBlocks,		    (int) rf_RaidAddressToByte(raidPtr, numBlocks),		    (long) bufPtr);	}	if (raidAddress + numBlocks > raidPtr->totalSectors) {		printf("DoAccess: raid addr %lu too large to access %lu sectors.  Max legal addr is %lu\n",		    (u_long) raidAddress, (u_long) numBlocks, (u_long) raidPtr->totalSectors);		if (type == RF_IO_TYPE_READ) {			IO_BUF_ERR(bp, ENOSPC, raidPtr->raidid);			return (ENOSPC);		} else {			IO_BUF_ERR(bp, ENOSPC, raidPtr->raidid);			return (ENOSPC);		}	}	desc = rf_AllocRaidAccDesc(raidPtr, type, raidAddress,	    numBlocks, lbufPtr, bp, paramDAG, paramASM,	    flags, cbF, cbA, raidPtr->Layout.map->states);	if (desc == NULL) {		return (ENOMEM);	}	RF_ETIMER_START(desc->tracerec.tot_timer);	desc->async_flag = async_flag;	rf_ContinueRaidAccess(desc);	return (0);}