Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6-1]: src/distrib/utils/sysinst/arch/alpha Pull up following revi...



details:   https://anonhg.NetBSD.org/src/rev/fe0422dc1e49
branches:  netbsd-6-1
changeset: 775966:fe0422dc1e49
user:      riz <riz%NetBSD.org@localhost>
date:      Fri Jul 18 02:51:52 2014 +0000

description:
Pull up following revision(s) (requested by tsutsui in ticket #1080):
        distrib/utils/sysinst/arch/alpha/md.c: revision 1.53
Apply patch in PR port-alpha/48697 (with some tweaks).
Tru64 UNIX's disklabel is the same format as BSD disklabel,
and it seems Tru64 stores incorrect geometry values in
d_nsectors (sectors/track) and d_secpercyl (sectors/cylinder).
d_secperunit seems always reliable so use it to get
dlsec (sectors/track) and dlcylsize (sectors/cylinder) values.
Should be pulled up to netbsd-6 branches.

diffstat:

 distrib/utils/sysinst/arch/alpha/md.c |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (38 lines):

diff -r b8ddd7f3ccd0 -r fe0422dc1e49 distrib/utils/sysinst/arch/alpha/md.c
--- a/distrib/utils/sysinst/arch/alpha/md.c     Mon Jul 14 06:34:51 2014 +0000
+++ b/distrib/utils/sysinst/arch/alpha/md.c     Fri Jul 18 02:51:52 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.51 2011/11/04 11:27:01 martin Exp $ */
+/*     $NetBSD: md.c,v 1.51.16.1 2014/07/18 02:51:52 riz Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -85,19 +85,19 @@
 
        dlcyl = disklabel.d_ncylinders;
        dlhead = disklabel.d_ntracks;
-       dlsec = disklabel.d_nsectors;
        sectorsize = disklabel.d_secsize;
-       dlcylsize = disklabel.d_secpercyl;
+       dlsize = disklabel.d_secperunit;
 
        /*
-        * Compute whole disk size. Take max of (dlcyl*dlhead*dlsec)
-        * and secperunit,  just in case the disk is already labelled.
-        * (If our new label's RAW_PART size ends up smaller than the
-        * in-core RAW_PART size  value, updating the label will fail.)
+        * Tru64 UNIX's disklabel is the same format as BSD disklabel,
+        * and it seems Tru64 stores incorrect geometry values in
+        * d_nsectors (sectors/track) and d_secpercyl (sectors/cylinder).
+        * d_secperunit seems always reliable so use it to get
+        * dlsec (sectors/track) and dlcylsize (sectors/cylinder) values.
+        * See PR/48697 for details.
         */
-       dlsize = dlcyl*dlhead*dlsec;
-       if (disklabel.d_secperunit > dlsize)
-               dlsize = disklabel.d_secperunit;
+       dlsec = dlsize / (dlhead * dlcyl);
+       dlcylsize = dlsec * dlhead;
 
        return 1;
 }



Home | Main Index | Thread Index | Old Index