From owner-svn-src-all@freebsd.org Mon May 2 02:13:24 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 35966B29B0C; Mon, 2 May 2016 02:13:24 +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 E58401D01; Mon, 2 May 2016 02:13:23 +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 u422DNKH096981; Mon, 2 May 2016 02:13:23 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u422DNQC096980; Mon, 2 May 2016 02:13:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605020213.u422DNQC096980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 2 May 2016 02:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298913 - head/usr.sbin/quot 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: Mon, 02 May 2016 02:13:24 -0000 Author: pfg Date: Mon May 2 02:13:22 2016 New Revision: 298913 URL: https://svnweb.freebsd.org/changeset/base/298913 Log: quot: make use of our rounddown() macro when is available. No functional change. Modified: head/usr.sbin/quot/quot.c Modified: head/usr.sbin/quot/quot.c ============================================================================== --- head/usr.sbin/quot/quot.c Mon May 2 01:49:42 2016 (r298912) +++ head/usr.sbin/quot/quot.c Mon May 2 02:13:22 2016 (r298913) @@ -142,7 +142,7 @@ get_inode(int fd, struct fs *super, ino_ if (!ipbuf && !(ipbuf = malloc(INOSZ(super)))) errx(1, "allocate inodes"); - last = (ino / INOCNT(super)) * INOCNT(super); + last = rounddown(ino, INOCNT(super)); if (lseek(fd, (off_t)ino_to_fsba(super, last) << super->fs_fshift, 0) < (off_t)0 || read(fd, ipbuf, INOSZ(super)) != (ssize_t)INOSZ(super)) err(1, "read inodes"); @@ -414,7 +414,7 @@ dofsizes(int fd, struct fs *super, char errx(1, "allocate fsize structure"); fp->fsz_next = *fsp; *fsp = fp; - fp->fsz_first = (ksz / FSZCNT) * FSZCNT; + fp->fsz_first = rounddown(ksz, FSZCNT); fp->fsz_last = fp->fsz_first + FSZCNT; for (i = FSZCNT; --i >= 0;) { fp->fsz_count[i] = 0;