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/vme Pull up revisions 1.33-1.34 (requested by f...



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

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

diffstat:

 sys/dev/vme/xd.c |  40 ++++++++++++++++++++++++++++++++++++----
 1 files changed, 36 insertions(+), 4 deletions(-)

diffs (88 lines):

diff -r 6a20805c64c1 -r 040fdb0a6763 sys/dev/vme/xd.c
--- a/sys/dev/vme/xd.c  Tue May 01 12:27:41 2001 +0000
+++ b/sys/dev/vme/xd.c  Tue May 01 12:27:45 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xd.c,v 1.27.2.2 2000/07/25 20:41:07 pk Exp $   */
+/*     $NetBSD: xd.c,v 1.27.2.3 2001/05/01 12:27:45 he Exp $   */
 
 /*
  *
@@ -999,6 +999,9 @@
        struct xd_softc *xd;
        struct xd_iocmd *xio;
        int     error, s, unit;
+#ifdef __HAVE_OLD_DISKLABEL
+       struct disklabel newlabel, *lp;
+#endif
 
        unit = DISKUNIT(dev);
 
@@ -1019,6 +1022,14 @@
        case DIOCGDINFO:        /* get disk label */
                bcopy(xd->sc_dk.dk_label, addr, sizeof(struct disklabel));
                return 0;
+#ifdef __HAVE_OLD_DISKLABEL
+       case ODIOCGDINFO:
+               newlabel = *(xd->sc_dk.dk_label);
+               if (newlabel.d_npartitions > OLDMAXPARTITIONS)
+                       return ENOTTY;
+               memcpy(addr, &newlabel, sizeof (struct olddisklabel));
+               return 0;
+#endif
 
        case DIOCGPART: /* get partition info */
                ((struct partinfo *) addr)->disklab = xd->sc_dk.dk_label;
@@ -1027,10 +1038,20 @@
                return 0;
 
        case DIOCSDINFO:        /* set disk label */
+#ifdef __HAVE_OLD_DISKLABEL
+       case ODIOCSDINFO:
+               if (command == ODIOCSDINFO) {
+                       memset(&newlabel, 0, sizeof newlabel);
+                       memcpy(&newlabel, addr, sizeof (struct olddisklabel));
+                       lp = &newlabel;
+               } else
+#endif
+               lp = (struct disklabel *)addr;
+
                if ((flag & FWRITE) == 0)
                        return EBADF;
                error = setdisklabel(xd->sc_dk.dk_label,
-                   (struct disklabel *) addr, /* xd->sc_dk.dk_openmask : */ 0,
+                   lp, /* xd->sc_dk.dk_openmask : */ 0,
                    xd->sc_dk.dk_cpulabel);
                if (error == 0) {
                        if (xd->state == XD_DRIVE_NOLABEL)
@@ -1048,10 +1069,20 @@
                return 0;
 
        case DIOCWDINFO:        /* write disk label */
+#ifdef __HAVE_OLD_DISKLABEL
+       case ODIOCWDINFO:
+               if (command == ODIOCWDINFO) {
+                       memset(&newlabel, 0, sizeof newlabel);
+                       memcpy(&newlabel, addr, sizeof (struct olddisklabel));
+                       lp = &newlabel;
+               } else
+#endif
+               lp = (struct disklabel *)addr;
+
                if ((flag & FWRITE) == 0)
                        return EBADF;
                error = setdisklabel(xd->sc_dk.dk_label,
-                   (struct disklabel *) addr, /* xd->sc_dk.dk_openmask : */ 0,
+                   lp, /* xd->sc_dk.dk_openmask : */ 0,
                    xd->sc_dk.dk_cpulabel);
                if (error == 0) {
                        if (xd->state == XD_DRIVE_NOLABEL)
@@ -1059,7 +1090,8 @@
 
                        /* Simulate opening partition 0 so write succeeds. */
                        xd->sc_dk.dk_openmask |= (1 << 0);
-                       error = writedisklabel(MAKEDISKDEV(major(dev), DISKUNIT(dev), RAW_PART),
+                       error = writedisklabel(MAKEDISKDEV(major(dev),
+                           DISKUNIT(dev), RAW_PART),
                            xdstrategy, xd->sc_dk.dk_label,
                            xd->sc_dk.dk_cpulabel);
                        xd->sc_dk.dk_openmask =



Home | Main Index | Thread Index | Old Index