From 6e560add61beb9de31ada2ea8be3b6991418cf3e Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Mon, 2 May 2016 02:13:22 +0000 Subject: [PATCH] quot: make use of our rounddown() macro when is available. No functional change. --- usr.sbin/quot/quot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/quot/quot.c b/usr.sbin/quot/quot.c index ac90da6a1cb..9e9ae7900db 100644 --- a/usr.sbin/quot/quot.c +++ b/usr.sbin/quot/quot.c @@ -142,7 +142,7 @@ get_inode(int fd, struct fs *super, ino_t 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 *name) 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;