summaryrefslogtreecommitdiff
path: root/sbin/fsck_ext2fs/setup.c
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 /sbin/fsck_ext2fs/setup.c
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 'sbin/fsck_ext2fs/setup.c')
-rw-r--r--sbin/fsck_ext2fs/setup.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/fsck_ext2fs/setup.c b/sbin/fsck_ext2fs/setup.c
index 7a3767982bf..e4c1637be70 100644
--- a/sbin/fsck_ext2fs/setup.c
+++ b/sbin/fsck_ext2fs/setup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: setup.c,v 1.13 2005/04/30 13:56:16 niallo Exp $ */
+/* $OpenBSD: setup.c,v 1.14 2007/05/29 06:28:15 otto Exp $ */
/* $NetBSD: setup.c,v 1.1 1997/06/11 11:22:01 bouyer Exp $ */
/*
@@ -441,8 +441,8 @@ calcsb(char *dev, int devfd, struct m_ext2fs *fs)
return (0);
}
memset(fs, 0, sizeof(struct m_ext2fs));
- fs->e2fs_bsize = pp->p_fsize;
- fs->e2fs.e2fs_log_bsize = pp->p_fsize / 1024;
+ fs->e2fs_bsize = DISKLABELV1_FFS_FSIZE(pp->p_fragblock); /* XXX */
+ fs->e2fs.e2fs_log_bsize = fs->e2fs_bsize / 1024;
fs->e2fs.e2fs_bcount = (pp->p_size * DEV_BSIZE) / fs->e2fs_bsize;
fs->e2fs.e2fs_first_dblock = (fs->e2fs.e2fs_log_bsize == 0) ? 1 : 0;
fs->e2fs.e2fs_bpg = fs->e2fs_bsize * NBBY;