summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-05-12 20:21:40 +0000
committerphk <phk@FreeBSD.org>2002-05-12 20:21:40 +0000
commite27fed0950bce6104eff3b285e2d686c16ed0c0f (patch)
treef8881a1706abe6ff98361858048c6c983eb2c4bd /sys
parent4aa59982cb5684fda4dfc0e47cb17fc95a67fb5d (diff)
downloadFreeBSD-src-e27fed0950bce6104eff3b285e2d686c16ed0c0f.zip
FreeBSD-src-e27fed0950bce6104eff3b285e2d686c16ed0c0f.tar.gz
ARGH! SBLOCK is not unused. Try to get this right.
BBSIZE belongs in <sys/disklabel.h> (but shouldn't be a constant). Define SBLOCK again, using the right math. Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sys')
-rw-r--r--sys/gnu/ext2fs/fs.h3
-rw-r--r--sys/gnu/fs/ext2fs/fs.h3
-rw-r--r--sys/sys/disklabel.h3
-rw-r--r--sys/sys/diskmbr.h3
-rw-r--r--sys/sys/diskpc98.h3
-rw-r--r--sys/ufs/ffs/ffs_snapshot.c1
-rw-r--r--sys/ufs/ffs/fs.h5
7 files changed, 14 insertions, 7 deletions
diff --git a/sys/gnu/ext2fs/fs.h b/sys/gnu/ext2fs/fs.h
index 7360511..785f267 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 7360511..785f267 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 44eb997..6928408 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 44eb997..6928408 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 44eb997..6928408 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 257450b..7965211 100644
--- a/sys/ufs/ffs/ffs_snapshot.c
+++ b/sys/ufs/ffs/ffs_snapshot.c
@@ -37,6 +37,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
+#include <sys/disklabel.h>
#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/proc.h>
diff --git a/sys/ufs/ffs/fs.h b/sys/ufs/ffs/fs.h
index af7fd43..da854f9 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
OpenPOWER on IntegriCloud