mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
Don't clobber d_secperunit in disklabel -e'.
disklabel -e' replaces all
the values that it doesn't print by defaults. This seems wrong. I want to be able to see the total number of sectors more than edit it. The default d_secperunit of (sectors/track * tracks/cylinder * cylinders) is bogus if sectors/track is only an approximation and more bogus if sectors/track and tracks/cylinder are dummy values such as 4096 and 1 to defeat ufs's pessimizations.
This commit is contained in:
parent
d8947494e5
commit
f75dd51832
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=6643
@ -663,6 +663,7 @@ display(f, lp)
|
||||
fprintf(f, "tracks/cylinder: %d\n", lp->d_ntracks);
|
||||
fprintf(f, "sectors/cylinder: %d\n", lp->d_secpercyl);
|
||||
fprintf(f, "cylinders: %d\n", lp->d_ncylinders);
|
||||
fprintf(f, "sectors/unit: %d\n", lp->d_secperunit);
|
||||
fprintf(f, "rpm: %d\n", lp->d_rpm);
|
||||
fprintf(f, "interleave: %d\n", lp->d_interleave);
|
||||
fprintf(f, "trackskew: %d\n", lp->d_trackskew);
|
||||
@ -989,6 +990,16 @@ getasciilabel(f, lp)
|
||||
lp->d_ncylinders = v;
|
||||
continue;
|
||||
}
|
||||
if (streq(cp, "sectors/unit")) {
|
||||
v = atoi(tp);
|
||||
if (v <= 0) {
|
||||
fprintf(stderr, "line %d: %s: bad %s\n",
|
||||
lineno, tp, cp);
|
||||
errors++;
|
||||
} else
|
||||
lp->d_secperunit = v;
|
||||
continue;
|
||||
}
|
||||
if (streq(cp, "rpm")) {
|
||||
v = atoi(tp);
|
||||
if (v <= 0) {
|
||||
|
@ -663,6 +663,7 @@ display(f, lp)
|
||||
fprintf(f, "tracks/cylinder: %d\n", lp->d_ntracks);
|
||||
fprintf(f, "sectors/cylinder: %d\n", lp->d_secpercyl);
|
||||
fprintf(f, "cylinders: %d\n", lp->d_ncylinders);
|
||||
fprintf(f, "sectors/unit: %d\n", lp->d_secperunit);
|
||||
fprintf(f, "rpm: %d\n", lp->d_rpm);
|
||||
fprintf(f, "interleave: %d\n", lp->d_interleave);
|
||||
fprintf(f, "trackskew: %d\n", lp->d_trackskew);
|
||||
@ -989,6 +990,16 @@ getasciilabel(f, lp)
|
||||
lp->d_ncylinders = v;
|
||||
continue;
|
||||
}
|
||||
if (streq(cp, "sectors/unit")) {
|
||||
v = atoi(tp);
|
||||
if (v <= 0) {
|
||||
fprintf(stderr, "line %d: %s: bad %s\n",
|
||||
lineno, tp, cp);
|
||||
errors++;
|
||||
} else
|
||||
lp->d_secperunit = v;
|
||||
continue;
|
||||
}
|
||||
if (streq(cp, "rpm")) {
|
||||
v = atoi(tp);
|
||||
if (v <= 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user