Skip to contentSkip to conversation

IPVS: ip_vs_sync.c: local functions should not be exposed globally

PATCH In review H Hartley Sweeten 3 participants 3 messages Apr 26, 2012 – Apr 27, 2012

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

PATCH 1/1 IPVS: ip_vs_sync.c: local functions should not be exposed globally

Functions not referenced outside of a source file should be marked static to prevent it from being exposed globally.

This quiets the sparse warnings:

warning: symbol 'ip_vs_sync_conn_v0' was not declared. Should it be static?

---

net/netfilter/ipvs/ip_vs_sync.c +1 -1
index bf5e538..49a1fe8 100644
@@ -446,7 +446,7 @@ ip_vs_sync_buff_create_v0(struct netns_ipvs *ipvs)
  *      Version 0 , could be switched in by sys_ctl.
  *      Add an ip_vs_conn information into the current sync_buff.
  */
-void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp)
+static void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp)
 {
 	struct netns_ipvs *ipvs = net_ipvs(net);
 	struct ip_vs_sync_mesg_v0 *m;
maintainer
#1 lore raw

Hello,

Quoted 17 lines · H Hartley Sweeten

Functions not referenced outside of a source file should be marked static to prevent it from being exposed globally.

This quiets the sparse warnings:

warning: symbol 'ip_vs_sync_conn_v0' was not declared. Should it be static?

---

net/netfilter/ipvs/ip_vs_sync.c +0 -0
index bf5e538..49a1fe8 100644

net/netfilter/ipvs/ip_vs_sync.c ip_vs_sync_buff_create_v0(struct netns_ipvs *ipvs) · line 449

Quoted 5 lines
net/netfilter/ipvs/ip_vs_sync.c +1 -1
@@ -446,7 +446,7 @@ ip_vs_sync_buff_create_v0(struct netns_ipvs *ipvs)
  *      Version 0 , could be switched in by sys_ctl.
  *      Add an ip_vs_conn information into the current sync_buff.
  */
-void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp)
+static void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp)

The 3 patches for IPVS look correct but this change
is already not needed after one of our planned changes:

"ipvs: reduce sync rate with time thresholds"

Not sure how we will avoid the collision, may be
Simon will take only the other 2 changes? Or David will take all changes and we have to rebase?

net/netfilter/ipvs/ip_vs_sync.c ip_vs_sync_buff_create_v0(struct netns_ipvs *ipvs)

Quoted 4 lines
net/netfilter/ipvs/ip_vs_sync.c +0 -1
 {
 	struct netns_ipvs *ipvs = net_ipvs(net);
 	struct ip_vs_sync_mesg_v0 *m;
--

Regards

--
Julian Anastasov <[email protected]>

maintainer
#2 lore raw
Quoted 31 lines · Julian Anastasov

Hello,

Quoted 17 lines · H Hartley Sweeten

Functions not referenced outside of a source file should be marked static to prevent it from being exposed globally.

This quiets the sparse warnings:

warning: symbol 'ip_vs_sync_conn_v0' was not declared. Should it be static?

---

net/netfilter/ipvs/ip_vs_sync.c +0 -0
index bf5e538..49a1fe8 100644

net/netfilter/ipvs/ip_vs_sync.c ip_vs_sync_buff_create_v0(struct netns_ipvs *ipvs) · line 449

Quoted 5 lines
net/netfilter/ipvs/ip_vs_sync.c +1 -1
@@ -446,7 +446,7 @@ ip_vs_sync_buff_create_v0(struct netns_ipvs *ipvs)
  *      Version 0 , could be switched in by sys_ctl.
  *      Add an ip_vs_conn information into the current sync_buff.
  */
-void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp)
+static void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp)

The 3 patches for IPVS look correct but this change
is already not needed after one of our planned changes:

Quoted 5 lines

"ipvs: reduce sync rate with time thresholds"

Not sure how we will avoid the collision, may be
Simon will take only the other 2 changes? Or David will take all changes and we have to rebase?

I think the best way forwards is for me to take only the first two changes.

I don't think that this fix is 3.4 material and as you say we expect this problem to be resolved by other means in 3.5.

I am of course open to discussion on this.