From: krw Date: Thu, 1 Sep 2022 13:35:02 +0000 (+0000) Subject: d_bbsize and d_sbsize have become write-only fields. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7cf21ae750496d4f3bb7344b7fb3aa52be4eca25;p=openbsd 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 --- 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 @@ -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;