diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-06-18 15:42:25 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-07-06 17:39:40 -0400 |
commit | ef3a315d4ca179fd0b56597e695cd262a8b559b7 (patch) | |
tree | a8d1b2def7f180014995f429f40f7d39f8e0edf2 /fs/ufs | |
parent | 9e0fbbde2724d5d3bb9edca6b77e26eb28341154 (diff) |
__ufs_truncate_blocks(): unify freeing the full branches
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ufs')
-rw-r--r-- | fs/ufs/inode.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index 0d57c41b7705..1427d277a690 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c @@ -1235,31 +1235,30 @@ static void __ufs_truncate_blocks(struct inode *inode) switch (depth) { case 1: ufs_trunc_direct(inode); - ufs_trunc_branch(inode, NULL, 0, 1, - ufs_get_direct_data_ptr(uspi, ufsi, UFS_IND_BLOCK)); - ufs_trunc_branch(inode, NULL, 0, 2, - ufs_get_direct_data_ptr(uspi, ufsi, UFS_DIND_BLOCK)); - ufs_trunc_branch(inode, NULL, 0, 3, - ufs_get_direct_data_ptr(uspi, ufsi, UFS_TIND_BLOCK)); - break; + goto l1; case 2: ufs_trunc_branch(inode, offsets + 1, depth2, 1, ufs_get_direct_data_ptr(uspi, ufsi, UFS_IND_BLOCK)); - ufs_trunc_branch(inode, NULL, 0, 2, - ufs_get_direct_data_ptr(uspi, ufsi, UFS_DIND_BLOCK)); - ufs_trunc_branch(inode, NULL, 0, 3, - ufs_get_direct_data_ptr(uspi, ufsi, UFS_TIND_BLOCK)); - break; + goto l2; case 3: ufs_trunc_branch(inode, offsets + 1, depth2, 2, ufs_get_direct_data_ptr(uspi, ufsi, UFS_DIND_BLOCK)); - ufs_trunc_branch(inode, NULL, 0, 3, - ufs_get_direct_data_ptr(uspi, ufsi, UFS_TIND_BLOCK)); - break; + goto l3; case 4: ufs_trunc_branch(inode, offsets + 1, depth2, 3, ufs_get_direct_data_ptr(uspi, ufsi, UFS_TIND_BLOCK)); + goto l4; } +l1: + ufs_trunc_branch(inode, NULL, 0, 1, + ufs_get_direct_data_ptr(uspi, ufsi, UFS_IND_BLOCK)); +l2: + ufs_trunc_branch(inode, NULL, 0, 2, + ufs_get_direct_data_ptr(uspi, ufsi, UFS_DIND_BLOCK)); +l3: + ufs_trunc_branch(inode, NULL, 0, 3, + ufs_get_direct_data_ptr(uspi, ufsi, UFS_TIND_BLOCK)); +l4: ufsi->i_lastfrag = DIRECT_FRAGMENT; mutex_unlock(&ufsi->truncate_mutex); } |