File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -58,20 +58,10 @@ int ___ratelimit(struct ratelimit_state *rs, const char *func)
58
58
* the current lock owner is just about to reset it.
59
59
*/
60
60
if (!raw_spin_trylock_irqsave (& rs -> lock , flags )) {
61
- unsigned int rs_flags = READ_ONCE (rs -> flags );
62
-
63
- if (rs_flags & RATELIMIT_INITIALIZED && burst ) {
64
- int n_left = atomic_read (& rs -> rs_n_left );
65
-
66
- if (n_left <= 0 )
67
- return 0 ;
68
- n_left = atomic_dec_return (& rs -> rs_n_left );
69
- if (n_left >= 0 )
70
- return 1 ;
71
- }
72
-
73
- ratelimit_state_inc_miss (rs );
74
- return 0 ;
61
+ if (READ_ONCE (rs -> flags ) & RATELIMIT_INITIALIZED && burst &&
62
+ atomic_read (& rs -> rs_n_left ) > 0 && atomic_dec_return (& rs -> rs_n_left ) >= 0 )
63
+ ret = 1 ;
64
+ goto nolock_ret ;
75
65
}
76
66
77
67
if (!(rs -> flags & RATELIMIT_INITIALIZED )) {
You can’t perform that action at this time.
0 commit comments