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 Pull up revisions 1.70-1.71 (requested by fvdl):
details: https://anonhg.NetBSD.org/src/rev/ef2ff61e9245
branches: netbsd-1-5
changeset: 491526:ef2ff61e9245
user: he <he%NetBSD.org@localhost>
date: Tue May 01 12:27:03 2001 +0000
description:
Pull up revisions 1.70-1.71 (requested by fvdl):
Increase the number of BSD disklabel partitions on i386 to 16.
diffstat:
sys/dev/ccd.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
sys/dev/vnd.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 108 insertions(+), 6 deletions(-)
diffs (237 lines):
diff -r efc5977e8881 -r ef2ff61e9245 sys/dev/ccd.c
--- a/sys/dev/ccd.c Tue May 01 12:26:59 2001 +0000
+++ b/sys/dev/ccd.c Tue May 01 12:27:03 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ccd.c,v 1.69 2000/04/05 04:03:20 enami Exp $ */
+/* $NetBSD: ccd.c,v 1.69.4.1 2001/05/01 12:27:03 he Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -957,6 +957,9 @@
struct ccd_ioctl *ccio = (struct ccd_ioctl *)data;
char **cpp;
struct vnode **vpp;
+#ifdef __HAVE_OLD_DISKLABEL
+ struct disklabel newlabel;
+#endif
if (unit >= numccd)
return (ENXIO);
@@ -968,6 +971,10 @@
case CCDIOCCLR:
case DIOCSDINFO:
case DIOCWDINFO:
+#ifdef __HAVE_OLD_DISKLABEL
+ case ODIOCSDINFO:
+ case ODIOCWDINFO:
+#endif
case DIOCWLABEL:
if ((flag & FWRITE) == 0)
return (EBADF);
@@ -985,6 +992,12 @@
case DIOCGPART:
case DIOCWLABEL:
case DIOCGDEFLABEL:
+#ifdef __HAVE_OLD_DISKLABEL
+ case ODIOCGDINFO:
+ case ODIOCSDINFO:
+ case ODIOCWDINFO:
+ case ODIOCGDEFLABEL:
+#endif
if ((cs->sc_flags & CCDF_INITED) == 0) {
error = ENXIO;
goto out;
@@ -1134,6 +1147,14 @@
case DIOCGDINFO:
*(struct disklabel *)data = *(cs->sc_dkdev.dk_label);
break;
+#ifdef __HAVE_OLD_DISKLABEL
+ case ODIOCGDINFO:
+ newlabel = *(cs->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 = cs->sc_dkdev.dk_label;
@@ -1143,12 +1164,31 @@
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;
+
cs->sc_flags |= CCDF_LABELLING;
error = setdisklabel(cs->sc_dkdev.dk_label,
- (struct disklabel *)data, 0, cs->sc_dkdev.dk_cpulabel);
+ lp, 0, cs->sc_dkdev.dk_cpulabel);
if (error == 0) {
- if (cmd == DIOCWDINFO)
+ if (cmd == DIOCWDINFO
+#ifdef __HAVE_OLD_DISKLABEL
+ || cmd == ODIOCWDINFO
+#endif
+ )
error = writedisklabel(CCDLABELDEV(dev),
ccdstrategy, cs->sc_dkdev.dk_label,
cs->sc_dkdev.dk_cpulabel);
@@ -1156,6 +1196,7 @@
cs->sc_flags &= ~CCDF_LABELLING;
break;
+ }
case DIOCWLABEL:
if (*(int *)data != 0)
@@ -1168,6 +1209,15 @@
ccdgetdefaultlabel(cs, (struct disklabel *)data);
break;
+#ifdef __HAVE_OLD_DISKLABEL
+ case ODIOCGDEFLABEL:
+ ccdgetdefaultlabel(cs, &newlabel);
+ if (newlabel.d_npartitions > OLDMAXPARTITIONS)
+ return ENOTTY;
+ memcpy(data, &newlabel, sizeof (struct olddisklabel));
+ break;
+#endif
+
default:
error = ENOTTY;
}
diff -r efc5977e8881 -r ef2ff61e9245 sys/dev/vnd.c
--- a/sys/dev/vnd.c Tue May 01 12:26:59 2001 +0000
+++ b/sys/dev/vnd.c Tue May 01 12:27:03 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vnd.c,v 1.65.4.1 2000/09/13 02:18:33 enami Exp $ */
+/* $NetBSD: vnd.c,v 1.65.4.2 2001/05/01 12:27:07 he Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -695,6 +695,9 @@
struct nameidata nd;
int error, part, pmask;
size_t geomsize;
+#ifdef __HAVE_OLD_DISKLABEL
+ struct disklabel newlabel;
+#endif
#ifdef DEBUG
if (vnddebug & VDB_FOLLOW)
@@ -716,6 +719,10 @@
case VNDIOCCLR:
case DIOCSDINFO:
case DIOCWDINFO:
+#ifdef __HAVE_OLD_DISKLABEL
+ case ODIOCSDINFO:
+ case ODIOCWDINFO:
+#endif
case DIOCWLABEL:
if ((flag & FWRITE) == 0)
return (EBADF);
@@ -730,6 +737,12 @@
case DIOCGPART:
case DIOCWLABEL:
case DIOCGDEFLABEL:
+#ifdef __HAVE_OLD_DISKLABEL
+ case ODIOCGDINFO:
+ case ODIOCSDINFO:
+ case ODIOCWDINFO:
+ case ODIOCGDEFLABEL:
+#endif
if ((vnd->sc_flags & VNF_INITED) == 0)
return (ENXIO);
}
@@ -909,6 +922,15 @@
*(struct disklabel *)data = *(vnd->sc_dkdev.dk_label);
break;
+#ifdef __HAVE_OLD_DISKLABEL
+ case ODIOCGDINFO:
+ newlabel = *(vnd->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 = vnd->sc_dkdev.dk_label;
((struct partinfo *)data)->part =
@@ -917,15 +939,35 @@
case DIOCWDINFO:
case DIOCSDINFO:
+#ifdef __HAVE_OLD_DISKLABEL
+ case ODIOCWDINFO:
+ case ODIOCSDINFO:
+#endif
+ {
+ struct disklabel *lp;
+
if ((error = vndlock(vnd)) != 0)
return (error);
vnd->sc_flags |= VNF_LABELLING;
+#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;
+
error = setdisklabel(vnd->sc_dkdev.dk_label,
- (struct disklabel *)data, 0, vnd->sc_dkdev.dk_cpulabel);
+ lp, 0, vnd->sc_dkdev.dk_cpulabel);
if (error == 0) {
- if (cmd == DIOCWDINFO)
+ if (cmd == DIOCWDINFO
+#ifdef __HAVE_OLD_DISKLABEL
+ || cmd == ODIOCWDINFO
+#endif
+ )
error = writedisklabel(VNDLABELDEV(dev),
vndstrategy, vnd->sc_dkdev.dk_label,
vnd->sc_dkdev.dk_cpulabel);
@@ -938,6 +980,7 @@
if (error)
return (error);
break;
+ }
case DIOCWLABEL:
if (*(int *)data != 0)
@@ -950,6 +993,15 @@
vndgetdefaultlabel(vnd, (struct disklabel *)data);
break;
+#ifdef __HAVE_OLD_DISKLABEL
+ case ODIOCGDEFLABEL:
+ vndgetdefaultlabel(vnd, &newlabel);
+ if (newlabel.d_npartitions > OLDMAXPARTITIONS)
+ return ENOTTY;
+ memcpy(data, &newlabel, sizeof (struct olddisklabel));
+ break;
+#endif
+
default:
return (ENOTTY);
}
Home |
Main Index |
Thread Index |
Old Index