Source-Changes-HG archive

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

[src/trunk]: src/distrib/utils/sysinst/arch/alpha Apply patch in PR port-alph...



details:   https://anonhg.NetBSD.org/src/rev/7e9dd9bad2ee
branches:  trunk
changeset: 329656:7e9dd9bad2ee
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Mon Jun 02 15:03:47 2014 +0000

description:
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 96747c0a8822 -r 7e9dd9bad2ee distrib/utils/sysinst/arch/alpha/md.c
--- a/distrib/utils/sysinst/arch/alpha/md.c     Mon Jun 02 11:02:20 2014 +0000
+++ b/distrib/utils/sysinst/arch/alpha/md.c     Mon Jun 02 15:03:47 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.52 2014/02/15 19:45:43 tsutsui Exp $ */
+/*     $NetBSD: md.c,v 1.53 2014/06/02 15:03:47 tsutsui 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