Commit 37b68e6ded49c0b7e7434a4ecd17c5553e576b4d
Committed by
Simon Horman
1 parent
fd124e2f8b
ipvs: Store ipvs not net in struct ip_vs_sync_thread_data
In practice struct netns_ipvs is as meaningful as struct net and more useful as it holds the ipvs specific data. So store a pointer to struct netns_ipvs. Update the accesses of tinfo->net to access tinfo->ipvs->net instead. 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>
Showing 1 changed file with 5 additions and 5 deletions Side-by-side Diff
net/netfilter/ipvs/ip_vs_sync.c
... | ... | @@ -193,7 +193,7 @@ |
193 | 193 | #define IPVS_OPT_F_PARAM (1 << (IPVS_OPT_PARAM-1)) |
194 | 194 | |
195 | 195 | struct ip_vs_sync_thread_data { |
196 | - struct net *net; | |
196 | + struct netns_ipvs *ipvs; | |
197 | 197 | struct socket *sock; |
198 | 198 | char *buf; |
199 | 199 | int id; |
... | ... | @@ -1685,7 +1685,7 @@ |
1685 | 1685 | static int sync_thread_master(void *data) |
1686 | 1686 | { |
1687 | 1687 | struct ip_vs_sync_thread_data *tinfo = data; |
1688 | - struct netns_ipvs *ipvs = net_ipvs(tinfo->net); | |
1688 | + struct netns_ipvs *ipvs = tinfo->ipvs; | |
1689 | 1689 | struct ipvs_master_sync_state *ms = &ipvs->ms[tinfo->id]; |
1690 | 1690 | struct sock *sk = tinfo->sock->sk; |
1691 | 1691 | struct ip_vs_sync_buff *sb; |
... | ... | @@ -1741,7 +1741,7 @@ |
1741 | 1741 | static int sync_thread_backup(void *data) |
1742 | 1742 | { |
1743 | 1743 | struct ip_vs_sync_thread_data *tinfo = data; |
1744 | - struct netns_ipvs *ipvs = net_ipvs(tinfo->net); | |
1744 | + struct netns_ipvs *ipvs = tinfo->ipvs; | |
1745 | 1745 | int len; |
1746 | 1746 | |
1747 | 1747 | pr_info("sync thread started: state = BACKUP, mcast_ifn = %s, " |
... | ... | @@ -1763,7 +1763,7 @@ |
1763 | 1763 | break; |
1764 | 1764 | } |
1765 | 1765 | |
1766 | - ip_vs_process_message(tinfo->net, tinfo->buf, len); | |
1766 | + ip_vs_process_message(ipvs->net, tinfo->buf, len); | |
1767 | 1767 | } |
1768 | 1768 | } |
1769 | 1769 | |
... | ... | @@ -1880,7 +1880,7 @@ |
1880 | 1880 | tinfo = kmalloc(sizeof(*tinfo), GFP_KERNEL); |
1881 | 1881 | if (!tinfo) |
1882 | 1882 | goto outsocket; |
1883 | - tinfo->net = ipvs->net; | |
1883 | + tinfo->ipvs = ipvs; | |
1884 | 1884 | tinfo->sock = sock; |
1885 | 1885 | if (state == IP_VS_STATE_BACKUP) { |
1886 | 1886 | tinfo->buf = kmalloc(ipvs->bcfg.sync_maxlen, |