From owner-svn-src-all@freebsd.org Sun May 1 02:24:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A994AAD9D81; Sun, 1 May 2016 02:24:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84E101FA5; Sun, 1 May 2016 02:24:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u412O5ni062874; Sun, 1 May 2016 02:24:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u412O5tG062869; Sun, 1 May 2016 02:24:05 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605010224.u412O5tG062869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 02:24:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298872 - in head/sbin: dump fsck_ffs geom/class/virstor recoverdisk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 01 May 2016 02:24:06 -0000 Author: pfg Date: Sun May 1 02:24:05 2016 New Revision: 298872 URL: https://svnweb.freebsd.org/changeset/base/298872 Log: sbin: ake use of our rounddown() macro when sys/param.h is available. No functional change. Modified: head/sbin/dump/main.c head/sbin/fsck_ffs/inode.c head/sbin/fsck_ffs/suj.c head/sbin/geom/class/virstor/geom_virstor.c head/sbin/recoverdisk/recoverdisk.c Modified: head/sbin/dump/main.c ============================================================================== --- head/sbin/dump/main.c Sun May 1 02:19:49 2016 (r298871) +++ head/sbin/dump/main.c Sun May 1 02:24:05 2016 (r298872) @@ -267,7 +267,7 @@ main(int argc, char *argv[]) } if (blocksperfile) - blocksperfile = blocksperfile / ntrec * ntrec; /* round down */ + blocksperfile = rounddown(blocksperfile, ntrec); else if (!unlimited) { /* * Determine how to default tape size and density Modified: head/sbin/fsck_ffs/inode.c ============================================================================== --- head/sbin/fsck_ffs/inode.c Sun May 1 02:19:49 2016 (r298871) +++ head/sbin/fsck_ffs/inode.c Sun May 1 02:24:05 2016 (r298872) @@ -293,7 +293,7 @@ ginode(ino_t inumber) if (pbp != NULL) pbp->b_flags &= ~B_INUSE; pbp = getdatablk(iblk, sblock.fs_bsize, BT_INODES); - startinum = (inumber / INOPB(&sblock)) * INOPB(&sblock); + startinum = rounddown(inumber, INOPB(&sblock)); } if (sblock.fs_magic == FS_UFS1_MAGIC) return ((union dinode *) Modified: head/sbin/fsck_ffs/suj.c ============================================================================== --- head/sbin/fsck_ffs/suj.c Sun May 1 02:19:49 2016 (r298871) +++ head/sbin/fsck_ffs/suj.c Sun May 1 02:24:05 2016 (r298872) @@ -911,7 +911,7 @@ ino_isat(ino_t parent, off_t diroff, ino * certain we hit a valid record and not some junk in the middle * of a file name. Stop when we reach or pass the expected offset. */ - dpoff = (doff / DIRBLKSIZ) * DIRBLKSIZ; + dpoff = rounddown(doff, DIRBLKSIZ); do { dp = (struct direct *)&block[dpoff]; if (dpoff == doff) Modified: head/sbin/geom/class/virstor/geom_virstor.c ============================================================================== --- head/sbin/geom/class/virstor/geom_virstor.c Sun May 1 02:19:49 2016 (r298871) +++ head/sbin/geom/class/virstor/geom_virstor.c Sun May 1 02:24:05 2016 (r298872) @@ -255,7 +255,7 @@ virstor_label(struct gctl_req *req) if (md.md_chunk_size % MAXPHYS != 0) { /* XXX: This is not strictly needed, but it's convenient to * impose some limitations on it, so why not MAXPHYS. */ - size_t new_size = (md.md_chunk_size / MAXPHYS) * MAXPHYS; + size_t new_size = rounddown(md.md_chunk_size, MAXPHYS); if (new_size < md.md_chunk_size) new_size += MAXPHYS; fprintf(stderr, "Resizing chunk size to be a multiple of " Modified: head/sbin/recoverdisk/recoverdisk.c ============================================================================== --- head/sbin/recoverdisk/recoverdisk.c Sun May 1 02:19:49 2016 (r298871) +++ head/sbin/recoverdisk/recoverdisk.c Sun May 1 02:24:05 2016 (r298872) @@ -207,7 +207,7 @@ main(int argc, char * const argv[]) sectorsize = stripesize; minsize = sectorsize; - bigsize = (bigsize / sectorsize) * sectorsize; + bigsize = rounddown(bigsize, sectorsize); error = ioctl(fdr, DIOCGMEDIASIZE, &t); if (error < 0) @@ -222,7 +222,7 @@ main(int argc, char * const argv[]) for (ch = 0; (bigsize >> ch) > minsize; ch++) continue; medsize = bigsize >> (ch / 2); - medsize = (medsize / minsize) * minsize; + medsize = rounddown(medsize, minsize); fprintf(stderr, "Bigsize = %zu, medsize = %zu, minsize = %zu\n", bigsize, medsize, minsize);