diff options
author | Jiri Pirko <jiri@mellanox.com> | 2019-10-03 11:49:27 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-10-04 20:10:55 +0200 |
commit | 7c550daffe22a97282effa75fe7c1f6b83563ecb (patch) | |
tree | 1ae072e80d39ed7d698622e471e077891efa4e90 /include/net/fib_notifier.h | |
parent | netdevsim: change fib accounting and limitations to be per-device (diff) | |
download | linux-7c550daffe22a97282effa75fe7c1f6b83563ecb.tar.xz linux-7c550daffe22a97282effa75fe7c1f6b83563ecb.zip |
net: fib_notifier: make FIB notifier per-netns
Currently all users of FIB notifier only cares about events in init_net.
Later in this patchset, users get interested in other namespaces too.
However, for every registered block user is interested only about one
namespace. Make the FIB notifier registration per-netns and avoid
unnecessary calls of notifier block for other namespaces.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/fib_notifier.h')
-rw-r--r-- | include/net/fib_notifier.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/net/fib_notifier.h b/include/net/fib_notifier.h index c49d7bfb5c30..23353f67b2b0 100644 --- a/include/net/fib_notifier.h +++ b/include/net/fib_notifier.h @@ -8,7 +8,6 @@ struct module; struct fib_notifier_info { - struct net *net; int family; struct netlink_ext_ack *extack; }; @@ -35,14 +34,14 @@ struct fib_notifier_ops { struct rcu_head rcu; }; -int call_fib_notifier(struct notifier_block *nb, struct net *net, +int call_fib_notifier(struct notifier_block *nb, enum fib_event_type event_type, struct fib_notifier_info *info); int call_fib_notifiers(struct net *net, enum fib_event_type event_type, struct fib_notifier_info *info); -int register_fib_notifier(struct notifier_block *nb, +int register_fib_notifier(struct net *net, struct notifier_block *nb, void (*cb)(struct notifier_block *nb)); -int unregister_fib_notifier(struct notifier_block *nb); +int unregister_fib_notifier(struct net *net, struct notifier_block *nb); struct fib_notifier_ops * fib_notifier_ops_register(const struct fib_notifier_ops *tmpl, struct net *net); void fib_notifier_ops_unregister(struct fib_notifier_ops *ops); |