diff options
author | Patrick McHardy <kaber@trash.net> | 2010-04-26 10:02:04 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-04-26 10:02:04 -0400 |
commit | 3d0c9c4eb2dbdcc461be4084abd87a9a9e70f713 (patch) | |
tree | 3a71a67a1f40afd7afbe0389259eb27d23fbfa36 | |
parent | 8c52d509e84bbf26cffb8b6e75b399689af67885 (diff) |
net: fib_rules: mark arguments to fib_rules_register const and __net_initdata
fib_rules_register() duplicates the template passed to it without modification,
mark the argument as const. Additionally the templates are only needed when
instantiating a new namespace, so mark them as __net_initdata, which means
they can be discarded when CONFIG_NET_NS=n.
Signed-off-by: Patrick McHardy <kaber@trash.net>
-rw-r--r-- | include/net/fib_rules.h | 2 | ||||
-rw-r--r-- | net/core/fib_rules.c | 2 | ||||
-rw-r--r-- | net/decnet/dn_rules.c | 2 | ||||
-rw-r--r-- | net/ipv4/fib_rules.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipmr.c | 2 | ||||
-rw-r--r-- | net/ipv6/fib6_rules.c | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index 52bd9e6c9141..e8923bc20f9f 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h | |||
@@ -104,7 +104,7 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla) | |||
104 | return frh->table; | 104 | return frh->table; |
105 | } | 105 | } |
106 | 106 | ||
107 | extern struct fib_rules_ops *fib_rules_register(struct fib_rules_ops *, struct net *); | 107 | extern struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *, struct net *); |
108 | extern void fib_rules_unregister(struct fib_rules_ops *); | 108 | extern void fib_rules_unregister(struct fib_rules_ops *); |
109 | extern void fib_rules_cleanup_ops(struct fib_rules_ops *); | 109 | extern void fib_rules_cleanup_ops(struct fib_rules_ops *); |
110 | 110 | ||
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 1bc66592453c..42e84e08a1be 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c | |||
@@ -122,7 +122,7 @@ errout: | |||
122 | } | 122 | } |
123 | 123 | ||
124 | struct fib_rules_ops * | 124 | struct fib_rules_ops * |
125 | fib_rules_register(struct fib_rules_ops *tmpl, struct net *net) | 125 | fib_rules_register(const struct fib_rules_ops *tmpl, struct net *net) |
126 | { | 126 | { |
127 | struct fib_rules_ops *ops; | 127 | struct fib_rules_ops *ops; |
128 | int err; | 128 | int err; |
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c index af28dcc21844..1226bcad776b 100644 --- a/net/decnet/dn_rules.c +++ b/net/decnet/dn_rules.c | |||
@@ -216,7 +216,7 @@ static void dn_fib_rule_flush_cache(struct fib_rules_ops *ops) | |||
216 | dn_rt_cache_flush(-1); | 216 | dn_rt_cache_flush(-1); |
217 | } | 217 | } |
218 | 218 | ||
219 | static struct fib_rules_ops dn_fib_rules_ops_template = { | 219 | static const struct fib_rules_ops __net_initdata dn_fib_rules_ops_template = { |
220 | .family = FIB_RULES_DECNET, | 220 | .family = FIB_RULES_DECNET, |
221 | .rule_size = sizeof(struct dn_fib_rule), | 221 | .rule_size = sizeof(struct dn_fib_rule), |
222 | .addr_size = sizeof(u16), | 222 | .addr_size = sizeof(u16), |
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c index 3ec84fea5b71..8ab62a56701c 100644 --- a/net/ipv4/fib_rules.c +++ b/net/ipv4/fib_rules.c | |||
@@ -245,7 +245,7 @@ static void fib4_rule_flush_cache(struct fib_rules_ops *ops) | |||
245 | rt_cache_flush(ops->fro_net, -1); | 245 | rt_cache_flush(ops->fro_net, -1); |
246 | } | 246 | } |
247 | 247 | ||
248 | static struct fib_rules_ops fib4_rules_ops_template = { | 248 | static const struct fib_rules_ops __net_initdata fib4_rules_ops_template = { |
249 | .family = FIB_RULES_IPV4, | 249 | .family = FIB_RULES_IPV4, |
250 | .rule_size = sizeof(struct fib4_rule), | 250 | .rule_size = sizeof(struct fib4_rule), |
251 | .addr_size = sizeof(u32), | 251 | .addr_size = sizeof(u32), |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index a2df5012a1d0..7d3e382aed64 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -216,7 +216,7 @@ static int ipmr_rule_fill(struct fib_rule *rule, struct sk_buff *skb, | |||
216 | return 0; | 216 | return 0; |
217 | } | 217 | } |
218 | 218 | ||
219 | static struct fib_rules_ops ipmr_rules_ops_template = { | 219 | static const struct fib_rules_ops __net_initdata ipmr_rules_ops_template = { |
220 | .family = FIB_RULES_IPMR, | 220 | .family = FIB_RULES_IPMR, |
221 | .rule_size = sizeof(struct ipmr_rule), | 221 | .rule_size = sizeof(struct ipmr_rule), |
222 | .addr_size = sizeof(u32), | 222 | .addr_size = sizeof(u32), |
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c index 8124f16f2ac2..35f6949446f0 100644 --- a/net/ipv6/fib6_rules.c +++ b/net/ipv6/fib6_rules.c | |||
@@ -237,7 +237,7 @@ static size_t fib6_rule_nlmsg_payload(struct fib_rule *rule) | |||
237 | + nla_total_size(16); /* src */ | 237 | + nla_total_size(16); /* src */ |
238 | } | 238 | } |
239 | 239 | ||
240 | static struct fib_rules_ops fib6_rules_ops_template = { | 240 | static const struct fib_rules_ops __net_initdata fib6_rules_ops_template = { |
241 | .family = FIB_RULES_IPV6, | 241 | .family = FIB_RULES_IPV6, |
242 | .rule_size = sizeof(struct fib6_rule), | 242 | .rule_size = sizeof(struct fib6_rule), |
243 | .addr_size = sizeof(struct in6_addr), | 243 | .addr_size = sizeof(struct in6_addr), |