summaryrefslogtreecommitdiff
path: root/lib/libc/gen
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2007-05-29 06:28:17 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2007-05-29 06:28:17 +0000
commit444b0299644e2e692c1f8d00d8b1caa0acea33a3 (patch)
tree1b53b5865bcc8b3675238c2ebdd9daf6797ccd39 /lib/libc/gen
parent3f6176ec485942a0e5cfcc7e61ca01950df6452c (diff)
Updated disklabel format to support larger disks and partitions. We
free room in struct partition by packing fragment size and fragments/block more tighlty and use the resulting space to make offset and size 48 bits. For the disk part we use spare fields in struct disklabel. Kernel converts in-mem copy of the on-disk label if needed, disklabel(8) writes new version. We are careful to only change fields not used by bootloaders. Conception of basic scheme by deraadt. ok deraadt@ krw@
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/disklabel.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libc/gen/disklabel.c b/lib/libc/gen/disklabel.c
index ad5148e0cde..a921b8e0bf0 100644
--- a/lib/libc/gen/disklabel.c
+++ b/lib/libc/gen/disklabel.c
@@ -116,16 +116,18 @@ getdiskbyname(const char *name)
if (cgetnum(buf, psize, &f) == -1)
pp->p_size = 0;
else {
+ u_int32_t fsize, frag = 8;
+
pp->p_size = f;
getnum(pp->p_offset, poffset);
- getnumdflt(pp->p_fsize, pfsize, 0);
- if (pp->p_fsize) {
+ getnumdflt(fsize, pfsize, 0);
+ if (fsize) {
long bsize;
if (cgetnum(buf, pbsize, &bsize) == 0)
- pp->p_frag = bsize / pp->p_fsize;
- else
- pp->p_frag = 8;
+ frag = bsize / fsize;
+ pp->p_fragblock =
+ DISKLABELV1_FFS_FRAGBLOCK(fsize, frag);
}
getnumdflt(pp->p_fstype, ptype, 0);
if (pp->p_fstype == 0 && cgetstr(buf, ptype, &cq) > 0)