sbin: ake use of our rounddown() macro when sys/param.h is available.
No functional change.
This commit is contained in:
parent
312717174d
commit
f32d2926b0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298872
@ -267,7 +267,7 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (blocksperfile)
|
if (blocksperfile)
|
||||||
blocksperfile = blocksperfile / ntrec * ntrec; /* round down */
|
blocksperfile = rounddown(blocksperfile, ntrec);
|
||||||
else if (!unlimited) {
|
else if (!unlimited) {
|
||||||
/*
|
/*
|
||||||
* Determine how to default tape size and density
|
* Determine how to default tape size and density
|
||||||
|
@ -293,7 +293,7 @@ ginode(ino_t inumber)
|
|||||||
if (pbp != NULL)
|
if (pbp != NULL)
|
||||||
pbp->b_flags &= ~B_INUSE;
|
pbp->b_flags &= ~B_INUSE;
|
||||||
pbp = getdatablk(iblk, sblock.fs_bsize, BT_INODES);
|
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)
|
if (sblock.fs_magic == FS_UFS1_MAGIC)
|
||||||
return ((union dinode *)
|
return ((union dinode *)
|
||||||
|
@ -911,7 +911,7 @@ ino_isat(ino_t parent, off_t diroff, ino_t child, int *mode, int *isdot)
|
|||||||
* certain we hit a valid record and not some junk in the middle
|
* 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.
|
* of a file name. Stop when we reach or pass the expected offset.
|
||||||
*/
|
*/
|
||||||
dpoff = (doff / DIRBLKSIZ) * DIRBLKSIZ;
|
dpoff = rounddown(doff, DIRBLKSIZ);
|
||||||
do {
|
do {
|
||||||
dp = (struct direct *)&block[dpoff];
|
dp = (struct direct *)&block[dpoff];
|
||||||
if (dpoff == doff)
|
if (dpoff == doff)
|
||||||
|
@ -255,7 +255,7 @@ virstor_label(struct gctl_req *req)
|
|||||||
if (md.md_chunk_size % MAXPHYS != 0) {
|
if (md.md_chunk_size % MAXPHYS != 0) {
|
||||||
/* XXX: This is not strictly needed, but it's convenient to
|
/* XXX: This is not strictly needed, but it's convenient to
|
||||||
* impose some limitations on it, so why not MAXPHYS. */
|
* 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)
|
if (new_size < md.md_chunk_size)
|
||||||
new_size += MAXPHYS;
|
new_size += MAXPHYS;
|
||||||
fprintf(stderr, "Resizing chunk size to be a multiple of "
|
fprintf(stderr, "Resizing chunk size to be a multiple of "
|
||||||
|
@ -207,7 +207,7 @@ main(int argc, char * const argv[])
|
|||||||
sectorsize = stripesize;
|
sectorsize = stripesize;
|
||||||
|
|
||||||
minsize = sectorsize;
|
minsize = sectorsize;
|
||||||
bigsize = (bigsize / sectorsize) * sectorsize;
|
bigsize = rounddown(bigsize, sectorsize);
|
||||||
|
|
||||||
error = ioctl(fdr, DIOCGMEDIASIZE, &t);
|
error = ioctl(fdr, DIOCGMEDIASIZE, &t);
|
||||||
if (error < 0)
|
if (error < 0)
|
||||||
@ -222,7 +222,7 @@ main(int argc, char * const argv[])
|
|||||||
for (ch = 0; (bigsize >> ch) > minsize; ch++)
|
for (ch = 0; (bigsize >> ch) > minsize; ch++)
|
||||||
continue;
|
continue;
|
||||||
medsize = bigsize >> (ch / 2);
|
medsize = bigsize >> (ch / 2);
|
||||||
medsize = (medsize / minsize) * minsize;
|
medsize = rounddown(medsize, minsize);
|
||||||
|
|
||||||
fprintf(stderr, "Bigsize = %zu, medsize = %zu, minsize = %zu\n",
|
fprintf(stderr, "Bigsize = %zu, medsize = %zu, minsize = %zu\n",
|
||||||
bigsize, medsize, minsize);
|
bigsize, medsize, minsize);
|
||||||
|
Loading…
Reference in New Issue
Block a user