summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-05-10 15:13:35 -0400
committerDavid S. Miller <davem@davemloft.net>2018-05-10 15:13:35 -0400
commit508c461c63ce1c070a93520492232616ff8166d1 (patch)
tree79220b7c16db91c81ccc73f4971bde0ca8a462e1 /include
parent5bafeb6e7e878ce41c834806239f8c629a59d40a (diff)
parent88ab31081b8c8d4d7698711b80fbfd3f52d27fd9 (diff)
downloadcachepc-linux-508c461c63ce1c070a93520492232616ff8166d1.tar.gz
cachepc-linux-508c461c63ce1c070a93520492232616ff8166d1.zip
Merge branch 'net-Update-static-keys-to-modern-api'
Davidlohr Bueso says: ==================== net: Update static keys to modern api The following patches update pretty much all core net static key users to the modern api. Changes are mostly trivial conversion without affecting any semantics. The motivation is a resend of patches 1 and 2 from a while[1] back, and the rest are added patches, specific for -net. Applies against today's linux-next. Compile tested only. [1] lkml.kernel.org/r/20180326210929.5244-1-dave@stgolabs.net ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/ip_tunnels.h4
-rw-r--r--include/net/sock.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index 751646adc769..90ff430f5e9d 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -477,12 +477,12 @@ static inline struct ip_tunnel_info *lwt_tun_info(struct lwtunnel_state *lwtstat
return (struct ip_tunnel_info *)lwtstate->data;
}
-extern struct static_key ip_tunnel_metadata_cnt;
+DECLARE_STATIC_KEY_FALSE(ip_tunnel_metadata_cnt);
/* Returns > 0 if metadata should be collected */
static inline int ip_tunnel_collect_metadata(void)
{
- return static_key_false(&ip_tunnel_metadata_cnt);
+ return static_branch_unlikely(&ip_tunnel_metadata_cnt);
}
void __init ip_tunnel_core_init(void);
diff --git a/include/net/sock.h b/include/net/sock.h
index 3c568b36ee36..4f7c584e9765 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -808,10 +808,10 @@ static inline bool sock_flag(const struct sock *sk, enum sock_flags flag)
}
#ifdef CONFIG_NET
-extern struct static_key memalloc_socks;
+DECLARE_STATIC_KEY_FALSE(memalloc_socks_key);
static inline int sk_memalloc_socks(void)
{
- return static_key_false(&memalloc_socks);
+ return static_branch_unlikely(&memalloc_socks_key);
}
#else