struct disklabel *lp = cs->sc_dkdev.dk_label; struct cpu_disklabel *clp = cs->sc_dkdev.dk_cpulabel; struct ccdgeom *ccg = &cs->sc_geom;
ccdgetdisklabel(dev)	dev_t dev;{	int unit = ccdunit(dev);	struct ccd_softc *cs = &ccd_softc[unit];	char *errstring;	struct disklabel *lp = cs->sc_dkdev.dk_label;	struct cpu_disklabel *clp = cs->sc_dkdev.dk_cpulabel;	struct ccdgeom *ccg = &cs->sc_geom;	bzero(lp, sizeof(*lp));	bzero(clp, sizeof(*clp));	lp->d_secperunit = cs->sc_size;	lp->d_secsize = ccg->ccg_secsize;	lp->d_nsectors = ccg->ccg_nsectors;	lp->d_ntracks = ccg->ccg_ntracks;	lp->d_ncylinders = ccg->ccg_ncylinders;	lp->d_secpercyl = lp->d_ntracks * lp->d_nsectors;	strncpy(lp->d_typename, "ccd", sizeof(lp->d_typename));	lp->d_type = DTYPE_CCD;	strncpy(lp->d_packname, "fictitious", sizeof(lp->d_packname));	lp->d_rpm = 3600;	lp->d_interleave = 1;	lp->d_flags = 0;	lp->d_partitions[RAW_PART].p_offset = 0;	lp->d_partitions[RAW_PART].p_size = cs->sc_size;	lp->d_partitions[RAW_PART].p_fstype = FS_UNUSED;	lp->d_npartitions = RAW_PART + 1;	lp->d_magic = DISKMAGIC;	lp->d_magic2 = DISKMAGIC;	lp->d_checksum = dkcksum(cs->sc_dkdev.dk_label);	/*	 * Call the generic disklabel extraction routine.	 */	errstring = readdisklabel(CCDLABELDEV(dev), ccdstrategy,	    cs->sc_dkdev.dk_label, cs->sc_dkdev.dk_cpulabel, 0);	if (errstring)		ccdmakedisklabel(cs);#ifdef DEBUG	/* It's actually extremely common to have unlabeled ccds. */	if (ccddebug & CCDB_LABEL)		if (errstring != NULL)			printf("%s: %s\n", cs->sc_xname, errstring);#endif}