diff options
author | Hans Schillstrom <hans.schillstrom@ericsson.com> | 2011-01-03 08:44:55 -0500 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2011-01-12 20:30:28 -0500 |
commit | f131315fa272d337dfca7dad2f033ff5296dad65 (patch) | |
tree | 4abe0b8cd421229e27be614e23e3bbc800dff98b /include/net | |
parent | 29c2026fd4980c144d9c746dc1565060f08e5796 (diff) |
IPVS: netns awareness to ip_vs_sync
All global variables moved to struct ipvs,
most external changes fixed (i.e. init_net removed)
in sync_buf create + 4 replaced by sizeof(struct..)
Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/ip_vs.h | 14 | ||||
-rw-r--r-- | include/net/netns/ip_vs.h | 16 |
2 files changed, 21 insertions, 9 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index c08927bb1728..4265b5e00c94 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -958,7 +958,7 @@ extern struct ip_vs_stats ip_vs_stats; | |||
958 | extern const struct ctl_path net_vs_ctl_path[]; | 958 | extern const struct ctl_path net_vs_ctl_path[]; |
959 | extern int sysctl_ip_vs_sync_ver; | 959 | extern int sysctl_ip_vs_sync_ver; |
960 | 960 | ||
961 | extern void ip_vs_sync_switch_mode(int mode); | 961 | extern void ip_vs_sync_switch_mode(struct net *net, int mode); |
962 | extern struct ip_vs_service * | 962 | extern struct ip_vs_service * |
963 | ip_vs_service_get(struct net *net, int af, __u32 fwmark, __u16 protocol, | 963 | ip_vs_service_get(struct net *net, int af, __u32 fwmark, __u16 protocol, |
964 | const union nf_inet_addr *vaddr, __be16 vport); | 964 | const union nf_inet_addr *vaddr, __be16 vport); |
@@ -987,14 +987,10 @@ extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp); | |||
987 | * IPVS sync daemon data and function prototypes | 987 | * IPVS sync daemon data and function prototypes |
988 | * (from ip_vs_sync.c) | 988 | * (from ip_vs_sync.c) |
989 | */ | 989 | */ |
990 | extern volatile int ip_vs_sync_state; | 990 | extern int start_sync_thread(struct net *net, int state, char *mcast_ifn, |
991 | extern volatile int ip_vs_master_syncid; | 991 | __u8 syncid); |
992 | extern volatile int ip_vs_backup_syncid; | 992 | extern int stop_sync_thread(struct net *net, int state); |
993 | extern char ip_vs_master_mcast_ifn[IP_VS_IFNAME_MAXLEN]; | 993 | extern void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp); |
994 | extern char ip_vs_backup_mcast_ifn[IP_VS_IFNAME_MAXLEN]; | ||
995 | extern int start_sync_thread(int state, char *mcast_ifn, __u8 syncid); | ||
996 | extern int stop_sync_thread(int state); | ||
997 | extern void ip_vs_sync_conn(struct ip_vs_conn *cp); | ||
998 | extern int ip_vs_sync_init(void); | 994 | extern int ip_vs_sync_init(void); |
999 | extern void ip_vs_sync_cleanup(void); | 995 | extern void ip_vs_sync_cleanup(void); |
1000 | 996 | ||
diff --git a/include/net/netns/ip_vs.h b/include/net/netns/ip_vs.h index db0240198339..aba78f3c8341 100644 --- a/include/net/netns/ip_vs.h +++ b/include/net/netns/ip_vs.h | |||
@@ -74,6 +74,22 @@ struct netns_ipvs { | |||
74 | struct list_head est_list; /* estimator list */ | 74 | struct list_head est_list; /* estimator list */ |
75 | spinlock_t est_lock; | 75 | spinlock_t est_lock; |
76 | struct timer_list est_timer; /* Estimation timer */ | 76 | struct timer_list est_timer; /* Estimation timer */ |
77 | /* ip_vs_sync */ | ||
78 | struct list_head sync_queue; | ||
79 | spinlock_t sync_lock; | ||
80 | struct ip_vs_sync_buff *sync_buff; | ||
81 | spinlock_t sync_buff_lock; | ||
82 | struct sockaddr_in sync_mcast_addr; | ||
83 | struct task_struct *master_thread; | ||
84 | struct task_struct *backup_thread; | ||
85 | int send_mesg_maxlen; | ||
86 | int recv_mesg_maxlen; | ||
87 | volatile int sync_state; | ||
88 | volatile int master_syncid; | ||
89 | volatile int backup_syncid; | ||
90 | /* multicast interface name */ | ||
91 | char master_mcast_ifn[IP_VS_IFNAME_MAXLEN]; | ||
92 | char backup_mcast_ifn[IP_VS_IFNAME_MAXLEN]; | ||
77 | }; | 93 | }; |
78 | 94 | ||
79 | #endif /* IP_VS_H_ */ | 95 | #endif /* IP_VS_H_ */ |