summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2003-05-06 04:32:17 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2003-05-06 04:32:17 +0000
commit9c7db1c3fa6774fd0192cfd4e978c703edbf1794 (patch)
treead624905a15cef4fcea4f5816734c8437ddae54f
parentad94b0a87e1222252af5c932b6d5ad9e60499fee (diff)
remove FSIRAND define and make it non-optional. ok millert@
-rw-r--r--sbin/newfs/Makefile4
-rw-r--r--sbin/newfs/mkfs.c11
2 files changed, 5 insertions, 10 deletions
diff --git a/sbin/newfs/Makefile b/sbin/newfs/Makefile
index a4b980fff95..a276eb7e87f 100644
--- a/sbin/newfs/Makefile
+++ b/sbin/newfs/Makefile
@@ -1,11 +1,11 @@
-# $OpenBSD: Makefile,v 1.5 1997/09/21 11:37:41 deraadt Exp $
+# $OpenBSD: Makefile,v 1.6 2003/05/06 04:32:16 tedu Exp $
PROG= newfs
SRCS= dkcksum.c getmntopts.c newfs.c mkfs.c
MAN= newfs.8
MOUNT= ${.CURDIR}/../mount
-CFLAGS+=-DMFS -DFSIRAND -I${MOUNT}
+CFLAGS+=-DMFS -I${MOUNT}
.PATH: ${MOUNT} ${.CURDIR}/../disklabel
DPADD= ${LIBUTIL}
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
index ffe5089fee3..a826cd1aea0 100644
--- a/sbin/newfs/mkfs.c
+++ b/sbin/newfs/mkfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkfs.c,v 1.26 2003/05/06 00:10:40 tedu Exp $ */
+/* $OpenBSD: mkfs.c,v 1.27 2003/05/06 04:32:16 tedu Exp $ */
/* $NetBSD: mkfs.c,v 1.25 1995/06/18 21:35:38 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)mkfs.c 8.3 (Berkeley) 2/3/94";
#else
-static char rcsid[] = "$OpenBSD: mkfs.c,v 1.26 2003/05/06 00:10:40 tedu Exp $";
+static char rcsid[] = "$OpenBSD: mkfs.c,v 1.27 2003/05/06 04:32:16 tedu Exp $";
#endif
#endif /* not lint */
@@ -613,10 +613,9 @@ next:
sblock.fs_fmod = 0;
sblock.fs_ronly = 0;
sblock.fs_clean = FS_ISCLEAN;
-#ifdef FSIRAND
sblock.fs_id[0] = (u_int32_t)utime;
sblock.fs_id[1] = (u_int32_t)arc4random();
-#endif
+
/*
* Dump out summary information about file system.
*/
@@ -754,10 +753,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 = (u_int32_t)arc4random();
-#endif
wtfs(fsbtodb(&sblock, cgimin(&sblock, cylno) + i),
sblock.fs_bsize, (char *)zino);
}
@@ -1031,9 +1028,7 @@ iput(ip, ino)
daddr_t d;
int c;
-#ifdef FSIRAND
ip->di_gen = (u_int32_t)arc4random();
-#endif
c = ino_to_cg(&sblock, ino);
rdfs(fsbtodb(&sblock, cgtod(&sblock, 0)), sblock.fs_cgsize,
(char *)&acg);