summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-05-02 02:13:22 +0000
committerpfg <pfg@FreeBSD.org>2016-05-02 02:13:22 +0000
commite7cb48074e72aa8209dfd5e9c378956d91bd7ab3 (patch)
treee137d8be73264d4debcc5eb08201925c21a518fc
parentb9642c7349dd7af1833d3b2219914b1ec951d410 (diff)
downloadFreeBSD-src-e7cb48074e72aa8209dfd5e9c378956d91bd7ab3.zip
FreeBSD-src-e7cb48074e72aa8209dfd5e9c378956d91bd7ab3.tar.gz
quot: make use of our rounddown() macro when <sys/param.h> is available.
No functional change.
-rw-r--r--usr.sbin/quot/quot.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/quot/quot.c b/usr.sbin/quot/quot.c
index ac90da6..9e9ae79 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;
OpenPOWER on IntegriCloud