error = sd_reassign_blocks(sd, *(*(int **)addr));
error = sd_reassign_blocks(sd, (*(int *)addr));
sdioctl(dev, cmd, addr, flag, p)	dev_t dev;	u_long cmd;	caddr_t addr;	int flag;	struct proc *p;{	struct sd_softc *sd = sd_cd.cd_devs[SDUNIT(dev)];	int error;	SC_DEBUG(sd->sc_link, SDEV_DB2, ("sdioctl 0x%lx ", cmd));	/*	 * If the device is not valid.. abandon ship	 */	if ((sd->sc_link->flags & SDEV_MEDIA_LOADED) == 0)		return EIO;	switch (cmd) {	case DIOCGDINFO:		*(struct disklabel *)addr = *(sd->sc_dk.dk_label);		return 0;	case DIOCGPART:		((struct partinfo *)addr)->disklab = sd->sc_dk.dk_label;		((struct partinfo *)addr)->part =		    &sd->sc_dk.dk_label->d_partitions[SDPART(dev)];		return 0;	case DIOCWDINFO:	case DIOCSDINFO:		if ((flag & FWRITE) == 0)			return EBADF;		if ((error = sdlock(sd)) != 0)			return error;		sd->flags |= SDF_LABELLING;		error = setdisklabel(sd->sc_dk.dk_label,		    (struct disklabel *)addr, /*sd->sc_dk.dk_openmask : */0,		    sd->sc_dk.dk_cpulabel);		if (error == 0) {			if (cmd == DIOCWDINFO)				error = writedisklabel(SDLABELDEV(dev),				    sdstrategy, sd->sc_dk.dk_label,				    sd->sc_dk.dk_cpulabel);		}		sd->flags &= ~SDF_LABELLING;		sdunlock(sd);		return error;	case DIOCWLABEL:		if ((flag & FWRITE) == 0)			return EBADF;		if (*(int *)addr)			sd->flags |= SDF_WLABEL;		else			sd->flags &= ~SDF_WLABEL;		return 0;	case DIOCLOCK:		return scsi_prevent(sd->sc_link,		    (*(int *)addr) ? PR_PREVENT : PR_ALLOW, 0);	case MTIOCTOP:		if (((struct mtop *)addr)->mt_op != MTOFFL)			return EIO;		/* FALLTHROUGH */	case DIOCEJECT:		if ((sd->sc_link->flags & SDEV_REMOVABLE) == 0)			return ENOTTY;		sd->sc_link->flags |= SDEV_EJECTING;		return 0;	case SCIOCREASSIGN:		if ((flag & FWRITE) == 0)			return EBADF;		error = sd_reassign_blocks(sd, *(*(int **)addr));		return error;	default:		if (SDPART(dev) != RAW_PART)			return ENOTTY;		return scsi_do_ioctl(sd->sc_link, dev, cmd, addr, flag, p);	}#ifdef DIAGNOSTIC	panic("sdioctl: impossible");#endif}