提交 ef3a315d 编写于 作者: A Al Viro

__ufs_truncate_blocks(): unify freeing the full branches

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 9e0fbbde
...@@ -1235,31 +1235,30 @@ static void __ufs_truncate_blocks(struct inode *inode) ...@@ -1235,31 +1235,30 @@ static void __ufs_truncate_blocks(struct inode *inode)
switch (depth) { switch (depth) {
case 1: case 1:
ufs_trunc_direct(inode); ufs_trunc_direct(inode);
ufs_trunc_branch(inode, NULL, 0, 1, goto l1;
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;
case 2: case 2:
ufs_trunc_branch(inode, offsets + 1, depth2, 1, ufs_trunc_branch(inode, offsets + 1, depth2, 1,
ufs_get_direct_data_ptr(uspi, ufsi, UFS_IND_BLOCK)); ufs_get_direct_data_ptr(uspi, ufsi, UFS_IND_BLOCK));
ufs_trunc_branch(inode, NULL, 0, 2, goto l2;
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;
case 3: case 3:
ufs_trunc_branch(inode, offsets + 1, depth2, 2, ufs_trunc_branch(inode, offsets + 1, depth2, 2,
ufs_get_direct_data_ptr(uspi, ufsi, UFS_DIND_BLOCK)); ufs_get_direct_data_ptr(uspi, ufsi, UFS_DIND_BLOCK));
ufs_trunc_branch(inode, NULL, 0, 3, goto l3;
ufs_get_direct_data_ptr(uspi, ufsi, UFS_TIND_BLOCK));
break;
case 4: case 4:
ufs_trunc_branch(inode, offsets + 1, depth2, 3, ufs_trunc_branch(inode, offsets + 1, depth2, 3,
ufs_get_direct_data_ptr(uspi, ufsi, UFS_TIND_BLOCK)); 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; ufsi->i_lastfrag = DIRECT_FRAGMENT;
mutex_unlock(&ufsi->truncate_mutex); mutex_unlock(&ufsi->truncate_mutex);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册