summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-05-12 20:49:41 +0000
committerphk <phk@FreeBSD.org>2002-05-12 20:49:41 +0000
commit02fe70f68eeae14d8c6155c522822cd36d600068 (patch)
tree23b6f85553aa96d4599428d24b108a5190c99452 /sbin
parent320493f9ebe397927d0ac2dd711de742218c0252 (diff)
downloadFreeBSD-src-02fe70f68eeae14d8c6155c522822cd36d600068.zip
FreeBSD-src-02fe70f68eeae14d8c6155c522822cd36d600068.tar.gz
Retire the bogus uses of the disklabel field d_sbsize and begin to
initialize it to zero so we don't have to have everbody and their aunt including FFS specific header files. Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/bsdlabel/bsdlabel.c8
-rw-r--r--sbin/disklabel/disklabel.c8
-rw-r--r--sbin/fsck_ffs/fsutil.c1
-rw-r--r--sbin/fsck_ffs/setup.c3
-rw-r--r--sbin/fsck_ifs/fsutil.c1
-rw-r--r--sbin/fsck_ifs/setup.c3
6 files changed, 4 insertions, 20 deletions
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c
index 122d778..90423bb 100644
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -64,7 +64,6 @@ static const char rcsid[] =
#ifdef __sparc64__
#include <sys/sun_disklabel.h>
#endif
-#include <ufs/ffs/fs.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
@@ -937,7 +936,7 @@ getasciilabel(FILE *f, struct disklabel *lp)
int i;
lp->d_bbsize = BBSIZE; /* XXX */
- lp->d_sbsize = SBSIZE; /* XXX */
+ lp->d_sbsize = 0; /* XXX */
while (fgets(line, sizeof(line) - 1, f)) {
lineno++;
if ((cp = index(line,'\n')) != 0)
@@ -1332,11 +1331,6 @@ checklabel(struct disklabel *lp)
errors++;
} else if (lp->d_bbsize % lp->d_secsize)
Warning("boot block size %% sector-size != 0");
- if (lp->d_sbsize == 0) {
- fprintf(stderr, "super block size 0\n");
- errors++;
- } else if (lp->d_sbsize % lp->d_secsize)
- Warning("super block size %% sector-size != 0");
if (lp->d_npartitions > MAXPARTITIONS)
Warning("number of partitions (%lu) > MAXPARTITIONS (%d)",
(u_long)lp->d_npartitions, MAXPARTITIONS);
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index 122d778..90423bb 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -64,7 +64,6 @@ static const char rcsid[] =
#ifdef __sparc64__
#include <sys/sun_disklabel.h>
#endif
-#include <ufs/ffs/fs.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
@@ -937,7 +936,7 @@ getasciilabel(FILE *f, struct disklabel *lp)
int i;
lp->d_bbsize = BBSIZE; /* XXX */
- lp->d_sbsize = SBSIZE; /* XXX */
+ lp->d_sbsize = 0; /* XXX */
while (fgets(line, sizeof(line) - 1, f)) {
lineno++;
if ((cp = index(line,'\n')) != 0)
@@ -1332,11 +1331,6 @@ checklabel(struct disklabel *lp)
errors++;
} else if (lp->d_bbsize % lp->d_secsize)
Warning("boot block size %% sector-size != 0");
- if (lp->d_sbsize == 0) {
- fprintf(stderr, "super block size 0\n");
- errors++;
- } else if (lp->d_sbsize % lp->d_secsize)
- Warning("super block size %% sector-size != 0");
if (lp->d_npartitions > MAXPARTITIONS)
Warning("number of partitions (%lu) > MAXPARTITIONS (%d)",
(u_long)lp->d_npartitions, MAXPARTITIONS);
diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c
index 65869c3..9f4607f 100644
--- a/sbin/fsck_ffs/fsutil.c
+++ b/sbin/fsck_ffs/fsutil.c
@@ -43,6 +43,7 @@ static const char rcsid[] =
#include <sys/types.h>
#include <sys/sysctl.h>
#include <sys/stat.h>
+#include <sys/disklabel.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ufs/dir.h>
diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c
index 84fe0e5..9364ce3 100644
--- a/sbin/fsck_ffs/setup.c
+++ b/sbin/fsck_ffs/setup.c
@@ -506,9 +506,6 @@ calcsb(char *dev, int devfd, struct fs *fs)
fs->fs_nsect = lp->d_nsectors;
fs->fs_spc = lp->d_secpercyl;
fs->fs_nspf = fs->fs_fsize / lp->d_secsize;
- fs->fs_sblkno = roundup(
- howmany(lp->d_bbsize + lp->d_sbsize, fs->fs_fsize),
- fs->fs_frag);
fs->fs_cgmask = 0xffffffff;
for (i = fs->fs_ntrak; i > 1; i >>= 1)
fs->fs_cgmask <<= 1;
diff --git a/sbin/fsck_ifs/fsutil.c b/sbin/fsck_ifs/fsutil.c
index 465452f..5b6faba 100644
--- a/sbin/fsck_ifs/fsutil.c
+++ b/sbin/fsck_ifs/fsutil.c
@@ -42,6 +42,7 @@ static const char rcsid[] =
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/disklabel.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ufs/dir.h>
diff --git a/sbin/fsck_ifs/setup.c b/sbin/fsck_ifs/setup.c
index a555028..f60f9ce 100644
--- a/sbin/fsck_ifs/setup.c
+++ b/sbin/fsck_ifs/setup.c
@@ -481,9 +481,6 @@ calcsb(char *dev, int devfd, struct fs *fs)
fs->fs_nsect = lp->d_nsectors;
fs->fs_spc = lp->d_secpercyl;
fs->fs_nspf = fs->fs_fsize / lp->d_secsize;
- fs->fs_sblkno = roundup(
- howmany(lp->d_bbsize + lp->d_sbsize, fs->fs_fsize),
- fs->fs_frag);
fs->fs_cgmask = 0xffffffff;
for (i = fs->fs_ntrak; i > 1; i >>= 1)
fs->fs_cgmask <<= 1;
OpenPOWER on IntegriCloud