diff options
author | iedowse <iedowse@FreeBSD.org> | 2002-03-19 17:03:14 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2002-03-19 17:03:14 +0000 |
commit | 7204dd55d6b506ad5f1def6e39d80b2057f33ef0 (patch) | |
tree | b8525a9509b31ad9724a2ad7050c844968164a7b /sbin | |
parent | 959fd0e42e1d0e39c9ceaf52922de94d9f22135c (diff) | |
download | FreeBSD-src-7204dd55d6b506ad5f1def6e39d80b2057f33ef0.zip FreeBSD-src-7204dd55d6b506ad5f1def6e39d80b2057f33ef0.tar.gz |
The FSIRAND code is always compiled in, and it is unlikely that
anyone needs a newfs without it. Remove the #ifdef's from around
the code and the -DFSIRAND from the Makefile. Also remove redundant
declarations of random() and srandomdev().
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/newfs/Makefile | 1 | ||||
-rw-r--r-- | sbin/newfs/mkfs.c | 20 |
2 files changed, 1 insertions, 20 deletions
diff --git a/sbin/newfs/Makefile b/sbin/newfs/Makefile index 38c547b..c172555 100644 --- a/sbin/newfs/Makefile +++ b/sbin/newfs/Makefile @@ -3,7 +3,6 @@ PROG= newfs SRCS= newfs.c mkfs.c -CFLAGS+=-DFSIRAND WARNS?= 2 MAN= newfs.8 diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 5d78010..9bced71 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -59,11 +59,6 @@ static const char rcsid[] = #include <sys/mman.h> #include <sys/ioctl.h> -#ifdef FSIRAND -extern long random (void); -extern void srandomdev (void); -#endif - /* * make file system for cylinder-group style file systems */ @@ -129,9 +124,7 @@ union { struct dinode zino[MAXBSIZE / sizeof(struct dinode)]; int fsi, fso; -#ifdef FSIRAND int randinit; -#endif daddr_t alloc(); long calcipg(); static int charsperline(); @@ -164,12 +157,10 @@ mkfs(pp, fsys, fi, fo) char tmpbuf[100]; /* XXX this will break in about 2,500 years */ time(&utime); -#ifdef FSIRAND if (!randinit) { randinit = 1; srandomdev(); } -#endif fsi = fi; fso = fo; if (Oflag) { @@ -600,10 +591,8 @@ next: sblock.fs_fmod = 0; sblock.fs_ronly = 0; sblock.fs_clean = 1; -#ifdef FSIRAND sblock.fs_id[0] = (long)utime; sblock.fs_id[1] = random(); -#endif /* * Dump out summary information about file system. @@ -682,11 +671,8 @@ initcg(cylno, utime) time_t utime; { daddr_t cbase, d, dlower, dupper, dmax, blkno; - long i; struct csum *cs; -#ifdef FSIRAND - long j; -#endif + long i, j; /* * Determine block bounds for cylinder group. @@ -746,10 +732,8 @@ initcg(cylno, utime) acg.cg_cs.cs_nifree--; } for (i = 0; i < sblock.fs_ipg / INOPF(&sblock); i += sblock.fs_frag) { -#ifdef FSIRAND for (j = 0; j < sblock.fs_bsize / sizeof(struct dinode); j++) zino[j].di_gen = random(); -#endif wtfs(fsbtodb(&sblock, cgimin(&sblock, cylno) + i), sblock.fs_bsize, (char *)zino); } @@ -1058,9 +1042,7 @@ iput(ip, ino) daddr_t d; int c; -#ifdef FSIRAND ip->di_gen = random(); -#endif c = ino_to_cg(&sblock, ino); rdfs(fsbtodb(&sblock, cgtod(&sblock, 0)), sblock.fs_cgsize, (char *)&acg); |