From owner-svn-src-stable-9@FreeBSD.ORG Sun Jun 16 00:59:26 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 33994AB3; Sun, 16 Jun 2013 00:59:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A6EC100A; Sun, 16 Jun 2013 00:59:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5G0xPsY096564; Sun, 16 Jun 2013 00:59:25 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5G0xPa8096562; Sun, 16 Jun 2013 00:59:25 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201306160059.r5G0xPa8096562@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 16 Jun 2013 00:59:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251798 - stable/9/sys/fs/ext2fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2013 00:59:26 -0000 Author: pfg Date: Sun Jun 16 00:59:24 2013 New Revision: 251798 URL: http://svnweb.freebsd.org/changeset/base/251798 Log: MFC r251677: Relax some unnecessary unsigned type changes in ext2fs. While the changes in r245820 are in line with the ext2 spec, the code derived from UFS can use negative values so it is better to relax some types to keep them as they were, and somewhat more similar to UFS. While here clean some casts. Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c stable/9/sys/fs/ext2fs/ext2_balloc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_alloc.c Sat Jun 15 22:22:03 2013 (r251797) +++ stable/9/sys/fs/ext2fs/ext2_alloc.c Sun Jun 16 00:59:24 2013 (r251798) @@ -223,7 +223,7 @@ ext2_reallocblks(struct vop_reallocblks_ brelse(sbp); return (ENOSPC); } - sbap = (int32_t *)sbp->b_data; + sbap = (u_int *)sbp->b_data; soff = idp->in_off; } /* @@ -239,7 +239,7 @@ ext2_reallocblks(struct vop_reallocblks_ ssize = len - (idp->in_off + 1); if (bread(vp, idp->in_lbn, (int)fs->e2fs_bsize, NOCRED, &ebp)) goto fail; - ebap = (int32_t *)ebp->b_data; + ebap = (u_int *)ebp->b_data; } /* * Find the preferred location for the cluster. @@ -442,10 +442,10 @@ ext2_dirpref(struct inode *pip) { struct m_ext2fs *fs; int cg, prefcg, dirsize, cgsize; - int avgifree, avgbfree, avgndir, curdirsize; - int minifree, minbfree, maxndir; - int mincg, minndir; - int maxcontigdirs; + u_int avgifree, avgbfree, avgndir, curdirsize; + u_int minifree, minbfree, maxndir; + u_int mincg, minndir; + u_int maxcontigdirs; mtx_assert(EXT2_MTX(pip->i_ump), MA_OWNED); fs = pip->i_e2fs; Modified: stable/9/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_balloc.c Sat Jun 15 22:22:03 2013 (r251797) +++ stable/9/sys/fs/ext2fs/ext2_balloc.c Sun Jun 16 00:59:24 2013 (r251798) @@ -60,11 +60,11 @@ ext2_balloc(struct inode *ip, int32_t lb { struct m_ext2fs *fs; struct ext2mount *ump; - int32_t nb; struct buf *bp, *nbp; struct vnode *vp = ITOV(ip); struct indir indirs[NIADDR + 2]; - uint32_t newb, *bap, pref; + uint32_t nb, newb; + int32_t *bap, pref; int osize, nsize, num, i, error; *bpp = NULL; @@ -165,8 +165,8 @@ ext2_balloc(struct inode *ip, int32_t lb EXT2_LOCK(ump); pref = ext2_blkpref(ip, lbn, indirs[0].in_off + EXT2_NDIR_BLOCKS, &ip->i_db[0], 0); - if ((error = ext2_alloc(ip, lbn, pref, - (int)fs->e2fs_bsize, cred, &newb))) + if ((error = ext2_alloc(ip, lbn, pref, fs->e2fs_bsize, cred, + &newb))) return (error); nb = newb; bp = getblk(vp, indirs[1].in_lbn, fs->e2fs_bsize, 0, 0, 0);