int ret;
bool has_room;
- if (po->prot_hook.func == tpacket_rcv) {
- spin_lock(&po->sk.sk_receive_queue.lock);
- ret = __packet_rcv_has_room(po, skb);
- spin_unlock(&po->sk.sk_receive_queue.lock);
- } else {
- ret = __packet_rcv_has_room(po, skb);
- }
-
+ spin_lock_bh(&po->sk.sk_receive_queue.lock);
+ ret = __packet_rcv_has_room(po, skb);
has_room = ret == ROOM_NORMAL;
if (po->pressure == has_room)
- xchg(&po->pressure, !has_room);
+ po->pressure = !has_room;
+ spin_unlock_bh(&po->sk.sk_receive_queue.lock);
return ret;
}
mask |= POLLIN | POLLRDNORM;
}
if (po->pressure && __packet_rcv_has_room(po, NULL) == ROOM_NORMAL)
- xchg(&po->pressure, 0);
+ po->pressure = 0;
spin_unlock_bh(&sk->sk_receive_queue.lock);
spin_lock_bh(&sk->sk_write_queue.lock);
if (po->tx_ring.pg_vec) {