Skip to contentSkip to conversation

net/ipvs/: make some code static

PATCH Applied Adrian Bunk 3 participants 3 messages Dec 15, 2004 – Dec 28, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ipvs/: make some code static

The patch below makes some needlessly global code static.

diffstat output:

 net/ipv4/ipvs/ip_vs_app.c        |    2 +-
 net/ipv4/ipvs/ip_vs_conn.c       |    2 +-
 net/ipv4/ipvs/ip_vs_ctl.c        |    2 +-
 net/ipv4/ipvs/ip_vs_proto.c      |    4 ++--
 net/ipv4/ipvs/ip_vs_proto_icmp.c |    4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)
net/ipv4/ipvs/ip_vs_app.c renamed from net/ipv4/ipvs/ip_vs_app.c.old +1 -1
@@ -65,7 +65,7 @@
 /*
  *	Allocate/initialize app incarnation and register it in proto apps.
  */
-int
+static int
 ip_vs_app_inc_new(struct ip_vs_app *app, __u16 proto, __u16 port)
 {
 	struct ip_vs_protocol *pp;
net/ipv4/ipvs/ip_vs_conn.c renamed from net/ipv4/ipvs/ip_vs_conn.c.old +1 -1
@@ -64,7 +64,7 @@
 } __attribute__((__aligned__(SMP_CACHE_BYTES)));
 
 /* lock array for conn table */
-struct ip_vs_aligned_lock
+static struct ip_vs_aligned_lock
 __ip_vs_conntbl_lock_array[CT_LOCKARRAY_SIZE] __cacheline_aligned;
 
 static inline void ct_read_lock(unsigned key)
net/ipv4/ipvs/ip_vs_ctl.c renamed from net/ipv4/ipvs/ip_vs_ctl.c.old +1 -1
@@ -62,7 +62,7 @@
 /* 1/rate drop and drop-entry variables */
 int ip_vs_drop_rate = 0;
 int ip_vs_drop_counter = 0;
-atomic_t ip_vs_dropentry = ATOMIC_INIT(0);
+static atomic_t ip_vs_dropentry = ATOMIC_INIT(0);
 
 /* number of virtual services */
 static int ip_vs_num_services = 0;
net/ipv4/ipvs/ip_vs_proto.c renamed from net/ipv4/ipvs/ip_vs_proto.c.old +2 -2
@@ -45,7 +45,7 @@
 /*
  *	register an ipvs protocol
  */
-int register_ip_vs_protocol(struct ip_vs_protocol *pp)
+static int register_ip_vs_protocol(struct ip_vs_protocol *pp)
 {
 	unsigned hash = IP_VS_PROTO_HASH(pp->protocol);
 
@@ -62,7 +62,7 @@
 /*
  *	unregister an ipvs protocol
  */
-int unregister_ip_vs_protocol(struct ip_vs_protocol *pp)
+static int unregister_ip_vs_protocol(struct ip_vs_protocol *pp)
 {
 	struct ip_vs_protocol **pp_p;
 	unsigned hash = IP_VS_PROTO_HASH(pp->protocol);
net/ipv4/ipvs/ip_vs_proto_icmp.c renamed from net/ipv4/ipvs/ip_vs_proto_icmp.c.old +2 -2
@@ -22,7 +22,7 @@
 
 static char * icmp_state_name_table[1] = { "ICMP" };
 
-struct ip_vs_conn *
+static struct ip_vs_conn *
 icmp_conn_in_get(const struct sk_buff *skb,
 		 struct ip_vs_protocol *pp,
 		 const struct iphdr *iph,
@@ -49,7 +49,7 @@
 #endif
 }
 
-struct ip_vs_conn *
+static struct ip_vs_conn *
 icmp_conn_out_get(const struct sk_buff *skb,
 		  struct ip_vs_protocol *pp,
 		  const struct iphdr *iph,
#1 lore raw

Hi Dave,

Please apply Adrian's patch.

Thanks,

Wensong

Quoted 88 lines · Adrian Bunk

The patch below makes some needlessly global code static.

diffstat output:

net/ipv4/ipvs/ip_vs_app.c        |    2 +-
net/ipv4/ipvs/ip_vs_conn.c       |    2 +-
net/ipv4/ipvs/ip_vs_ctl.c        |    2 +-
net/ipv4/ipvs/ip_vs_proto.c      |    4 ++--
net/ipv4/ipvs/ip_vs_proto_icmp.c |    4 ++--
5 files changed, 7 insertions(+), 7 deletions(-)
net/ipv4/ipvs/ip_vs_app.c renamed from net/ipv4/ipvs/ip_vs_app.c.old +1 -1
@@ -65,7 +65,7 @@
 /*
 *	Allocate/initialize app incarnation and register it in proto apps.
 */
-int
+static int
 ip_vs_app_inc_new(struct ip_vs_app *app, __u16 proto, __u16 port)
 {
 	struct ip_vs_protocol *pp;
net/ipv4/ipvs/ip_vs_conn.c renamed from net/ipv4/ipvs/ip_vs_conn.c.old +1 -1
@@ -64,7 +64,7 @@
 } __attribute__((__aligned__(SMP_CACHE_BYTES)));
 
 /* lock array for conn table */
-struct ip_vs_aligned_lock
+static struct ip_vs_aligned_lock
 __ip_vs_conntbl_lock_array[CT_LOCKARRAY_SIZE] __cacheline_aligned;
 
 static inline void ct_read_lock(unsigned key)
net/ipv4/ipvs/ip_vs_ctl.c renamed from net/ipv4/ipvs/ip_vs_ctl.c.old +1 -1
@@ -62,7 +62,7 @@
 /* 1/rate drop and drop-entry variables */
 int ip_vs_drop_rate = 0;
 int ip_vs_drop_counter = 0;
-atomic_t ip_vs_dropentry = ATOMIC_INIT(0);
+static atomic_t ip_vs_dropentry = ATOMIC_INIT(0);
 
 /* number of virtual services */
 static int ip_vs_num_services = 0;
net/ipv4/ipvs/ip_vs_proto.c renamed from net/ipv4/ipvs/ip_vs_proto.c.old +2 -2
@@ -45,7 +45,7 @@
 /*
 *	register an ipvs protocol
 */
-int register_ip_vs_protocol(struct ip_vs_protocol *pp)
+static int register_ip_vs_protocol(struct ip_vs_protocol *pp)
 {
 	unsigned hash = IP_VS_PROTO_HASH(pp->protocol);
 
@@ -62,7 +62,7 @@
 /*
 *	unregister an ipvs protocol
 */
-int unregister_ip_vs_protocol(struct ip_vs_protocol *pp)
+static int unregister_ip_vs_protocol(struct ip_vs_protocol *pp)
 {
 	struct ip_vs_protocol **pp_p;
 	unsigned hash = IP_VS_PROTO_HASH(pp->protocol);
net/ipv4/ipvs/ip_vs_proto_icmp.c renamed from net/ipv4/ipvs/ip_vs_proto_icmp.c.old +2 -2
@@ -22,7 +22,7 @@
 
 static char * icmp_state_name_table[1] = { "ICMP" };
 
-struct ip_vs_conn *
+static struct ip_vs_conn *
 icmp_conn_in_get(const struct sk_buff *skb,
 		 struct ip_vs_protocol *pp,
 		 const struct iphdr *iph,
@@ -49,7 +49,7 @@
 #endif
 }
 
-struct ip_vs_conn *
+static struct ip_vs_conn *
 icmp_conn_out_get(const struct sk_buff *skb,
 		  struct ip_vs_protocol *pp,
 		  const struct iphdr *iph,