Skip to content

Commit

Permalink
netfilter: use likely() in xt_info_rdlock_bh()
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed May 1, 2009
1 parent ec581f6 commit 0f3d042
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/netfilter/x_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,15 +472,15 @@ static inline void xt_info_rdlock_bh(void)

local_bh_disable();
lock = &__get_cpu_var(xt_info_locks);
if (!lock->readers++)
if (likely(!lock->readers++))
spin_lock(&lock->lock);
}

static inline void xt_info_rdunlock_bh(void)
{
struct xt_info_lock *lock = &__get_cpu_var(xt_info_locks);

if (!--lock->readers)
if (likely(!--lock->readers))
spin_unlock(&lock->lock);
local_bh_enable();
}
Expand Down

0 comments on commit 0f3d042

Please sign in to comment.