Commit 5263a98f authored by Davidlohr Bueso's avatar Davidlohr Bueso Committed by David S. Miller

net/ipv4: Update ip_tunnel_metadata_cnt static key to modern api

No changes in refcount semantics -- key init is false; replace

static_key_slow_inc|dec   with   static_branch_inc|dec
static_key_false          with   static_branch_unlikely
Signed-off-by: default avatarDavidlohr Bueso <dbueso@suse.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5bafeb6e
...@@ -477,12 +477,12 @@ static inline struct ip_tunnel_info *lwt_tun_info(struct lwtunnel_state *lwtstat ...@@ -477,12 +477,12 @@ static inline struct ip_tunnel_info *lwt_tun_info(struct lwtunnel_state *lwtstat
return (struct ip_tunnel_info *)lwtstate->data; 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 */ /* Returns > 0 if metadata should be collected */
static inline int ip_tunnel_collect_metadata(void) 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); void __init ip_tunnel_core_init(void);
......
...@@ -423,17 +423,17 @@ void __init ip_tunnel_core_init(void) ...@@ -423,17 +423,17 @@ void __init ip_tunnel_core_init(void)
lwtunnel_encap_add_ops(&ip6_tun_lwt_ops, LWTUNNEL_ENCAP_IP6); lwtunnel_encap_add_ops(&ip6_tun_lwt_ops, LWTUNNEL_ENCAP_IP6);
} }
struct static_key ip_tunnel_metadata_cnt = STATIC_KEY_INIT_FALSE; DEFINE_STATIC_KEY_FALSE(ip_tunnel_metadata_cnt);
EXPORT_SYMBOL(ip_tunnel_metadata_cnt); EXPORT_SYMBOL(ip_tunnel_metadata_cnt);
void ip_tunnel_need_metadata(void) void ip_tunnel_need_metadata(void)
{ {
static_key_slow_inc(&ip_tunnel_metadata_cnt); static_branch_inc(&ip_tunnel_metadata_cnt);
} }
EXPORT_SYMBOL_GPL(ip_tunnel_need_metadata); EXPORT_SYMBOL_GPL(ip_tunnel_need_metadata);
void ip_tunnel_unneed_metadata(void) void ip_tunnel_unneed_metadata(void)
{ {
static_key_slow_dec(&ip_tunnel_metadata_cnt); static_branch_dec(&ip_tunnel_metadata_cnt);
} }
EXPORT_SYMBOL_GPL(ip_tunnel_unneed_metadata); EXPORT_SYMBOL_GPL(ip_tunnel_unneed_metadata);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment