diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2009-12-03 15:22:55 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-03 15:22:55 -0500 |
commit | e9c5158ac26affd5d8ce006521bdfb7148090e18 (patch) | |
tree | a8d43fb446a1908175923f4109c977dcb84e4f91 /include/net/fib_rules.h | |
parent | 3a765edadb28cc736d185f67d1ba6bedcc85f4b9 (diff) |
net: Allow fib_rule_unregister to batch
Refactor the code so fib_rules_register always takes a template instead
of the actual fib_rules_ops structure that will be used. This is
required for network namespace support so 2 out of the 3 callers already
do this, it allows the error handling to be made common, and it allows
fib_rules_unregister to free the template for hte caller.
Modify fib_rules_unregister to use call_rcu instead of syncrhonize_rcu
to allw multiple namespaces to be cleaned up in the same rcu grace
period.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/fib_rules.h')
-rw-r--r-- | include/net/fib_rules.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index d4e875a58f8b..c07ac9650ebc 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h | |||
@@ -66,6 +66,7 @@ struct fib_rules_ops { | |||
66 | struct list_head rules_list; | 66 | struct list_head rules_list; |
67 | struct module *owner; | 67 | struct module *owner; |
68 | struct net *fro_net; | 68 | struct net *fro_net; |
69 | struct rcu_head rcu; | ||
69 | }; | 70 | }; |
70 | 71 | ||
71 | #define FRA_GENERIC_POLICY \ | 72 | #define FRA_GENERIC_POLICY \ |
@@ -102,7 +103,7 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla) | |||
102 | return frh->table; | 103 | return frh->table; |
103 | } | 104 | } |
104 | 105 | ||
105 | extern int fib_rules_register(struct fib_rules_ops *); | 106 | extern struct fib_rules_ops *fib_rules_register(struct fib_rules_ops *, struct net *); |
106 | extern void fib_rules_unregister(struct fib_rules_ops *); | 107 | extern void fib_rules_unregister(struct fib_rules_ops *); |
107 | extern void fib_rules_cleanup_ops(struct fib_rules_ops *); | 108 | extern void fib_rules_cleanup_ops(struct fib_rules_ops *); |
108 | 109 | ||