From: "Denis V. Lunev" <den@openvz.org>
To: davem@davemloft.net
Cc: benjamin.thery@bull.net, dlezcano@fr.ibm.com, devel@openvz.org,
containers@lists.osdl.org, netdev@vger.kernel.org,
xemul@openvz.org
Subject: [PATCH net-2.6.25 1/19] [NETNS] Add netns parameter to fib_rules_(un)register.
Date: Wed, 19 Dec 2007 18:24:31 +0300 [thread overview]
Message-ID: <1198077889-10693-2-git-send-email-den@openvz.org> (raw)
In-Reply-To: <4769370F.5020303@openvz.org>
This provides a ground for further fib rules operations virtualization.
Currently pass the init_net into them.
Acked-by: Benjamin Thery <benjamin.thery@bull.net>
Signed-off-by: Denis V. Lunev <den@openvz.org>
---
include/net/fib_rules.h | 16 +++++++---------
net/core/fib_rules.c | 4 ++--
net/decnet/dn_rules.c | 4 ++--
net/ipv4/fib_rules.c | 2 +-
net/ipv6/fib6_rules.c | 4 ++--
5 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index 2364db1..af62345 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -101,14 +101,12 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla)
return frh->table;
}
-extern int fib_rules_register(struct fib_rules_ops *);
-extern int fib_rules_unregister(struct fib_rules_ops *);
-extern void fib_rules_cleanup_ops(struct fib_rules_ops *);
+extern int fib_rules_register(struct net *, struct fib_rules_ops *);
+extern int fib_rules_unregister(struct net *, struct fib_rules_ops *);
+extern void fib_rules_cleanup_ops(struct fib_rules_ops *);
-extern int fib_rules_lookup(struct fib_rules_ops *,
- struct flowi *, int flags,
- struct fib_lookup_arg *);
-extern int fib_default_rule_add(struct fib_rules_ops *,
- u32 pref, u32 table,
- u32 flags);
+extern int fib_rules_lookup(struct fib_rules_ops *, struct flowi *, int flags,
+ struct fib_lookup_arg *);
+extern int fib_default_rule_add(struct fib_rules_ops *, u32 pref, u32 table,
+ u32 flags);
#endif
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index fcbf41c..ada9c81 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -74,7 +74,7 @@ static void flush_route_cache(struct fib_rules_ops *ops)
ops->flush_cache();
}
-int fib_rules_register(struct fib_rules_ops *ops)
+int fib_rules_register(struct net *net, struct fib_rules_ops *ops)
{
int err = -EEXIST;
struct fib_rules_ops *o;
@@ -113,7 +113,7 @@ void fib_rules_cleanup_ops(struct fib_rules_ops *ops)
}
EXPORT_SYMBOL_GPL(fib_rules_cleanup_ops);
-int fib_rules_unregister(struct fib_rules_ops *ops)
+int fib_rules_unregister(struct net *net, struct fib_rules_ops *ops)
{
int err = 0;
struct fib_rules_ops *o;
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c
index ffebea0..0b5e2b9 100644
--- a/net/decnet/dn_rules.c
+++ b/net/decnet/dn_rules.c
@@ -255,12 +255,12 @@ void __init dn_fib_rules_init(void)
{
BUG_ON(fib_default_rule_add(&dn_fib_rules_ops, 0x7fff,
RT_TABLE_MAIN, 0));
- fib_rules_register(&dn_fib_rules_ops);
+ fib_rules_register(&init_net, &dn_fib_rules_ops);
}
void __exit dn_fib_rules_cleanup(void)
{
- fib_rules_unregister(&dn_fib_rules_ops);
+ fib_rules_unregister(&init_net, &dn_fib_rules_ops);
}
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index a0ada3a..eac3f71 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -314,5 +314,5 @@ static int __init fib_default_rules_init(void)
void __init fib4_rules_init(void)
{
BUG_ON(fib_default_rules_init());
- fib_rules_register(&fib4_rules_ops);
+ fib_rules_register(&init_net, &fib4_rules_ops);
}
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index 9ce2e0a..e4d7e5a 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -273,7 +273,7 @@ int __init fib6_rules_init(void)
if (ret)
goto out;
- ret = fib_rules_register(&fib6_rules_ops);
+ ret = fib_rules_register(&init_net, &fib6_rules_ops);
if (ret)
goto out_default_rules_init;
out:
@@ -286,5 +286,5 @@ out_default_rules_init:
void fib6_rules_cleanup(void)
{
- fib_rules_unregister(&fib6_rules_ops);
+ fib_rules_unregister(&init_net, &fib6_rules_ops);
}
--
1.5.3.rc5
next prev parent reply other threads:[~2007-12-19 15:23 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-19 15:21 [PATCH netns-2.6.25 0/19] routing virtualization Denis V. Lunev
2007-12-19 15:24 ` Denis V. Lunev [this message]
2007-12-20 23:46 ` [PATCH net-2.6.25 1/19] [NETNS] Add netns parameter to fib_rules_(un)register David Miller
2007-12-19 15:24 ` [PATCH net-2.6.25 2/19] [NETNS] Pass fib_rules_ops into default_pref method Denis V. Lunev
2007-12-19 15:24 ` [PATCH net-2.6.25 3/19] [NETNS] Namespacing in the generic fib rules code Denis V. Lunev
2007-12-19 15:24 ` [PATCH net-2.6.25 4/19] [NETNS] Add namespace to API for routing /proc entries creation Denis V. Lunev
2007-12-19 15:24 ` [PATCH net-2.6.25 5/19] [IPV4] Check fib4_rules_init failure Denis V. Lunev
2007-12-19 15:24 ` [PATCH net-2.6.25 6/19] [NETNS] Refactor fib initialization so it can handle multiple namespaces Denis V. Lunev
2007-12-19 15:24 ` [PATCH net-2.6.25 7/19] [IPV4] Unify access to the routing tables Denis V. Lunev
2007-12-19 15:24 ` [PATCH net-2.6.25 8/19] [NETNS] Add netns parameter to fib_get_table/fib_new_table Denis V. Lunev
2007-12-19 15:24 ` [PATCH net-2.6.25 9/19] [NETNS] Add netns parameter to inet_(dev_)add_type Denis V. Lunev
2007-12-19 15:24 ` [PATCH net-2.6.25 10/19] [NETNS] Add netns to nl_info structure Denis V. Lunev
2007-12-19 15:24 ` [PATCH net-2.6.25 11/19] [NETNS] Show routing information from correct namespace (fib_hash.c) Denis V. Lunev
2007-12-19 15:24 ` [PATCH net-2.6.25 12/19] [NETNS] Show routing information from correct namespace (fib_trie.c) Denis V. Lunev
2007-12-19 15:24 ` [PATCH net-2.6.25 13/19] [NETNS] Namespacing IPv4 fib rules Denis V. Lunev
2007-12-19 15:24 ` [PATCH net-2.6.25 14/19] [NETNS] Place fib tables into netns Denis V. Lunev
2007-12-19 15:24 ` [PATCH net-2.6.25 15/19] [NETNS] Provide correct namespace for fibnl netlink socket Denis V. Lunev
2007-12-19 15:24 ` [PATCH net-2.6.25 16/19] [NETNS] Correctly fill fib_config data Denis V. Lunev
2007-12-19 15:24 ` [PATCH net-2.6.25 17/19] [NETNS] Pass namespace through ip_rt_ioctl Denis V. Lunev
2007-12-19 15:24 ` [PATCH net-2.6.25 18/19] [NETNS] Replace init_net with the correct context in fib_frontend.c Denis V. Lunev
2007-12-19 15:24 ` [PATCH net-2.6.25 19/19] [NETNS] Enable routing configuration in non-initial namespace Denis V. Lunev
-- strict thread matches above, loose matches on Subject: below --
2008-01-09 18:03 [PATCH netns-2.6.25 0/19] routing virtualization v2 Denis V. Lunev
[not found] ` <47850C57.60907-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-01-09 18:04 ` [PATCH net-2.6.25 1/19] [NETNS] Add netns parameter to fib_rules_(un)register Denis V. Lunev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1198077889-10693-2-git-send-email-den@openvz.org \
--to=den@openvz.org \
--cc=benjamin.thery@bull.net \
--cc=containers@lists.osdl.org \
--cc=davem@davemloft.net \
--cc=devel@openvz.org \
--cc=dlezcano@fr.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=xemul@openvz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).