diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-06-18 17:23:34 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-07-06 17:39:46 -0400 |
commit | 6aab6dd37946d0d592105872bd533bb7d2931f3f (patch) | |
tree | 4f70e41310abcaa6db31885599fabdaa8951dbf1 /fs/ufs | |
parent | 6d1ebbca2b2fe516ff5f279848cffbd23d2b0270 (diff) |
ufs_trunc_branch(): massage towards killing recursion
We always have 0 < depth2 <= depth in there, so
if (--depth) {
if (--depth2)
A
B
} else {
C // not using depth2
}
D // not using depth2
is equivalent to
if (--depth2)
A with s/depth/depth - 1/
if (--depth)
B
else
C
D
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ufs')
-rw-r--r-- | fs/ufs/inode.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index c06556558c9b..dac81c318da7 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c | |||
@@ -1145,12 +1145,12 @@ static void ufs_trunc_branch(struct inode *inode, unsigned *offsets, int depth2, | |||
1145 | return; | 1145 | return; |
1146 | } | 1146 | } |
1147 | 1147 | ||
1148 | if (--depth2) { | ||
1149 | void *ind = ubh_get_data_ptr(uspi, ubh, from++); | ||
1150 | ufs_trunc_branch(inode, offsets, depth2, depth - 1, ind); | ||
1151 | ubh_mark_buffer_dirty(ubh); | ||
1152 | } | ||
1148 | if (--depth) { | 1153 | if (--depth) { |
1149 | if (--depth2) { | ||
1150 | void *ind = ubh_get_data_ptr(uspi, ubh, from++); | ||
1151 | ufs_trunc_branch(inode, offsets, depth2, depth, ind); | ||
1152 | ubh_mark_buffer_dirty(ubh); | ||
1153 | } | ||
1154 | for (i = from ; i < uspi->s_apb ; i++) { | 1154 | for (i = from ; i < uspi->s_apb ; i++) { |
1155 | void *ind = ubh_get_data_ptr(uspi, ubh, i); | 1155 | void *ind = ubh_get_data_ptr(uspi, ubh, i); |
1156 | free_full_branch(inode, depth, ind); | 1156 | free_full_branch(inode, depth, ind); |