diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 13:26:21 -0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 15:39:55 -0400 |
commit | 3b1e0a655f8eba44ab1ee2a1068d169ccfb853b9 (patch) | |
tree | 09edb35f32ebcfb1b4dad904425128a110ef16ee /net/core/rtnetlink.c | |
parent | c346dca10840a874240c78efe3f39acf4312a1f2 (diff) |
[NET] NETNS: Omit sock->sk_net without CONFIG_NET_NS.
Introduce per-sock inlines: sock_net(), sock_net_set()
and per-inet_timewait_sock inlines: twsk_net(), twsk_net_set().
Without CONFIG_NET_NS, no namespace other than &init_net exists.
Let's explicitly define them to help compiler optimizations.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/core/rtnetlink.c')
-rw-r--r-- | net/core/rtnetlink.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 09250a0800f6..da99ac0871bf 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -662,7 +662,7 @@ nla_put_failure: | |||
662 | 662 | ||
663 | static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) | 663 | static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) |
664 | { | 664 | { |
665 | struct net *net = skb->sk->sk_net; | 665 | struct net *net = sock_net(skb->sk); |
666 | int idx; | 666 | int idx; |
667 | int s_idx = cb->args[0]; | 667 | int s_idx = cb->args[0]; |
668 | struct net_device *dev; | 668 | struct net_device *dev; |
@@ -879,7 +879,7 @@ errout: | |||
879 | 879 | ||
880 | static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | 880 | static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) |
881 | { | 881 | { |
882 | struct net *net = skb->sk->sk_net; | 882 | struct net *net = sock_net(skb->sk); |
883 | struct ifinfomsg *ifm; | 883 | struct ifinfomsg *ifm; |
884 | struct net_device *dev; | 884 | struct net_device *dev; |
885 | int err; | 885 | int err; |
@@ -921,7 +921,7 @@ errout: | |||
921 | 921 | ||
922 | static int rtnl_dellink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | 922 | static int rtnl_dellink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) |
923 | { | 923 | { |
924 | struct net *net = skb->sk->sk_net; | 924 | struct net *net = sock_net(skb->sk); |
925 | const struct rtnl_link_ops *ops; | 925 | const struct rtnl_link_ops *ops; |
926 | struct net_device *dev; | 926 | struct net_device *dev; |
927 | struct ifinfomsg *ifm; | 927 | struct ifinfomsg *ifm; |
@@ -1000,7 +1000,7 @@ err: | |||
1000 | 1000 | ||
1001 | static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | 1001 | static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) |
1002 | { | 1002 | { |
1003 | struct net *net = skb->sk->sk_net; | 1003 | struct net *net = sock_net(skb->sk); |
1004 | const struct rtnl_link_ops *ops; | 1004 | const struct rtnl_link_ops *ops; |
1005 | struct net_device *dev; | 1005 | struct net_device *dev; |
1006 | struct ifinfomsg *ifm; | 1006 | struct ifinfomsg *ifm; |
@@ -1132,7 +1132,7 @@ replay: | |||
1132 | 1132 | ||
1133 | static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) | 1133 | static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) |
1134 | { | 1134 | { |
1135 | struct net *net = skb->sk->sk_net; | 1135 | struct net *net = sock_net(skb->sk); |
1136 | struct ifinfomsg *ifm; | 1136 | struct ifinfomsg *ifm; |
1137 | struct nlattr *tb[IFLA_MAX+1]; | 1137 | struct nlattr *tb[IFLA_MAX+1]; |
1138 | struct net_device *dev = NULL; | 1138 | struct net_device *dev = NULL; |
@@ -1227,7 +1227,7 @@ static int rtattr_max; | |||
1227 | 1227 | ||
1228 | static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | 1228 | static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) |
1229 | { | 1229 | { |
1230 | struct net *net = skb->sk->sk_net; | 1230 | struct net *net = sock_net(skb->sk); |
1231 | rtnl_doit_func doit; | 1231 | rtnl_doit_func doit; |
1232 | int sz_idx, kind; | 1232 | int sz_idx, kind; |
1233 | int min_len; | 1233 | int min_len; |