From 7204dd55d6b506ad5f1def6e39d80b2057f33ef0 Mon Sep 17 00:00:00 2001 From: iedowse Date: Tue, 19 Mar 2002 17:03:14 +0000 Subject: 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(). --- sbin/newfs/Makefile | 1 - sbin/newfs/mkfs.c | 20 +------------------- 2 files changed, 1 insertion(+), 20 deletions(-) (limited to 'sbin') 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 #include -#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); -- cgit v1.1