Commit 6ac121d7 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Simon Horman

ipvs: Pass ipvs not net to start_sync_thread

Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: default avatarJulian Anastasov <ja@ssi.bg>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
parent df04ffb7
...@@ -1449,7 +1449,7 @@ static inline void ip_vs_dest_put_and_free(struct ip_vs_dest *dest) ...@@ -1449,7 +1449,7 @@ static inline void ip_vs_dest_put_and_free(struct ip_vs_dest *dest)
/* IPVS sync daemon data and function prototypes /* IPVS sync daemon data and function prototypes
* (from ip_vs_sync.c) * (from ip_vs_sync.c)
*/ */
int start_sync_thread(struct net *net, struct ipvs_sync_daemon_cfg *cfg, int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *cfg,
int state); int state);
int stop_sync_thread(struct net *net, int state); int stop_sync_thread(struct net *net, int state);
void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp, int pkts); void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp, int pkts);
......
...@@ -2350,7 +2350,7 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len) ...@@ -2350,7 +2350,7 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
cfg.syncid = dm->syncid; cfg.syncid = dm->syncid;
rtnl_lock(); rtnl_lock();
mutex_lock(&ipvs->sync_mutex); mutex_lock(&ipvs->sync_mutex);
ret = start_sync_thread(net, &cfg, dm->state); ret = start_sync_thread(ipvs, &cfg, dm->state);
mutex_unlock(&ipvs->sync_mutex); mutex_unlock(&ipvs->sync_mutex);
rtnl_unlock(); rtnl_unlock();
} else { } else {
...@@ -3432,7 +3432,7 @@ static int ip_vs_genl_new_daemon(struct netns_ipvs *ipvs, struct nlattr **attrs) ...@@ -3432,7 +3432,7 @@ static int ip_vs_genl_new_daemon(struct netns_ipvs *ipvs, struct nlattr **attrs)
rtnl_lock(); rtnl_lock();
mutex_lock(&ipvs->sync_mutex); mutex_lock(&ipvs->sync_mutex);
ret = start_sync_thread(ipvs->net, &c, ret = start_sync_thread(ipvs, &c,
nla_get_u32(attrs[IPVS_DAEMON_ATTR_STATE])); nla_get_u32(attrs[IPVS_DAEMON_ATTR_STATE]));
mutex_unlock(&ipvs->sync_mutex); mutex_unlock(&ipvs->sync_mutex);
rtnl_unlock(); rtnl_unlock();
......
...@@ -1778,13 +1778,12 @@ static int sync_thread_backup(void *data) ...@@ -1778,13 +1778,12 @@ static int sync_thread_backup(void *data)
} }
int start_sync_thread(struct net *net, struct ipvs_sync_daemon_cfg *c, int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c,
int state) int state)
{ {
struct ip_vs_sync_thread_data *tinfo; struct ip_vs_sync_thread_data *tinfo;
struct task_struct **array = NULL, *task; struct task_struct **array = NULL, *task;
struct socket *sock; struct socket *sock;
struct netns_ipvs *ipvs = net_ipvs(net);
struct net_device *dev; struct net_device *dev;
char *name; char *name;
int (*threadfn)(void *data); int (*threadfn)(void *data);
...@@ -1811,7 +1810,7 @@ int start_sync_thread(struct net *net, struct ipvs_sync_daemon_cfg *c, ...@@ -1811,7 +1810,7 @@ int start_sync_thread(struct net *net, struct ipvs_sync_daemon_cfg *c,
if (!c->mcast_ttl) if (!c->mcast_ttl)
c->mcast_ttl = 1; c->mcast_ttl = 1;
dev = __dev_get_by_name(net, c->mcast_ifn); dev = __dev_get_by_name(ipvs->net, c->mcast_ifn);
if (!dev) { if (!dev) {
pr_err("Unknown mcast interface: %s\n", c->mcast_ifn); pr_err("Unknown mcast interface: %s\n", c->mcast_ifn);
return -ENODEV; return -ENODEV;
...@@ -1873,9 +1872,9 @@ int start_sync_thread(struct net *net, struct ipvs_sync_daemon_cfg *c, ...@@ -1873,9 +1872,9 @@ int start_sync_thread(struct net *net, struct ipvs_sync_daemon_cfg *c,
tinfo = NULL; tinfo = NULL;
for (id = 0; id < count; id++) { for (id = 0; id < count; id++) {
if (state == IP_VS_STATE_MASTER) if (state == IP_VS_STATE_MASTER)
sock = make_send_sock(net, id); sock = make_send_sock(ipvs->net, id);
else else
sock = make_receive_sock(net, id); sock = make_receive_sock(ipvs->net, id);
if (IS_ERR(sock)) { if (IS_ERR(sock)) {
result = PTR_ERR(sock); result = PTR_ERR(sock);
goto outtinfo; goto outtinfo;
...@@ -1883,7 +1882,7 @@ int start_sync_thread(struct net *net, struct ipvs_sync_daemon_cfg *c, ...@@ -1883,7 +1882,7 @@ int start_sync_thread(struct net *net, struct ipvs_sync_daemon_cfg *c,
tinfo = kmalloc(sizeof(*tinfo), GFP_KERNEL); tinfo = kmalloc(sizeof(*tinfo), GFP_KERNEL);
if (!tinfo) if (!tinfo)
goto outsocket; goto outsocket;
tinfo->net = net; tinfo->net = ipvs->net;
tinfo->sock = sock; tinfo->sock = sock;
if (state == IP_VS_STATE_BACKUP) { if (state == IP_VS_STATE_BACKUP) {
tinfo->buf = kmalloc(ipvs->bcfg.sync_maxlen, tinfo->buf = kmalloc(ipvs->bcfg.sync_maxlen,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment