diff options
author | Eric Biggers <ebiggers@google.com> | 2017-10-10 00:30:52 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-10 06:26:23 +0300 |
commit | cf4c950b87ee2f547ad3abd3aca6ae3f3eb3443f (patch) | |
tree | ec62d0b29fcd7361e4abb8cdc95042597571cf2c /lib/once.c | |
parent | d93fa2ba64384a0bbee4ae7409d85fccb2cfcf14 (diff) | |
download | linux-cf4c950b87ee2f547ad3abd3aca6ae3f3eb3443f.tar.xz |
once: switch to new jump label API
Switch the DO_ONCE() macro from the deprecated jump label API to the new
one. The new one is more readable, and for DO_ONCE() it also makes the
generated code more icache-friendly: now the one-time initialization
code is placed out-of-line at the jump target, rather than at the inline
fallthrough case.
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/once.c')
-rw-r--r-- | lib/once.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/once.c b/lib/once.c index 05c8604627eb..831c5a6b0bb2 100644 --- a/lib/once.c +++ b/lib/once.c @@ -5,7 +5,7 @@ struct once_work { struct work_struct work; - struct static_key *key; + struct static_key_true *key; }; static void once_deferred(struct work_struct *w) @@ -14,11 +14,11 @@ static void once_deferred(struct work_struct *w) work = container_of(w, struct once_work, work); BUG_ON(!static_key_enabled(work->key)); - static_key_slow_dec(work->key); + static_branch_disable(work->key); kfree(work); } -static void once_disable_jump(struct static_key *key) +static void once_disable_jump(struct static_key_true *key) { struct once_work *w; @@ -51,7 +51,7 @@ bool __do_once_start(bool *done, unsigned long *flags) } EXPORT_SYMBOL(__do_once_start); -void __do_once_done(bool *done, struct static_key *once_key, +void __do_once_done(bool *done, struct static_key_true *once_key, unsigned long *flags) __releases(once_lock) { |