Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/arch/luna68k/luna68k Pull up following revision(s) (r...



details:   https://anonhg.NetBSD.org/src/rev/0cfdb3936547
branches:  netbsd-6
changeset: 776542:0cfdb3936547
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sun Jan 12 12:12:58 2014 +0000

description:
Pull up following revision(s) (requested by tsutsui in ticket #1002):
        sys/arch/luna68k/luna68k/disksubr.c: revision 1.30
Make the default disklabel (for disks without label) have saner value.
I.e. use d_secperunit for RAW_PART rather than 0x1fffffff for part a.

diffstat:

 sys/arch/luna68k/luna68k/disksubr.c |  18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diffs (43 lines):

diff -r f8a24b01d824 -r 0cfdb3936547 sys/arch/luna68k/luna68k/disksubr.c
--- a/sys/arch/luna68k/luna68k/disksubr.c       Sun Jan 12 12:10:47 2014 +0000
+++ b/sys/arch/luna68k/luna68k/disksubr.c       Sun Jan 12 12:12:58 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: disksubr.c,v 1.29 2009/10/26 19:16:56 cegger Exp $ */
+/* $NetBSD: disksubr.c,v 1.29.18.1 2014/01/12 12:12:58 bouyer Exp $ */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -103,7 +103,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.29 2009/10/26 19:16:56 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.29.18.1 2014/01/12 12:12:58 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -180,14 +180,20 @@
        struct disklabel *dlp;
        struct sun_disklabel *slp;
        int error;
+       int i;
 
        /* minimal requirements for archtypal disk label */
        if (lp->d_secperunit == 0)
                lp->d_secperunit = 0x1fffffff;
-       lp->d_npartitions = 1;
-       if (lp->d_partitions[0].p_size == 0)
-               lp->d_partitions[0].p_size = 0x1fffffff;
-       lp->d_partitions[0].p_offset = 0;
+       if (lp->d_npartitions < RAW_PART + 1)
+               lp->d_npartitions = RAW_PART + 1;
+       for (i = 0; i < RAW_PART; i++) {
+               lp->d_partitions[i].p_size = 0;
+               lp->d_partitions[i].p_offset = 0;
+       }
+       if (lp->d_partitions[RAW_PART].p_size == 0)
+               lp->d_partitions[RAW_PART].p_size = lp->d_secperunit;
+       lp->d_partitions[RAW_PART].p_offset = 0;
 
        /* obtain buffer to probe drive with */
        bp = geteblk((int)lp->d_secsize);



Home | Main Index | Thread Index | Old Index