linux-next/fs/ufs
Al Viro 64f30e80d6 clean ufs_trunc_direct() up a bit...
For short files (== no indirect blocks needed) UFS allows the last
block to be a partial one.  That creates some complications for
truncation down to "short file" lengths.  ufs_trunc_direct() is
called when we'd already made sure that new EOF is not in a hole;
nothing needs to be done if we are extending the file and in
case we are shrinking the file it needs to
	* shrink or free the old final block.
	* free all full direct blocks between the new and old EOF.
	* possibly shrink the new final block.

The logics is needlessly complicated by trying to keep all cases
handled by the same sequence of operations.
	if not shrinking
		nothing to do
	else if number of full blocks unchanged
		free the tail of possibly partial last block
	else
		free the tail of (currently full) new last block
		free all present (full) blocks in between
		free the (possibly partial) old last block

is easier to follow than the result of trying to unify these
cases.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2024-10-18 17:35:31 -04:00
..
balloc.c ufs_free_fragments(): fix the braino in sanity check 2024-10-18 17:35:31 -04:00
cylinder.c ufs: fix ufs_read_cylinder() failure handling 2024-10-18 17:35:31 -04:00
dir.c ufs: fix handling of delete_entry and set_link failures 2024-10-18 17:35:30 -04:00
file.c ufs: missing ->splice_write() 2024-10-18 17:35:31 -04:00
ialloc.c ufs: convert to new timestamp accessors 2023-10-18 14:08:28 +02:00
inode.c clean ufs_trunc_direct() up a bit... 2024-10-18 17:35:31 -04:00
Kconfig fs: add CONFIG_BUFFER_HEAD 2023-08-02 09:13:09 -06:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
namei.c ufs: fix handling of delete_entry and set_link failures 2024-10-18 17:35:30 -04:00
super.c ufs: get rid of ubh_{ubhcpymem,memcpyubh}() 2024-10-18 17:35:31 -04:00
swab.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ufs_fs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ufs.h ufs: fix handling of delete_entry and set_link failures 2024-10-18 17:35:30 -04:00
util.c ufs: get rid of ubh_{ubhcpymem,memcpyubh}() 2024-10-18 17:35:31 -04:00
util.h ufs: get rid of ubh_{ubhcpymem,memcpyubh}() 2024-10-18 17:35:31 -04:00