Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/dev/raidframe Pull up revisions 1.102-1.103 (reques...



details:   https://anonhg.NetBSD.org/src/rev/5c958fd45b83
branches:  netbsd-1-5
changeset: 491533:5c958fd45b83
user:      he <he%NetBSD.org@localhost>
date:      Tue May 01 12:27:33 2001 +0000

description:
Pull up revisions 1.102-1.103 (requested by fvdl):
  Increase the number of BSD disklabel partitions on i386 to 16.

diffstat:

 sys/dev/raidframe/rf_netbsdkintf.c |  59 ++++++++++++++++++++++++++++++++++---
 1 files changed, 54 insertions(+), 5 deletions(-)

diffs (124 lines):

diff -r 76e9a87a0fa0 -r 5c958fd45b83 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Tue May 01 12:27:29 2001 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Tue May 01 12:27:33 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.92.2.8 2001/04/05 12:25:03 he Exp $       */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.92.2.9 2001/05/01 12:27:33 he Exp $       */
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -783,6 +783,9 @@
        RF_SingleComponent_t component;
        RF_ProgressInfo_t progressInfo, **progressInfoPtr;
        int i, j, d;
+#ifdef __HAVE_OLD_DISKLABEL
+       struct disklabel newlabel;
+#endif
 
        if (unit >= numraid)
                return (ENXIO);
@@ -796,6 +799,10 @@
        switch (cmd) {
        case DIOCSDINFO:
        case DIOCWDINFO:
+#ifdef __HAVE_OLD_DISKLABEL
+       case ODIOCWDINFO:
+       case ODIOCSDINFO:
+#endif
        case DIOCWLABEL:
                if ((flag & FWRITE) == 0)
                        return (EBADF);
@@ -806,6 +813,12 @@
        case DIOCGDINFO:
        case DIOCSDINFO:
        case DIOCWDINFO:
+#ifdef __HAVE_OLD_DISKLABEL
+       case ODIOCGDINFO:
+       case ODIOCWDINFO:
+       case ODIOCSDINFO:
+       case ODIOCGDEFLABEL:
+#endif
        case DIOCGPART:
        case DIOCWLABEL:
        case DIOCGDEFLABEL:
@@ -1441,6 +1454,14 @@
        case DIOCGDINFO:
                *(struct disklabel *) data = *(rs->sc_dkdev.dk_label);
                break;
+#ifdef __HAVE_OLD_DISKLABEL
+       case ODIOCGDINFO:
+               newlabel = *(rs->sc_dkdev.dk_label);
+               if (newlabel.d_npartitions > OLDMAXPARTITIONS)
+                       return ENOTTY;
+               memcpy(data, &newlabel, sizeof (struct olddisklabel));
+               break;
+#endif
 
        case DIOCGPART:
                ((struct partinfo *) data)->disklab = rs->sc_dkdev.dk_label;
@@ -1450,15 +1471,34 @@
 
        case DIOCWDINFO:
        case DIOCSDINFO:
+#ifdef __HAVE_OLD_DISKLABEL
+       case ODIOCWDINFO:
+       case ODIOCSDINFO:
+#endif
+       {
+               struct disklabel *lp;
+#ifdef __HAVE_OLD_DISKLABEL
+               if (cmd == ODIOCSDINFO || cmd == ODIOCWDINFO) {
+                       memset(&newlabel, 0, sizeof newlabel);
+                       memcpy(&newlabel, data, sizeof (struct olddisklabel));
+                       lp = &newlabel;
+               } else
+#endif
+               lp = (struct disklabel *)data;
+
                if ((error = raidlock(rs)) != 0)
                        return (error);
 
                rs->sc_flags |= RAIDF_LABELLING;
 
                error = setdisklabel(rs->sc_dkdev.dk_label,
-                   (struct disklabel *) data, 0, rs->sc_dkdev.dk_cpulabel);
+                   lp, 0, rs->sc_dkdev.dk_cpulabel);
                if (error == 0) {
-                       if (cmd == DIOCWDINFO)
+                       if (cmd == DIOCWDINFO
+#ifdef __HAVE_OLD_DISKLABEL
+                           || cmd == ODIOCWDINFO
+#endif
+                          )
                                error = writedisklabel(RAIDLABELDEV(dev),
                                    raidstrategy, rs->sc_dkdev.dk_label,
                                    rs->sc_dkdev.dk_cpulabel);
@@ -1470,6 +1510,7 @@
                if (error)
                        return (error);
                break;
+       }
 
        case DIOCWLABEL:
                if (*(int *) data != 0)
@@ -1479,10 +1520,18 @@
                break;
 
        case DIOCGDEFLABEL:
-               raidgetdefaultlabel(raidPtr, rs,
-                   (struct disklabel *) data);
+               raidgetdefaultlabel(raidPtr, rs, (struct disklabel *) data);
                break;
 
+#ifdef __HAVE_OLD_DISKLABEL
+       case ODIOCGDEFLABEL:
+               raidgetdefaultlabel(raidPtr, rs, &newlabel);
+               if (newlabel.d_npartitions > OLDMAXPARTITIONS)
+                       return ENOTTY;
+               memcpy(data, &newlabel, sizeof (struct olddisklabel));
+               break;
+#endif
+
        default:
                retcode = ENOTTY;
        }



Home | Main Index | Thread Index | Old Index