From abeeaf00ecbaef6b29e37148ec869d951f2cbb33 Mon Sep 17 00:00:00 2001 From: mrg Date: Sat, 20 Jun 1998 03:45:27 +0000 Subject: [PATCH] do what the comment says: move this [sun_dkioctl] to compat/sunos. use --- sys/arch/sparc/sparc/disksubr.c | 53 +++------------------------------ 1 file changed, 4 insertions(+), 49 deletions(-) diff --git a/sys/arch/sparc/sparc/disksubr.c b/sys/arch/sparc/sparc/disksubr.c index b502b40f6b82..151bf064b699 100644 --- a/sys/arch/sparc/sparc/disksubr.c +++ b/sys/arch/sparc/sparc/disksubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: disksubr.c,v 1.21 1998/03/29 05:08:46 mrg Exp $ */ +/* $NetBSD: disksubr.c,v 1.22 1998/06/20 03:45:27 mrg Exp $ */ /* * Copyright (c) 1994, 1995 Gordon W. Ross @@ -44,13 +44,14 @@ #include #include -#include #include -#include +#include #if defined(SUN4) #include #endif +#include + #include static char *disklabel_sun_to_bsd __P((char *, struct disklabel *)); @@ -507,52 +508,6 @@ disklabel_bsd_to_sun(lp, cp) return (0); } -/* move this to compat/sunos */ -int -sun_dkioctl(dk, cmd, data, partition) - struct disk *dk; - u_long cmd; - caddr_t data; - int partition; -{ - register struct partition *p; - - switch (cmd) { - case DKIOCGGEOM: -#define geom ((struct sun_dkgeom *)data) - bzero(data, sizeof(*geom)); - geom->sdkc_ncylinders = dk->dk_label->d_ncylinders; - geom->sdkc_acylinders = dk->dk_label->d_acylinders; - geom->sdkc_ntracks = dk->dk_label->d_ntracks; - geom->sdkc_nsectors = dk->dk_label->d_nsectors; - geom->sdkc_interleave = dk->dk_label->d_interleave; - geom->sdkc_sparespercyl = dk->dk_label->d_sparespercyl; - geom->sdkc_rpm = dk->dk_label->d_rpm; - geom->sdkc_pcylinders = - dk->dk_label->d_ncylinders + dk->dk_label->d_acylinders; -#undef geom - break; - case DKIOCINFO: - /* Homey don't do DKIOCINFO */ - bzero(data, sizeof(struct sun_dkctlr)); - break; - case DKIOCGPART: - if (dk->dk_label->d_secpercyl == 0) - return (ERANGE); /* XXX */ - p = &dk->dk_label->d_partitions[partition]; - if (p->p_offset % dk->dk_label->d_secpercyl != 0) - return (ERANGE); /* XXX */ -#define part ((struct sun_dkpart *)data) - part->sdkp_cyloffset = p->p_offset / dk->dk_label->d_secpercyl; - part->sdkp_nsectors = p->p_size; -#undef part - break; - default: - return (-1); - } - return (0); -} - /* * Search the bad sector table looking for the specified sector. * Return index if found.