From 01cb4b7be751fece371f468c3391b4b756342ccf Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sun, 25 Aug 2013 10:50:56 +0000 Subject: Do not require that `extra' partitions (i-p) start on cylinder boundaries; this was inherited from sparc when adding 16 partition support, but disklabel(8) does not enforce such alignment, and since UniOS never did for the `traditional' partitions (a-h), there is no good reason to keep this. This makes partitions i-p really functional. --- sys/arch/luna88k/luna88k/disksubr.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'sys') diff --git a/sys/arch/luna88k/luna88k/disksubr.c b/sys/arch/luna88k/luna88k/disksubr.c index cd298887cc9..74eca5615bd 100644 --- a/sys/arch/luna88k/luna88k/disksubr.c +++ b/sys/arch/luna88k/luna88k/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.54 2013/06/11 16:42:09 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.55 2013/08/25 10:50:55 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.12 2002/02/19 17:09:44 wiz Exp $ */ /* @@ -291,10 +291,7 @@ disklabel_om_to_bsd(struct sun_disklabel *sl, struct disklabel *lp) spp = &sl->sl_part[i]; npp = &lp->d_partitions[i]; /* UniOS label uses blkoffset, not cyloffset */ - if (sl->sl_rpm == 0) - DL_SETPOFFSET(npp, spp->sdkp_cyloffset); - else - DL_SETPOFFSET(npp, spp->sdkp_cyloffset * secpercyl); + DL_SETPOFFSET(npp, spp->sdkp_cyloffset); DL_SETPSIZE(npp, spp->sdkp_nsectors); if (DL_GETPSIZE(npp) == 0) { npp->p_fstype = FS_UNUSED; @@ -347,8 +344,7 @@ disklabel_om_to_bsd(struct sun_disklabel *sl, struct disklabel *lp) for (i = 0; i < SUNXPART; i++) { spp = &sl->sl_xpart[i]; npp = &lp->d_partitions[i+8]; - /* no need to be UniOS compatible here */ - DL_SETPOFFSET(npp, spp->sdkp_cyloffset * secpercyl); + DL_SETPOFFSET(npp, spp->sdkp_cyloffset); DL_SETPSIZE(npp, spp->sdkp_nsectors); if (DL_GETPSIZE(npp) == 0) { npp->p_fstype = FS_UNUSED; @@ -427,10 +423,7 @@ disklabel_bsd_to_om(struct disklabel *lp, struct sun_disklabel *sl) spp->sdkp_cyloffset = 0; spp->sdkp_nsectors = 0; if (DL_GETPSIZE(npp)) { - /* no need to be UniOS compatible here */ - if (DL_GETPOFFSET(npp) % secpercyl) - return (EINVAL); - spp->sdkp_cyloffset = DL_GETPOFFSET(npp) / secpercyl; + spp->sdkp_cyloffset = DL_GETPOFFSET(npp); spp->sdkp_nsectors = DL_GETPSIZE(npp); } } -- cgit v1.2.3