ipvs: Pass ipvs not net to stop_sync_thread
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 21 Sep 2015 18:02:11 +0000 (13:02 -0500)
committerSimon Horman <horms@verge.net.au>
Thu, 24 Sep 2015 00:34:37 +0000 (09:34 +0900)
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
include/net/ip_vs.h
net/netfilter/ipvs/ip_vs_ctl.c
net/netfilter/ipvs/ip_vs_sync.c

index dd7cd3a48fd44fb2de4fe2c444b0e9ca6642edf7..71f4d338c208b76bd956b4fd9fb90e8d6d226da8 100644 (file)
@@ -1451,7 +1451,7 @@ static inline void ip_vs_dest_put_and_free(struct ip_vs_dest *dest)
  */
 int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *cfg,
                      int state);
-int stop_sync_thread(struct net *net, int state);
+int stop_sync_thread(struct netns_ipvs *ipvs, int state);
 void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp, int pkts);
 
 /* IPVS rate estimator prototypes (from ip_vs_est.c) */
index b63b4c186040dd62cdd9ee22079ff1a54ee468bb..dba75ec2ed532909d89990e3b34c8051c6bcdbab 100644 (file)
@@ -2355,7 +2355,7 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
                        rtnl_unlock();
                } else {
                        mutex_lock(&ipvs->sync_mutex);
-                       ret = stop_sync_thread(net, dm->state);
+                       ret = stop_sync_thread(ipvs, dm->state);
                        mutex_unlock(&ipvs->sync_mutex);
                }
                goto out_dec;
@@ -3447,7 +3447,7 @@ static int ip_vs_genl_del_daemon(struct netns_ipvs *ipvs, struct nlattr **attrs)
                return -EINVAL;
 
        mutex_lock(&ipvs->sync_mutex);
-       ret = stop_sync_thread(ipvs->net,
+       ret = stop_sync_thread(ipvs,
                               nla_get_u32(attrs[IPVS_DAEMON_ATTR_STATE]));
        mutex_unlock(&ipvs->sync_mutex);
        return ret;
index 90c455c0b42b62eb78fa48b83e443063ef778877..0b2e01aa764ad0b380d839995920be4f7c239342 100644 (file)
@@ -1946,9 +1946,8 @@ out:
 }
 
 
-int stop_sync_thread(struct net *net, int state)
+int stop_sync_thread(struct netns_ipvs *ipvs, int state)
 {
-       struct netns_ipvs *ipvs = net_ipvs(net);
        struct task_struct **array;
        int id;
        int retc = -EINVAL;
@@ -2030,11 +2029,11 @@ void ip_vs_sync_net_cleanup(struct net *net)
        struct netns_ipvs *ipvs = net_ipvs(net);
 
        mutex_lock(&ipvs->sync_mutex);
-       retc = stop_sync_thread(net, IP_VS_STATE_MASTER);
+       retc = stop_sync_thread(ipvs, IP_VS_STATE_MASTER);
        if (retc && retc != -ESRCH)
                pr_err("Failed to stop Master Daemon\n");
 
-       retc = stop_sync_thread(net, IP_VS_STATE_BACKUP);
+       retc = stop_sync_thread(ipvs, IP_VS_STATE_BACKUP);
        if (retc && retc != -ESRCH)
                pr_err("Failed to stop Backup Daemon\n");
        mutex_unlock(&ipvs->sync_mutex);