printf("raidPtrs[%d] is NULL\n", raidID);
printf("WARNING: raidPtrs[%d] is NULL\n", raidID); numraid = raidID; return;
void	rf_InitBP __P((struct buf *, struct vnode *, unsigned, dev_t,	    RF_SectorNum_t, RF_SectorCount_t, caddr_t, void (*)(struct buf *),	    void *, int, struct proc *));#define Dprintf0(s)       if (rf_queueDebug) \	rf_debug_printf(s,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)#define Dprintf1(s,a)     if (rf_queueDebug) \	rf_debug_printf(s,a,NULL,NULL,NULL,NULL,NULL,NULL,NULL)#define Dprintf2(s,a,b)   if (rf_queueDebug) \	rf_debug_printf(s,a,b,NULL,NULL,NULL,NULL,NULL,NULL)#define Dprintf3(s,a,b,c) if (rf_queueDebug) \	rf_debug_printf(s,a,b,c,NULL,NULL,NULL,NULL,NULL)int raidmarkclean(dev_t dev, struct vnode *b_vp, int);int raidmarkdirty(dev_t dev, struct vnode *b_vp, int);void	raidattach __P((int));int	raidsize __P((dev_t));void	rf_DiskIOComplete(RF_DiskQueue_t *, RF_DiskQueueData_t *, int);void	rf_CopybackReconstructedData(RF_Raid_t *raidPtr);int	raidinit __P((dev_t,RF_Raid_t *,int));int	raidopen __P((dev_t, int, int, struct proc *));int	raidclose __P((dev_t, int, int, struct proc *));int	raidioctl __P((dev_t, u_long, caddr_t, int, struct proc *));int	raidwrite __P((dev_t, struct uio *, int));int	raidread __P((dev_t, struct uio *, int));void	raidstrategy __P((struct buf *));int	raiddump __P((dev_t, daddr_t, caddr_t, size_t));int raidwrite_component_label(dev_t, struct vnode *, RF_ComponentLabel_t *);int raidread_component_label(dev_t, struct vnode *, RF_ComponentLabel_t *);void rf_update_component_labels( RF_Raid_t *);/* * Pilfered from ccd.c */struct raidbuf {	struct buf rf_buf;	/* new I/O buf.	 MUST BE FIRST!!! */	struct buf *rf_obp;	/* ptr. to original I/O buf */	int	rf_flags;	/* misc. flags */	RF_DiskQueueData_t *req;/* the request that this was part of.. */};#define RAIDGETBUF() malloc(sizeof (struct raidbuf), M_RAIDFRAME, M_NOWAIT)#define	RAIDPUTBUF(buf) free(buf, M_RAIDFRAME)/* * XXX Not sure if the following should be replacing the raidPtrs above, * or if it should be used in conjunction with that... */struct raid_softc {	int	 sc_flags;		/* flags */	int	 sc_cflags;		/* configuration flags */	size_t	 sc_size;		/* size of the raid device */	dev_t	 sc_dev;		/* our device..*/	char	 sc_xname[20];		/* XXX external name */	struct disk sc_dkdev;		/* generic disk device info */};/* sc_flags */#define RAIDF_INITED	0x01	/* unit has been initialized */#define RAIDF_WLABEL	0x02	/* label area is writable */#define RAIDF_LABELLING	0x04	/* unit is currently being labelled */#define RAIDF_WANTED	0x40	/* someone is waiting to obtain a lock */#define RAIDF_LOCKED	0x80	/* unit is locked */#define	raidunit(x)	DISKUNIT(x)static int numraid = 0;/* * Allow RAIDOUTSTANDING number of simultaneous IO's to this RAID device. * Be aware that large numbers can allow the driver to consume a lot of * kernel memory, especially on writes... */#ifndef RAIDOUTSTANDING#define RAIDOUTSTANDING   10#endif#define RAIDLABELDEV(dev)	\	(MAKEDISKDEV(major((dev)), raidunit((dev)), RAW_PART))/* declared here, and made public, for the benefit of KVM stuff.. */struct raid_softc *raid_softc;void	raidgetdefaultlabel	     __P((RF_Raid_t *, struct raid_softc *, struct disklabel *));void	raidgetdisklabel __P((dev_t));void	raidmakedisklabel __P((struct raid_softc *));int	raidlock __P((struct raid_softc *));void	raidunlock __P((struct raid_softc *));int	raidlookup __P((char *, struct proc *p, struct vnode **));void	rf_markalldirty __P((RF_Raid_t *));voidraidattach(num)	int num;{	int raidID;	int i, rc;	db1_printf(("raidattach: Asked for %d units\n", num));	if (num <= 0) {#ifdef DIAGNOSTIC		panic("raidattach: count <= 0");#endif		return;	}	/* This is where all the initialization stuff gets done. */	/* Make some space for requested number of units... */	RF_Calloc(raidPtrs, num, sizeof(RF_Raid_t *), (RF_Raid_t **));	if (raidPtrs == NULL) {		panic("raidPtrs is NULL!!\n");	}	rc = rf_mutex_init(&rf_sparet_wait_mutex);	if (rc) {	        RF_PANIC();        }	rf_sparet_wait_queue = rf_sparet_resp_queue = NULL;	recon_queue = NULL;	for (i = 0; i < numraid; i++)	        raidPtrs[i] = NULL;	rc = rf_BootRaidframe();	if (rc == 0)	        printf("Kernelized RAIDframe activated\n");	else	        panic("Serious error booting RAID!!\n");		rf_kbooted = RFK_BOOT_GOOD;	/*	 * Put together some datastructures like the CCD device does..	 * This lets us lock the device and what-not when it gets opened.	 */		raid_softc = (struct raid_softc *)	    malloc(num * sizeof (struct raid_softc), M_RAIDFRAME, M_NOWAIT);	if (raid_softc == NULL) {		printf("WARNING: no memory for RAIDframe driver\n");		return;	}	numraid = num;	bzero(raid_softc, num * sizeof (struct raid_softc));	for (raidID = 0; raidID < num; raidID++) {		RF_Calloc(raidPtrs[raidID], 1, sizeof (RF_Raid_t),		    (RF_Raid_t *));		if (raidPtrs[raidID] == NULL) {			printf("raidPtrs[%d] is NULL\n", raidID);		}	}}