summaryrefslogtreecommitdiff
path: root/lib/fsusage.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1993-03-29 05:09:09 +0000
committerJim Meyering <jim@meyering.net>1993-03-29 05:09:09 +0000
commit80f8bd8e8c5f610143a929dc5f9eeedb02db7aec (patch)
tree2938b5193deb43c8f7172f70e330872f81df26bd /lib/fsusage.c
parenteb652720df63b7cb5a7b1eaf51dc05445a545c66 (diff)
downloadcoreutils-80f8bd8e8c5f610143a929dc5f9eeedb02db7aec.tar.xz
merge with 3.4.1
Diffstat (limited to 'lib/fsusage.c')
-rw-r--r--lib/fsusage.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/fsusage.c b/lib/fsusage.c
index 8cc0c6d73..b43491343 100644
--- a/lib/fsusage.c
+++ b/lib/fsusage.c
@@ -56,14 +56,18 @@ int statvfs ();
/* Return the number of TOSIZE-byte blocks used by
BLOCKS FROMSIZE-byte blocks, rounding up. */
-#define adjust_blocks(blocks, fromsize, tosize) \
- (((fromsize) == (tosize)) \
- ? (blocks) /* E.g., from 512 to 512. */ \
- : (((fromsize) > (tosize)) \
- /* E.g., from 2048 to 512. */ \
- ? (blocks) * ((fromsize) / (tosize)) \
- /* E.g., from 256 to 512. */ \
- : ((blocks) + 1) / ((tosize) / (fromsize))))
+static long
+adjust_blocks (blocks, fromsize, tosize)
+ long blocks;
+ int fromsize, tosize;
+{
+ if (fromsize == tosize) /* E.g., from 512 to 512. */
+ return blocks;
+ else if (fromsize > tosize) /* E.g., from 2048 to 512. */
+ return blocks * (fromsize / tosize);
+ else /* E.g., from 256 to 512. */
+ return (blocks + 1) / (tosize / fromsize);
+}
/* Fill in the fields of FSP with information about space usage for
the filesystem on which PATH resides.