Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Feb 2010 19:51:30 +0000 (UTC)
From:      Gavin Atkinson <gavin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r203397 - stable/8/sbin/growfs
Message-ID:  <201002021951.o12JpU9R060302@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gavin
Date: Tue Feb  2 19:51:30 2010
New Revision: 203397
URL: http://svn.freebsd.org/changeset/base/203397

Log:
  Merge r201401 from head:
  
    Remove dead code.  This section of code is only run in the
    (sblock.fs_magic == FS_UFS1_MAGIC) case, so the check within the
    loop is redundant.
  
  PR:		bin/115174 (partly)
  Submitted by:	Nate Eldredge  nge cs.hmc.edu
  Reviewed by:	mjacob
  Approved by:	ed (mentor, implicit)

Modified:
  stable/8/sbin/growfs/growfs.c
Directory Properties:
  stable/8/sbin/growfs/   (props changed)

Modified: stable/8/sbin/growfs/growfs.c
==============================================================================
--- stable/8/sbin/growfs/growfs.c	Tue Feb  2 19:44:52 2010	(r203396)
+++ stable/8/sbin/growfs/growfs.c	Tue Feb  2 19:51:30 2010	(r203397)
@@ -376,7 +376,6 @@ initcg(int cylno, time_t utime, int fso,
 	long d, dlower, dupper, blkno, start;
 	ufs2_daddr_t i, cbase, dmax;
 	struct ufs1_dinode *dp1;
-	struct ufs2_dinode *dp2;
 	struct csum *cs;
 
 	if (iobuf == NULL && (iobuf = malloc(sblock.fs_bsize)) == NULL) {
@@ -455,16 +454,11 @@ initcg(int cylno, time_t utime, int fso,
 		for (i = 2 * sblock.fs_frag; i < sblock.fs_ipg / INOPF(&sblock);
 		     i += sblock.fs_frag) {
 			dp1 = (struct ufs1_dinode *)iobuf;
-			dp2 = (struct ufs2_dinode *)iobuf;
 #ifdef FSIRAND
-			for (j = 0; j < INOPB(&sblock); j++)
-				if (sblock.fs_magic == FS_UFS1_MAGIC) {
-					dp1->di_gen = random();
-					dp1++;
-				} else {
-					dp2->di_gen = random();
-					dp2++;
-				}
+			for (j = 0; j < INOPB(&sblock); j++) {
+				dp1->di_gen = random();
+				dp1++;
+			}
 #endif
 			wtfs(fsbtodb(&sblock, cgimin(&sblock, cylno) + i),
 			    sblock.fs_bsize, iobuf, fso, Nflag);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002021951.o12JpU9R060302>