Commit d05f7a7d authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

ipv4: fib: Remove redundant argument

We always pass the same event type to fib_notify() and
fib_rules_notify(), so we can safely drop this argument.
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Acked-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c0243892
...@@ -238,14 +238,11 @@ int call_fib_notifier(struct notifier_block *nb, struct net *net, ...@@ -238,14 +238,11 @@ int call_fib_notifier(struct notifier_block *nb, struct net *net,
int call_fib_notifiers(struct net *net, enum fib_event_type event_type, int call_fib_notifiers(struct net *net, enum fib_event_type event_type,
struct fib_notifier_info *info); struct fib_notifier_info *info);
void fib_notify(struct net *net, struct notifier_block *nb, void fib_notify(struct net *net, struct notifier_block *nb);
enum fib_event_type event_type);
#ifdef CONFIG_IP_MULTIPLE_TABLES #ifdef CONFIG_IP_MULTIPLE_TABLES
void fib_rules_notify(struct net *net, struct notifier_block *nb, void fib_rules_notify(struct net *net, struct notifier_block *nb);
enum fib_event_type event_type);
#else #else
static inline void fib_rules_notify(struct net *net, struct notifier_block *nb, static inline void fib_rules_notify(struct net *net, struct notifier_block *nb)
enum fib_event_type event_type)
{ {
} }
#endif #endif
......
...@@ -66,8 +66,8 @@ int register_fib_notifier(struct notifier_block *nb, ...@@ -66,8 +66,8 @@ int register_fib_notifier(struct notifier_block *nb,
*/ */
rcu_read_lock(); rcu_read_lock();
for_each_net_rcu(net) { for_each_net_rcu(net) {
fib_rules_notify(net, nb, FIB_EVENT_RULE_ADD); fib_rules_notify(net, nb);
fib_notify(net, nb, FIB_EVENT_ENTRY_ADD); fib_notify(net, nb);
} }
rcu_read_unlock(); rcu_read_unlock();
......
...@@ -172,13 +172,12 @@ static int call_fib_rule_notifiers(struct net *net, ...@@ -172,13 +172,12 @@ static int call_fib_rule_notifiers(struct net *net,
return call_fib_notifiers(net, event_type, &info); return call_fib_notifiers(net, event_type, &info);
} }
void fib_rules_notify(struct net *net, struct notifier_block *nb, void fib_rules_notify(struct net *net, struct notifier_block *nb)
enum fib_event_type event_type)
{ {
struct fib_notifier_info info; struct fib_notifier_info info;
if (net->ipv4.fib_has_custom_rules) if (net->ipv4.fib_has_custom_rules)
call_fib_notifier(nb, net, event_type, &info); call_fib_notifier(nb, net, FIB_EVENT_RULE_ADD, &info);
} }
static const struct nla_policy fib4_rule_policy[FRA_MAX+1] = { static const struct nla_policy fib4_rule_policy[FRA_MAX+1] = {
......
...@@ -1902,8 +1902,7 @@ int fib_table_flush(struct net *net, struct fib_table *tb) ...@@ -1902,8 +1902,7 @@ int fib_table_flush(struct net *net, struct fib_table *tb)
} }
static void fib_leaf_notify(struct net *net, struct key_vector *l, static void fib_leaf_notify(struct net *net, struct key_vector *l,
struct fib_table *tb, struct notifier_block *nb, struct fib_table *tb, struct notifier_block *nb)
enum fib_event_type event_type)
{ {
struct fib_alias *fa; struct fib_alias *fa;
...@@ -1919,22 +1918,21 @@ static void fib_leaf_notify(struct net *net, struct key_vector *l, ...@@ -1919,22 +1918,21 @@ static void fib_leaf_notify(struct net *net, struct key_vector *l,
if (tb->tb_id != fa->tb_id) if (tb->tb_id != fa->tb_id)
continue; continue;
call_fib_entry_notifier(nb, net, event_type, l->key, call_fib_entry_notifier(nb, net, FIB_EVENT_ENTRY_ADD, l->key,
KEYLENGTH - fa->fa_slen, fi, fa->fa_tos, KEYLENGTH - fa->fa_slen, fi, fa->fa_tos,
fa->fa_type, fa->tb_id); fa->fa_type, fa->tb_id);
} }
} }
static void fib_table_notify(struct net *net, struct fib_table *tb, static void fib_table_notify(struct net *net, struct fib_table *tb,
struct notifier_block *nb, struct notifier_block *nb)
enum fib_event_type event_type)
{ {
struct trie *t = (struct trie *)tb->tb_data; struct trie *t = (struct trie *)tb->tb_data;
struct key_vector *l, *tp = t->kv; struct key_vector *l, *tp = t->kv;
t_key key = 0; t_key key = 0;
while ((l = leaf_walk_rcu(&tp, key)) != NULL) { while ((l = leaf_walk_rcu(&tp, key)) != NULL) {
fib_leaf_notify(net, l, tb, nb, event_type); fib_leaf_notify(net, l, tb, nb);
key = l->key + 1; key = l->key + 1;
/* stop in case of wrap around */ /* stop in case of wrap around */
...@@ -1943,8 +1941,7 @@ static void fib_table_notify(struct net *net, struct fib_table *tb, ...@@ -1943,8 +1941,7 @@ static void fib_table_notify(struct net *net, struct fib_table *tb,
} }
} }
void fib_notify(struct net *net, struct notifier_block *nb, void fib_notify(struct net *net, struct notifier_block *nb)
enum fib_event_type event_type)
{ {
unsigned int h; unsigned int h;
...@@ -1953,7 +1950,7 @@ void fib_notify(struct net *net, struct notifier_block *nb, ...@@ -1953,7 +1950,7 @@ void fib_notify(struct net *net, struct notifier_block *nb,
struct fib_table *tb; struct fib_table *tb;
hlist_for_each_entry_rcu(tb, head, tb_hlist) hlist_for_each_entry_rcu(tb, head, tb_hlist)
fib_table_notify(net, tb, nb, event_type); fib_table_notify(net, tb, nb);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment