summaryrefslogtreecommitdiff
path: root/fs/ufs/util.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2017-06-14 16:36:29 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2017-06-14 16:43:03 -0400
commitc596961d1b4ccc6f15754fe5a49c37ac6da57145 (patch)
tree984ec943e69b3f61920bc4eda674216a49552108 /fs/ufs/util.h
parentb451cec4bbd913688f5381efad407762a64a92ce (diff)
downloadlinux-c596961d1b4ccc6f15754fe5a49c37ac6da57145.tar.gz
linux-c596961d1b4ccc6f15754fe5a49c37ac6da57145.tar.xz
ufs: fix s_size/s_dsize users
For UFS2 we need 64bit variants; we even store them in uspi, but use 32bit ones instead. One wrinkle is in handling of reserved space - recalculating it every time had been stupid all along, but now it would become really ugly. Just calculate it once... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ufs/util.h')
-rw-r--r--fs/ufs/util.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/ufs/util.h b/fs/ufs/util.h
index 1e1639f8a58b..9fc7119a1551 100644
--- a/fs/ufs/util.h
+++ b/fs/ufs/util.h
@@ -350,16 +350,11 @@ static inline void *ubh_get_data_ptr(struct ufs_sb_private_info *uspi,
#define ubh_blkmap(ubh,begin,bit) \
((*ubh_get_addr(ubh, (begin) + ((bit) >> 3)) >> ((bit) & 7)) & (0xff >> (UFS_MAXFRAG - uspi->s_fpb)))
-/*
- * Determine the number of available frags given a
- * percentage to hold in reserve.
- */
-static inline s64
-ufs_freespace(struct ufs_sb_private_info *uspi, int percentreserved)
+static inline u64
+ufs_freefrags(struct ufs_sb_private_info *uspi)
{
return ufs_blkstofrags(uspi->cs_total.cs_nbfree) +
- uspi->cs_total.cs_nffree -
- (uspi->s_dsize * percentreserved) / 100;
+ uspi->cs_total.cs_nffree;
}
/*