Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Feb 2010 18:14:54 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r203784 - in head: sbin/newfs sys/ufs/ffs
Message-ID:  <201002111814.o1BIEsiR049971@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckusick
Date: Thu Feb 11 18:14:53 2010
New Revision: 203784
URL: http://svn.freebsd.org/changeset/base/203784

Log:
  One last pass to get all the unsigned comparisons correct.

Modified:
  head/sbin/newfs/mkfs.c
  head/sys/ufs/ffs/fs.h

Modified: head/sbin/newfs/mkfs.c
==============================================================================
--- head/sbin/newfs/mkfs.c	Thu Feb 11 18:00:53 2010	(r203783)
+++ head/sbin/newfs/mkfs.c	Thu Feb 11 18:14:53 2010	(r203784)
@@ -114,7 +114,8 @@ void
 mkfs(struct partition *pp, char *fsys)
 {
 	int fragsperinode, optimalfpg, origdensity, minfpg, lastminfpg;
-	long i, j, cylno, csfrags;
+	long i, j, csfrags;
+	uint cg;
 	time_t utime;
 	quad_t sizepb;
 	int width;
@@ -510,9 +511,9 @@ restart:
 			fsdummy.fs_magic = 0;
 			bwrite(&disk, part_ofs + SBLOCK_UFS1 / disk.d_bsize,
 			    chdummy, SBLOCKSIZE);
-			for (i = 0; i < fsdummy.fs_ncg; i++)
+			for (cg = 0; cg < fsdummy.fs_ncg; cg++)
 				bwrite(&disk, part_ofs + fsbtodb(&fsdummy,
-				    cgsblock(&fsdummy, i)), chdummy, SBLOCKSIZE);
+				  cgsblock(&fsdummy, cg)), chdummy, SBLOCKSIZE);
 		}
 	}
 	if (!Nflag)
@@ -550,11 +551,11 @@ restart:
 	 * writing out in each cylinder group.
 	 */
 	bcopy((char *)&sblock, iobuf, SBLOCKSIZE);
-	for (cylno = 0; cylno < sblock.fs_ncg; cylno++) {
-		initcg(cylno, utime);
+	for (cg = 0; cg < sblock.fs_ncg; cg++) {
+		initcg(cg, utime);
 		j = snprintf(tmpbuf, sizeof(tmpbuf), " %jd%s",
-		    (intmax_t)fsbtodb(&sblock, cgsblock(&sblock, cylno)),
-		    cylno < (sblock.fs_ncg-1) ? "," : "");
+		    (intmax_t)fsbtodb(&sblock, cgsblock(&sblock, cg)),
+		    cg < (sblock.fs_ncg-1) ? "," : "");
 		if (j < 0)
 			tmpbuf[j = 0] = '\0';
 		if (i + j >= width) {
@@ -608,7 +609,8 @@ restart:
 void
 initcg(int cylno, time_t utime)
 {
-	long i, j, d, dlower, dupper, blkno, start;
+	long blkno, start;
+	uint i, j, d, dlower, dupper;
 	ufs2_daddr_t cbase, dmax;
 	struct ufs1_dinode *dp1;
 	struct ufs2_dinode *dp2;
@@ -665,7 +667,7 @@ initcg(int cylno, time_t utime)
 		acg.cg_nextfreeoff = acg.cg_clusteroff +
 		    howmany(fragstoblks(&sblock, sblock.fs_fpg), CHAR_BIT);
 	}
-	if (acg.cg_nextfreeoff > sblock.fs_cgsize) {
+	if (acg.cg_nextfreeoff > (unsigned)sblock.fs_cgsize) {
 		printf("Panic: cylinder group too big\n");
 		exit(37);
 	}
@@ -914,7 +916,8 @@ makedir(struct direct *protodir, int ent
 ufs2_daddr_t
 alloc(int size, int mode)
 {
-	int i, d, blkno, frag;
+	int i, blkno, frag;
+	uint d;
 
 	bread(&disk, part_ofs + fsbtodb(&sblock, cgtod(&sblock, 0)), (char *)&acg,
 	    sblock.fs_cgsize);

Modified: head/sys/ufs/ffs/fs.h
==============================================================================
--- head/sys/ufs/ffs/fs.h	Thu Feb 11 18:00:53 2010	(r203783)
+++ head/sys/ufs/ffs/fs.h	Thu Feb 11 18:14:53 2010	(r203784)
@@ -287,7 +287,7 @@ struct fs {
 	int32_t	 fs_spare1[2];		/* old fs_csmask */
 					/* old fs_csshift */
 	int32_t	 fs_nindir;		/* value of NINDIR */
-	int32_t	 fs_inopb;		/* value of INOPB */
+	u_int32_t fs_inopb;		/* value of INOPB */
 	int32_t	 fs_old_nspf;		/* value of NSPF */
 /* yet another configuration parameter */
 	int32_t	 fs_optim;		/* optimization preference, see below */



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