diff options
author | Simon Horman <horms@verge.net.au> | 2011-02-04 04:33:01 -0500 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2011-03-14 20:36:57 -0400 |
commit | 59e0350eada0516a810cb780db37746165f1d516 (patch) | |
tree | e97d575d951909aea0e47598c3c830850b79e033 /include/net/ip_vs.h | |
parent | 0cfa558e2c21644a0dd6c21cfadd8bbeaf9fe1a0 (diff) |
IPVS: Add {sysctl_sync_threshold,period}()
In preparation for not including sysctl_sync_threshold in
struct netns_ipvs when CONFIG_SYCTL is not defined.
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'include/net/ip_vs.h')
-rw-r--r-- | include/net/ip_vs.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 7ca5be247256..253736db476b 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -909,6 +909,35 @@ struct netns_ipvs { | |||
909 | struct net *net; /* Needed by timer routines */ | 909 | struct net *net; /* Needed by timer routines */ |
910 | }; | 910 | }; |
911 | 911 | ||
912 | #define DEFAULT_SYNC_THRESHOLD 3 | ||
913 | #define DEFAULT_SYNC_PERIOD 50 | ||
914 | |||
915 | #ifdef CONFIG_SYSCTL | ||
916 | |||
917 | static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) | ||
918 | { | ||
919 | return ipvs->sysctl_sync_threshold[0]; | ||
920 | } | ||
921 | |||
922 | static inline int sysctl_sync_period(struct netns_ipvs *ipvs) | ||
923 | { | ||
924 | return ipvs->sysctl_sync_threshold[1]; | ||
925 | } | ||
926 | |||
927 | #else | ||
928 | |||
929 | static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) | ||
930 | { | ||
931 | return DEFAULT_SYNC_THRESHOLD; | ||
932 | } | ||
933 | |||
934 | static inline int sysctl_sync_period(struct netns_ipvs *ipvs) | ||
935 | { | ||
936 | return DEFAULT_SYNC_PERIOD; | ||
937 | } | ||
938 | |||
939 | #endif | ||
940 | |||
912 | /* | 941 | /* |
913 | * IPVS core functions | 942 | * IPVS core functions |
914 | * (from ip_vs_core.c) | 943 | * (from ip_vs_core.c) |