summaryrefslogtreecommitdiffstats
path: root/fs/ufs/util.h
diff options
context:
space:
mode:
authorLinus Torvalds2017-06-17 10:30:07 +0200
committerLinus Torvalds2017-06-17 10:30:07 +0200
commitc8636b90a091331beb0a26c455a0c87b93aa774a (patch)
tree7a4eaacc9df0c17d91a0aaf13560f3ad41b6ada7 /fs/ufs/util.h
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vir... (diff)
parentufs_truncate_blocks(): fix the case when size is in the last direct block (diff)
downloadkernel-qcow2-linux-c8636b90a091331beb0a26c455a0c87b93aa774a.tar.gz
kernel-qcow2-linux-c8636b90a091331beb0a26c455a0c87b93aa774a.tar.xz
kernel-qcow2-linux-c8636b90a091331beb0a26c455a0c87b93aa774a.zip
Merge branch 'ufs-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull ufs fixes from Al Viro: "Fix assorted ufs bugs: a couple of deadlocks, fs corruption in truncate(), oopsen on tail unpacking and truncate when racing with vmscan, mild fs corruption (free blocks stats summary buggered, *BSD fsck would complain and fix), several instances of broken logics around reserved blocks (starting with "check almost never triggers when it should" and then there are issues with sufficiently large UFS2)" [ Note: ufs hasn't gotten any loving in a long time, because nobody really seems to use it. These ufs fixes are triggered by people actually caring now, not some sudden influx of new bugs. - Linus ] * 'ufs-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: ufs_truncate_blocks(): fix the case when size is in the last direct block ufs: more deadlock prevention on tail unpacking ufs: avoid grabbing ->truncate_mutex if possible ufs_get_locked_page(): make sure we have buffer_heads ufs: fix s_size/s_dsize users ufs: fix reserved blocks check ufs: make ufs_freespace() return signed ufs: fix logics in "ufs: make fsck -f happy"
Diffstat (limited to 'fs/ufs/util.h')
-rw-r--r--fs/ufs/util.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/ufs/util.h b/fs/ufs/util.h
index 398019fb1448..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 u64
-ufs_freespace(struct ufs_sb_private_info *uspi, int percentreserved)
+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;
}
/*