summaryrefslogtreecommitdiff
path: root/sbin/disklabel
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2022-09-01 13:35:03 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2022-09-01 13:35:03 +0000
commit4326a808084c8da31ddf5b9617472eca8958f015 (patch)
tree33e1f5e28f24a283e1caadf9c2636d43ed7dfb08 /sbin/disklabel
parentca7bfd54bf78ff9fe4eec4a55809b210912f61a5 (diff)
d_bbsize and d_sbsize have become write-only fields.
No need to set them or check that they are set. ok otto@ as part of larger diff
Diffstat (limited to 'sbin/disklabel')
-rw-r--r--sbin/disklabel/disklabel.c16
-rw-r--r--sbin/disklabel/editor.c8
2 files changed, 2 insertions, 22 deletions
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index a95a10ef295..ba8d30083bc 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.c,v 1.242 2022/08/31 08:35:07 krw Exp $ */
+/* $OpenBSD: disklabel.c,v 1.243 2022/09/01 13:35:02 krw Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -824,8 +824,6 @@ getasciilabel(FILE *f, struct disklabel *lp)
unsigned int part;
lp->d_version = 1;
- lp->d_bbsize = BBSIZE; /* XXX */
- lp->d_sbsize = SBSIZE; /* XXX */
if (!(omountpoints = calloc(MAXPARTITIONS, sizeof(char *))))
errx(4, "out of memory");
@@ -1086,16 +1084,6 @@ checklabel(struct disklabel *lp)
lp->d_secpercyl = lp->d_nsectors * lp->d_ntracks;
if (DL_GETDSIZE(lp) == 0)
DL_SETDSIZE(lp, (u_int64_t)lp->d_secpercyl * lp->d_ncylinders);
- if (lp->d_bbsize == 0) {
- warnx("boot block size %d", lp->d_bbsize);
- errors++;
- } else if (lp->d_bbsize % lp->d_secsize)
- warnx("warning, boot block size %% sector-size != 0");
- if (lp->d_sbsize == 0) {
- warnx("super block size %d", lp->d_sbsize);
- errors++;
- } else if (lp->d_sbsize % lp->d_secsize)
- warnx("warning, super block size %% sector-size != 0");
if (lp->d_npartitions > MAXPARTITIONS)
warnx("warning, number of partitions (%d) > MAXPARTITIONS (%d)",
lp->d_npartitions, MAXPARTITIONS);
@@ -1160,8 +1148,6 @@ cmplabel(struct disklabel *lp1, struct disklabel *lp2)
lab1.d_magic = lab2.d_magic;
lab1.d_magic2 = lab2.d_magic2;
lab1.d_checksum = lab2.d_checksum;
- lab1.d_bbsize = lab2.d_bbsize;
- lab1.d_sbsize = lab2.d_sbsize;
lab1.d_bstart = lab2.d_bstart;
lab1.d_bstarth = lab2.d_bstarth;
lab1.d_bend = lab2.d_bend;
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index 2a913a0c1d7..e43314fa001 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.373 2022/07/31 14:29:19 krw Exp $ */
+/* $OpenBSD: editor.c,v 1.374 2022/09/01 13:35:02 krw Exp $ */
/*
* Copyright (c) 1997-2000 Todd C. Miller <millert@openbsd.org>
@@ -233,12 +233,6 @@ editor(int f)
}
#endif
- /* Set d_bbsize and d_sbsize as necessary */
- if (newlab.d_bbsize == 0)
- newlab.d_bbsize = BBSIZE;
- if (newlab.d_sbsize == 0)
- newlab.d_sbsize = SBSIZE;
-
/* Save the (U|u)ndo labels and mountpoints. */
mpcopy(origmountpoints, mountpoints);
origlabel = newlab;