Skip to content

Commit 72be726

Browse files
Alexander Duyckdavem330
authored andcommitted
fib_trie: Minor cleanups to fib_table_flush_external
This change just does a couple of minor cleanups on fib_table_flush_external. Specifically it addresses the fact that resize was being called even though nothing was being removed from the table, and it drops an unecessary indent since we could just call continue on the inverse of the fi && flag check. Signed-off-by: Alexander Duyck <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2048823 commit 72be726

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

net/ipv4/fib_trie.c

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,13 +1586,8 @@ void fib_table_flush_external(struct fib_table *tb)
15861586
while (!(cindex--)) {
15871587
t_key pkey = pn->key;
15881588

1589-
n = pn;
1590-
pn = node_parent(n);
1591-
1592-
/* resize completed node */
1593-
resize(t, n);
1594-
15951589
/* if we got the root we are done */
1590+
pn = node_parent(pn);
15961591
if (!pn)
15971592
return;
15981593

@@ -1607,12 +1602,13 @@ void fib_table_flush_external(struct fib_table *tb)
16071602
hlist_for_each_entry(fa, &n->leaf, fa_list) {
16081603
struct fib_info *fi = fa->fa_info;
16091604

1610-
if (fi && (fi->fib_flags & RTNH_F_EXTERNAL)) {
1611-
netdev_switch_fib_ipv4_del(n->key,
1612-
KEYLENGTH - fa->fa_slen,
1613-
fi, fa->fa_tos,
1614-
fa->fa_type, tb->tb_id);
1615-
}
1605+
if (!fi || !(fi->fib_flags & RTNH_F_EXTERNAL))
1606+
continue;
1607+
1608+
netdev_switch_fib_ipv4_del(n->key,
1609+
KEYLENGTH - fa->fa_slen,
1610+
fi, fa->fa_tos,
1611+
fa->fa_type, tb->tb_id);
16161612
}
16171613

16181614
/* if trie is leaf only loop is completed */

0 commit comments

Comments
 (0)