From 7110af7577b8a4fcd4f154bade61083c77480b39 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Sun, 12 May 2002 20:21:40 +0000 Subject: ARGH! SBLOCK is not unused. Try to get this right. BBSIZE belongs in (but shouldn't be a constant). Define SBLOCK again, using the right math. Sponsored by: DARPA & NAI Labs. --- sys/gnu/ext2fs/fs.h | 3 +-- sys/gnu/fs/ext2fs/fs.h | 3 +-- sys/sys/disklabel.h | 3 +++ sys/sys/diskmbr.h | 3 +++ sys/sys/diskpc98.h | 3 +++ sys/ufs/ffs/ffs_snapshot.c | 1 + sys/ufs/ffs/fs.h | 5 ++--- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/sys/gnu/ext2fs/fs.h b/sys/gnu/ext2fs/fs.h index 736051143918..785f267f8ac3 100644 --- a/sys/gnu/ext2fs/fs.h +++ b/sys/gnu/ext2fs/fs.h @@ -55,9 +55,8 @@ * The first boot and super blocks are given in absolute disk addresses. * The byte-offset forms are preferred, as they don't imply a sector size. */ -#define BBSIZE 1024 #define SBSIZE 1024 -#define SBOFF ((off_t)(BBSIZE)) +#define SBLOCK 2 /* * The path name on which the file system is mounted is maintained diff --git a/sys/gnu/fs/ext2fs/fs.h b/sys/gnu/fs/ext2fs/fs.h index 736051143918..785f267f8ac3 100644 --- a/sys/gnu/fs/ext2fs/fs.h +++ b/sys/gnu/fs/ext2fs/fs.h @@ -55,9 +55,8 @@ * The first boot and super blocks are given in absolute disk addresses. * The byte-offset forms are preferred, as they don't imply a sector size. */ -#define BBSIZE 1024 #define SBSIZE 1024 -#define SBOFF ((off_t)(BBSIZE)) +#define SBLOCK 2 /* * The path name on which the file system is mounted is maintained diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h index 44eb997bf588..6928408a606f 100644 --- a/sys/sys/disklabel.h +++ b/sys/sys/disklabel.h @@ -88,6 +88,9 @@ #define MAXPARTITIONS 8 #endif +/* Size of bootblock area in sector-size neutral bytes */ +#define BBSIZE 8192 + #define LABEL_PART 2 /* partition containing label */ #define RAW_PART 2 /* partition containing whole disk */ #define SWAP_PART 1 /* partition normally containing swap */ diff --git a/sys/sys/diskmbr.h b/sys/sys/diskmbr.h index 44eb997bf588..6928408a606f 100644 --- a/sys/sys/diskmbr.h +++ b/sys/sys/diskmbr.h @@ -88,6 +88,9 @@ #define MAXPARTITIONS 8 #endif +/* Size of bootblock area in sector-size neutral bytes */ +#define BBSIZE 8192 + #define LABEL_PART 2 /* partition containing label */ #define RAW_PART 2 /* partition containing whole disk */ #define SWAP_PART 1 /* partition normally containing swap */ diff --git a/sys/sys/diskpc98.h b/sys/sys/diskpc98.h index 44eb997bf588..6928408a606f 100644 --- a/sys/sys/diskpc98.h +++ b/sys/sys/diskpc98.h @@ -88,6 +88,9 @@ #define MAXPARTITIONS 8 #endif +/* Size of bootblock area in sector-size neutral bytes */ +#define BBSIZE 8192 + #define LABEL_PART 2 /* partition containing label */ #define RAW_PART 2 /* partition containing whole disk */ #define SWAP_PART 1 /* partition normally containing swap */ diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 257450b0b389..7965211d72ec 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include diff --git a/sys/ufs/ffs/fs.h b/sys/ufs/ffs/fs.h index af7fd43dc528..da854f9496e6 100644 --- a/sys/ufs/ffs/fs.h +++ b/sys/ufs/ffs/fs.h @@ -58,12 +58,11 @@ * The beginning of cylinder group cg in fs, is given by * the ``cgbase(fs, cg)'' macro. * - * The first boot and super blocks are given in absolute disk addresses. - * The byte-offset forms are preferred, as they don't imply a sector size. + * The size and offset of the super-block in sector-size neutral bytes. */ -#define BBSIZE 8192 #define SBSIZE 8192 #define SBOFF ((off_t)(BBSIZE)) +#define SBLOCK ((ufs_daddr_t)(SBOFF / DEV_BSIZE)) /* Max number of fragments per block, this is not tweakable */ #define MAXFRAG 8 -- cgit v1.3