diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-05-31 00:30:11 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-05-31 00:30:11 +0000 |
commit | 733854e02462c8df2618a5934e2a0fc24d12d2dd (patch) | |
tree | d33d8e4ad462a7024b2e4ca3fd4974f2cb1ca51d /sys/arch/sparc | |
parent | 77c688ad9eefb3cd2cbe587fdd038dfc3fcc63fd (diff) |
extend the sun disklabel format to contain filesystem types. also,
store the information fsck needs. this allows us to create raid
partitions, nicely, of course.
ok miod todd krw
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r-- | sys/arch/sparc/sparc/disksubr.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sys/arch/sparc/sparc/disksubr.c b/sys/arch/sparc/sparc/disksubr.c index c8394812869..1af6c1b0340 100644 --- a/sys/arch/sparc/sparc/disksubr.c +++ b/sys/arch/sparc/sparc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.44 2007/05/29 06:28:15 otto Exp $ */ +/* $OpenBSD: disksubr.c,v 1.45 2007/05/31 00:30:08 deraadt Exp $ */ /* $NetBSD: disksubr.c,v 1.16 1996/04/28 20:25:59 thorpej Exp $ */ /* @@ -424,6 +424,7 @@ disklabel_sun_to_bsd(cp, lp) secpercyl = sl->sl_nsectors * sl->sl_ntracks; lp->d_secpercyl = secpercyl; lp->d_secperunit = secpercyl * sl->sl_ncylinders; + lp->d_version = 1; /* 48 bit addressing */ lp->d_sparespercyl = sl->sl_sparespercyl; lp->d_acylinders = sl->sl_acylinders; @@ -465,7 +466,7 @@ disklabel_sun_to_bsd(cp, lp) } /* Check to see if there's an "extended" partition table */ - if (sl->sl_xpmag == SL_XPMAG && + if ((sl->sl_xpmag == SL_XPMAG || sl->sl_xpmag == SL_XPMAGTYP) && sun_extended_sum(sl) == sl->sl_xpsum) { /* ...yes! */ /* * There is. Copy over the "extended" partitions. @@ -487,6 +488,13 @@ disklabel_sun_to_bsd(cp, lp) npp->p_cpg = 16; } } + if (sl->sl_xpmag == SL_XPMAGTYP) + for (i = 0; i < MAXPARTITIONS; i++) { + npp = &lp->d_partitions[i]; + npp->p_fstype = sl->sl_types[i]; + npp->p_fragblock = sl->sl_fragblock[i]; + npp->p_cpg = sl->sl_cpg[i]; + } } lp->d_checksum = 0; @@ -554,7 +562,7 @@ disklabel_bsd_to_sun(lp, cp) } /* We do need to load the extended table? */ if (i < SUNXPART) { - sl->sl_xpmag = SL_XPMAG; + sl->sl_xpmag = SL_XPMAGTYP; for (i = 0; i < SUNXPART; i++) { spp = &sl->sl_xpart[i]; npp = &lp->d_partitions[i+8]; @@ -564,6 +572,12 @@ disklabel_bsd_to_sun(lp, cp) npp->p_offset / secpercyl; sl->sl_xpart[i].sdkp_nsectors = npp->p_size; } + for (i = 0; i < MAXPARTITIONS; i++) { + npp = &lp->d_partitions[i]; + sl->sl_types[i] = npp->p_fstype; + sl->sl_fragblock[i] = npp->p_fragblock; + sl->sl_cpg[i] = npp->p_cpg; + } sl->sl_xpsum = sun_extended_sum(sl); } else { sl->sl_xpmag = 0; |