aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_api.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-25 13:26:21 -0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-25 15:39:55 -0400
commit3b1e0a655f8eba44ab1ee2a1068d169ccfb853b9 (patch)
tree09edb35f32ebcfb1b4dad904425128a110ef16ee /net/sched/sch_api.c
parentc346dca10840a874240c78efe3f39acf4312a1f2 (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/sched/sch_api.c')
-rw-r--r--net/sched/sch_api.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 7e3c048ba9b1..15b91a9ee8e8 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -605,7 +605,7 @@ check_loop_fn(struct Qdisc *q, unsigned long cl, struct qdisc_walker *w)
605 605
606static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg) 606static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
607{ 607{
608 struct net *net = skb->sk->sk_net; 608 struct net *net = sock_net(skb->sk);
609 struct tcmsg *tcm = NLMSG_DATA(n); 609 struct tcmsg *tcm = NLMSG_DATA(n);
610 struct nlattr *tca[TCA_MAX + 1]; 610 struct nlattr *tca[TCA_MAX + 1];
611 struct net_device *dev; 611 struct net_device *dev;
@@ -674,7 +674,7 @@ static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
674 674
675static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg) 675static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
676{ 676{
677 struct net *net = skb->sk->sk_net; 677 struct net *net = sock_net(skb->sk);
678 struct tcmsg *tcm; 678 struct tcmsg *tcm;
679 struct nlattr *tca[TCA_MAX + 1]; 679 struct nlattr *tca[TCA_MAX + 1];
680 struct net_device *dev; 680 struct net_device *dev;
@@ -893,7 +893,7 @@ err_out:
893 893
894static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb) 894static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb)
895{ 895{
896 struct net *net = skb->sk->sk_net; 896 struct net *net = sock_net(skb->sk);
897 int idx, q_idx; 897 int idx, q_idx;
898 int s_idx, s_q_idx; 898 int s_idx, s_q_idx;
899 struct net_device *dev; 899 struct net_device *dev;
@@ -945,7 +945,7 @@ done:
945 945
946static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, void *arg) 946static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
947{ 947{
948 struct net *net = skb->sk->sk_net; 948 struct net *net = sock_net(skb->sk);
949 struct tcmsg *tcm = NLMSG_DATA(n); 949 struct tcmsg *tcm = NLMSG_DATA(n);
950 struct nlattr *tca[TCA_MAX + 1]; 950 struct nlattr *tca[TCA_MAX + 1];
951 struct net_device *dev; 951 struct net_device *dev;
@@ -1139,7 +1139,7 @@ static int qdisc_class_dump(struct Qdisc *q, unsigned long cl, struct qdisc_walk
1139 1139
1140static int tc_dump_tclass(struct sk_buff *skb, struct netlink_callback *cb) 1140static int tc_dump_tclass(struct sk_buff *skb, struct netlink_callback *cb)
1141{ 1141{
1142 struct net *net = skb->sk->sk_net; 1142 struct net *net = sock_net(skb->sk);
1143 int t; 1143 int t;
1144 int s_t; 1144 int s_t;
1145 struct net_device *dev; 1145 struct net_device *dev;