From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 18:14:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E916106566C; Thu, 11 Feb 2010 18:14:54 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D1F48FC16; Thu, 11 Feb 2010 18:14:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1BIEsI4049974; Thu, 11 Feb 2010 18:14:54 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1BIEsiR049971; Thu, 11 Feb 2010 18:14:54 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201002111814.o1BIEsiR049971@svn.freebsd.org> From: Kirk McKusick Date: Thu, 11 Feb 2010 18:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203784 - in head: sbin/newfs sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 18:14:54 -0000 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 */