[PATCH next 24/84] ipvs: Pass ipvs not net to ip_vs_proto_data_get

2015-09-21 Thread Eric W. Biederman
Signed-off-by: "Eric W. Biederman" 
---
 include/net/ip_vs.h   |  2 +-
 net/netfilter/ipvs/ip_vs_conn.c   |  4 ++--
 net/netfilter/ipvs/ip_vs_core.c   |  8 
 net/netfilter/ipvs/ip_vs_ctl.c| 12 +++-
 net/netfilter/ipvs/ip_vs_proto.c  | 12 ++--
 net/netfilter/ipvs/ip_vs_proto_sctp.c |  4 ++--
 net/netfilter/ipvs/ip_vs_proto_tcp.c  |  6 +++---
 net/netfilter/ipvs/ip_vs_proto_udp.c  |  4 ++--
 net/netfilter/ipvs/ip_vs_sync.c   |  2 +-
 9 files changed, 24 insertions(+), 30 deletions(-)

diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 3c7040a313b5..3c077e8a038c 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -541,7 +541,7 @@ struct ip_vs_proto_data {
 };
 
 struct ip_vs_protocol   *ip_vs_proto_get(unsigned short proto);
-struct ip_vs_proto_data *ip_vs_proto_data_get(struct net *net,
+struct ip_vs_proto_data *ip_vs_proto_data_get(struct netns_ipvs *ipvs,
  unsigned short proto);
 
 struct ip_vs_conn_param {
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index ce788f8781f4..d0d57f14bc76 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -668,7 +668,7 @@ void ip_vs_try_bind_dest(struct ip_vs_conn *cp)
 #endif
ip_vs_bind_xmit(cp);
 
-   pd = ip_vs_proto_data_get(cp->ipvs->net, cp->protocol);
+   pd = ip_vs_proto_data_get(cp->ipvs, cp->protocol);
if (pd && atomic_read(&pd->appcnt))
ip_vs_bind_app(cp, pd->pp);
}
@@ -876,7 +876,7 @@ ip_vs_conn_new(const struct ip_vs_conn_param *p, int 
dest_af,
 {
struct ip_vs_conn *cp;
struct netns_ipvs *ipvs = p->ipvs;
-   struct ip_vs_proto_data *pd = ip_vs_proto_data_get(p->ipvs->net,
+   struct ip_vs_proto_data *pd = ip_vs_proto_data_get(p->ipvs,
   p->protocol);
 
cp = kmem_cache_alloc(ip_vs_conn_cachep, GFP_ATOMIC);
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 77dcd3ed27de..2e96500c6f3f 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1237,7 +1237,7 @@ ip_vs_out(unsigned int hooknum, struct sk_buff *skb, int 
af)
return verdict;
}
 
-   pd = ip_vs_proto_data_get(net, iph.protocol);
+   pd = ip_vs_proto_data_get(ipvs, iph.protocol);
if (unlikely(!pd))
return NF_ACCEPT;
pp = pd->pp;
@@ -1470,7 +1470,7 @@ ip_vs_in_icmp(struct sk_buff *skb, int *related, unsigned 
int hooknum)
ipip = true;
}
 
-   pd = ip_vs_proto_data_get(net, cih->protocol);
+   pd = ip_vs_proto_data_get(ipvs, cih->protocol);
if (!pd)
return NF_ACCEPT;
pp = pd->pp;
@@ -1633,7 +1633,7 @@ static int ip_vs_in_icmp_v6(struct sk_buff *skb, int 
*related,
 
net = skb_net(skb);
ipvs = net_ipvs(net);
-   pd = ip_vs_proto_data_get(net, ciph.protocol);
+   pd = ip_vs_proto_data_get(ipvs, ciph.protocol);
if (!pd)
return NF_ACCEPT;
pp = pd->pp;
@@ -1765,7 +1765,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int 
af)
}
 
/* Protocol supported? */
-   pd = ip_vs_proto_data_get(net, iph.protocol);
+   pd = ip_vs_proto_data_get(ipvs, iph.protocol);
if (unlikely(!pd)) {
/* The only way we'll see this packet again is if it's
 * encapsulated, so mark it with ipvs_property=1 so we
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 0b7749ae1e8d..eb3911c69037 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -2205,6 +2205,7 @@ static const struct file_operations 
ip_vs_stats_percpu_fops = {
 static int ip_vs_set_timeout(struct net *net, struct ip_vs_timeout_user *u)
 {
 #if defined(CONFIG_IP_VS_PROTO_TCP) || defined(CONFIG_IP_VS_PROTO_UDP)
+   struct netns_ipvs *ipvs = net_ipvs(net);
struct ip_vs_proto_data *pd;
 #endif
 
@@ -2215,13 +2216,13 @@ static int ip_vs_set_timeout(struct net *net, struct 
ip_vs_timeout_user *u)
 
 #ifdef CONFIG_IP_VS_PROTO_TCP
if (u->tcp_timeout) {
-   pd = ip_vs_proto_data_get(net, IPPROTO_TCP);
+   pd = ip_vs_proto_data_get(ipvs, IPPROTO_TCP);
pd->timeout_table[IP_VS_TCP_S_ESTABLISHED]
= u->tcp_timeout * HZ;
}
 
if (u->tcp_fin_timeout) {
-   pd = ip_vs_proto_data_get(net, IPPROTO_TCP);
+   pd = ip_vs_proto_data_get(ipvs, IPPROTO_TCP);
pd->timeout_table[IP_VS_TCP_S_FIN_WAIT]
= u->tcp_fin_timeout * HZ;
}
@@ -2229,7 +2230,7 @@ static int ip_vs_set_timeout(struct net *net, struct 
ip_vs_timeout_user *u)
 
 #ifdef CONFIG_IP_VS_PROTO_UDP
 

[PATCH next 24/84] ipvs: Pass ipvs not net to ip_vs_proto_data_get

2015-09-19 Thread Eric W. Biederman
Signed-off-by: "Eric W. Biederman" 
---
 include/net/ip_vs.h   |  2 +-
 net/netfilter/ipvs/ip_vs_conn.c   |  4 ++--
 net/netfilter/ipvs/ip_vs_core.c   |  8 
 net/netfilter/ipvs/ip_vs_ctl.c| 12 +++-
 net/netfilter/ipvs/ip_vs_proto.c  | 12 ++--
 net/netfilter/ipvs/ip_vs_proto_sctp.c |  4 ++--
 net/netfilter/ipvs/ip_vs_proto_tcp.c  |  6 +++---
 net/netfilter/ipvs/ip_vs_proto_udp.c  |  4 ++--
 net/netfilter/ipvs/ip_vs_sync.c   |  2 +-
 9 files changed, 24 insertions(+), 30 deletions(-)

diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 3c7040a313b5..3c077e8a038c 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -541,7 +541,7 @@ struct ip_vs_proto_data {
 };
 
 struct ip_vs_protocol   *ip_vs_proto_get(unsigned short proto);
-struct ip_vs_proto_data *ip_vs_proto_data_get(struct net *net,
+struct ip_vs_proto_data *ip_vs_proto_data_get(struct netns_ipvs *ipvs,
  unsigned short proto);
 
 struct ip_vs_conn_param {
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index fff4011ea47f..f54e9afdf4dd 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -668,7 +668,7 @@ void ip_vs_try_bind_dest(struct ip_vs_conn *cp)
 #endif
ip_vs_bind_xmit(cp);
 
-   pd = ip_vs_proto_data_get(cp->ipvs->net, cp->protocol);
+   pd = ip_vs_proto_data_get(cp->ipvs, cp->protocol);
if (pd && atomic_read(&pd->appcnt))
ip_vs_bind_app(cp, pd->pp);
}
@@ -876,7 +876,7 @@ ip_vs_conn_new(const struct ip_vs_conn_param *p, int 
dest_af,
 {
struct ip_vs_conn *cp;
struct netns_ipvs *ipvs = p->ipvs;
-   struct ip_vs_proto_data *pd = ip_vs_proto_data_get(p->ipvs->net,
+   struct ip_vs_proto_data *pd = ip_vs_proto_data_get(p->ipvs,
   p->protocol);
 
cp = kmem_cache_alloc(ip_vs_conn_cachep, GFP_ATOMIC);
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 77dcd3ed27de..2e96500c6f3f 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1237,7 +1237,7 @@ ip_vs_out(unsigned int hooknum, struct sk_buff *skb, int 
af)
return verdict;
}
 
-   pd = ip_vs_proto_data_get(net, iph.protocol);
+   pd = ip_vs_proto_data_get(ipvs, iph.protocol);
if (unlikely(!pd))
return NF_ACCEPT;
pp = pd->pp;
@@ -1470,7 +1470,7 @@ ip_vs_in_icmp(struct sk_buff *skb, int *related, unsigned 
int hooknum)
ipip = true;
}
 
-   pd = ip_vs_proto_data_get(net, cih->protocol);
+   pd = ip_vs_proto_data_get(ipvs, cih->protocol);
if (!pd)
return NF_ACCEPT;
pp = pd->pp;
@@ -1633,7 +1633,7 @@ static int ip_vs_in_icmp_v6(struct sk_buff *skb, int 
*related,
 
net = skb_net(skb);
ipvs = net_ipvs(net);
-   pd = ip_vs_proto_data_get(net, ciph.protocol);
+   pd = ip_vs_proto_data_get(ipvs, ciph.protocol);
if (!pd)
return NF_ACCEPT;
pp = pd->pp;
@@ -1765,7 +1765,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int 
af)
}
 
/* Protocol supported? */
-   pd = ip_vs_proto_data_get(net, iph.protocol);
+   pd = ip_vs_proto_data_get(ipvs, iph.protocol);
if (unlikely(!pd)) {
/* The only way we'll see this packet again is if it's
 * encapsulated, so mark it with ipvs_property=1 so we
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 591f528e4ed6..b9426a5fb667 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -2205,6 +2205,7 @@ static const struct file_operations 
ip_vs_stats_percpu_fops = {
 static int ip_vs_set_timeout(struct net *net, struct ip_vs_timeout_user *u)
 {
 #if defined(CONFIG_IP_VS_PROTO_TCP) || defined(CONFIG_IP_VS_PROTO_UDP)
+   struct netns_ipvs *ipvs = net_ipvs(net);
struct ip_vs_proto_data *pd;
 #endif
 
@@ -2215,13 +2216,13 @@ static int ip_vs_set_timeout(struct net *net, struct 
ip_vs_timeout_user *u)
 
 #ifdef CONFIG_IP_VS_PROTO_TCP
if (u->tcp_timeout) {
-   pd = ip_vs_proto_data_get(net, IPPROTO_TCP);
+   pd = ip_vs_proto_data_get(ipvs, IPPROTO_TCP);
pd->timeout_table[IP_VS_TCP_S_ESTABLISHED]
= u->tcp_timeout * HZ;
}
 
if (u->tcp_fin_timeout) {
-   pd = ip_vs_proto_data_get(net, IPPROTO_TCP);
+   pd = ip_vs_proto_data_get(ipvs, IPPROTO_TCP);
pd->timeout_table[IP_VS_TCP_S_FIN_WAIT]
= u->tcp_fin_timeout * HZ;
}
@@ -2229,7 +2230,7 @@ static int ip_vs_set_timeout(struct net *net, struct 
ip_vs_timeout_user *u)
 
 #ifdef CONFIG_IP_VS_PROTO_UDP