There's probably more than we can convert to this.
* punch-hole/truncate this to release the disk space. */
bs = MAX(st.st_blksize, 512);
- l = DIV_ROUND_UP(st.st_size, bs) * bs; /* Round up to next block size */
+ l = ROUND_UP(st.st_size, bs); /* Round up to next block size */
if (fallocate(truncate_fd, FALLOC_FL_PUNCH_HOLE|FALLOC_FL_KEEP_SIZE, 0, l) >= 0)
return 0; /* Successfully punched a hole! 😊 */
}
/* Increase by larger blocks at once */
- new_size = DIV_ROUND_UP(new_size, FILE_SIZE_INCREASE) * FILE_SIZE_INCREASE;
+ new_size = ROUND_UP(new_size, FILE_SIZE_INCREASE);
if (f->metrics.max_size > 0 && new_size > f->metrics.max_size)
new_size = f->metrics.max_size;
} else if (c->repeat > 0) {
int k;
- k = start + c->repeat * DIV_ROUND_UP(*val - start, c->repeat);
+ k = start + ROUND_UP(*val - start, c->repeat);
if ((!d_set || k < d) && (stop < 0 || k <= stop)) {
d = k;