Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 187943
b: refs/heads/master
c: a3a858f
h: refs/heads/master
i:
  187941: e88cecb
  187939: 0dd7aa9
  187935: 53c2a20
v: v3
  • Loading branch information
Zhu Yi authored and David S. Miller committed Mar 5, 2010
1 parent 129acc1 commit ae400b9
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2499849ee8f513e795b9f2c19a42d6356e4943a4
refs/heads/master: a3a858ff18a72a8d388e31ab0d98f7e944841a62
6 changes: 3 additions & 3 deletions trunk/include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ static inline int sk_stream_memory_free(struct sock *sk)
}

/* OOB backlog add */
static inline void sk_add_backlog(struct sock *sk, struct sk_buff *skb)
static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb)
{
if (!sk->sk_backlog.tail) {
sk->sk_backlog.head = sk->sk_backlog.tail = skb;
Expand All @@ -604,12 +604,12 @@ static inline void sk_add_backlog(struct sock *sk, struct sk_buff *skb)
}

/* The per-socket spinlock must be held here. */
static inline int sk_add_backlog_limited(struct sock *sk, struct sk_buff *skb)
static inline int sk_add_backlog(struct sock *sk, struct sk_buff *skb)
{
if (sk->sk_backlog.len >= max(sk->sk_backlog.limit, sk->sk_rcvbuf << 1))
return -ENOBUFS;

sk_add_backlog(sk, skb);
__sk_add_backlog(sk, skb);
sk->sk_backlog.len += skb->truesize;
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested)
rc = sk_backlog_rcv(sk, skb);

mutex_release(&sk->sk_lock.dep_map, 1, _RET_IP_);
} else if (sk_add_backlog_limited(sk, skb)) {
} else if (sk_add_backlog(sk, skb)) {
bh_unlock_sock(sk);
atomic_inc(&sk->sk_drops);
goto discard_and_relse;
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/dccp/minisocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ int dccp_child_process(struct sock *parent, struct sock *child,
* in main socket hash table and lock on listening
* socket does not protect us more.
*/
sk_add_backlog(child, skb);
__sk_add_backlog(child, skb);
}

bh_unlock_sock(child);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/tcp_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
if (!tcp_prequeue(sk, skb))
ret = tcp_v4_do_rcv(sk, skb);
}
} else if (sk_add_backlog_limited(sk, skb)) {
} else if (sk_add_backlog(sk, skb)) {
bh_unlock_sock(sk);
goto discard_and_relse;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/tcp_minisocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ int tcp_child_process(struct sock *parent, struct sock *child,
* in main socket hash table and lock on listening
* socket does not protect us more.
*/
sk_add_backlog(child, skb);
__sk_add_backlog(child, skb);
}

bh_unlock_sock(child);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
bh_lock_sock(sk);
if (!sock_owned_by_user(sk))
rc = __udp_queue_rcv_skb(sk, skb);
else if (sk_add_backlog_limited(sk, skb)) {
else if (sk_add_backlog(sk, skb)) {
bh_unlock_sock(sk);
goto drop;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv6/tcp_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -1740,7 +1740,7 @@ static int tcp_v6_rcv(struct sk_buff *skb)
if (!tcp_prequeue(sk, skb))
ret = tcp_v6_do_rcv(sk, skb);
}
} else if (sk_add_backlog_limited(sk, skb)) {
} else if (sk_add_backlog(sk, skb)) {
bh_unlock_sock(sk);
goto discard_and_relse;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv6/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ static void flush_stack(struct sock **stack, unsigned int count,
bh_lock_sock(sk);
if (!sock_owned_by_user(sk))
udpv6_queue_rcv_skb(sk, skb1);
else if (sk_add_backlog_limited(sk, skb1)) {
else if (sk_add_backlog(sk, skb1)) {
kfree_skb(skb1);
bh_unlock_sock(sk);
goto drop;
Expand Down Expand Up @@ -758,7 +758,7 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
bh_lock_sock(sk);
if (!sock_owned_by_user(sk))
udpv6_queue_rcv_skb(sk, skb);
else if (sk_add_backlog_limited(sk, skb)) {
else if (sk_add_backlog(sk, skb)) {
atomic_inc(&sk->sk_drops);
bh_unlock_sock(sk);
sock_put(sk);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/llc/llc_c_ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ static void llc_process_tmr_ev(struct sock *sk, struct sk_buff *skb)
llc_conn_state_process(sk, skb);
else {
llc_set_backlog_type(skb, LLC_EVENT);
sk_add_backlog(sk, skb);
__sk_add_backlog(sk, skb);
}
}
}
2 changes: 1 addition & 1 deletion trunk/net/llc/llc_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ void llc_conn_handler(struct llc_sap *sap, struct sk_buff *skb)
else {
dprintk("%s: adding to backlog...\n", __func__);
llc_set_backlog_type(skb, LLC_PACKET);
if (sk_add_backlog_limited(sk, skb))
if (sk_add_backlog(sk, skb))
goto drop_unlock;
}
out:
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/sctp/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb)
sctp_bh_lock_sock(sk);

if (sock_owned_by_user(sk)) {
if (sk_add_backlog_limited(sk, skb))
if (sk_add_backlog(sk, skb))
sctp_chunk_free(chunk);
else
backloged = 1;
Expand Down Expand Up @@ -375,7 +375,7 @@ static int sctp_add_backlog(struct sock *sk, struct sk_buff *skb)
struct sctp_ep_common *rcvr = chunk->rcvr;
int ret;

ret = sk_add_backlog_limited(sk, skb);
ret = sk_add_backlog(sk, skb);
if (!ret) {
/* Hold the assoc/ep while hanging on the backlog queue.
* This way, we know structures we need will not disappear
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/tipc/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ static u32 dispatch(struct tipc_port *tport, struct sk_buff *buf)
if (!sock_owned_by_user(sk)) {
res = filter_rcv(sk, buf);
} else {
if (sk_add_backlog_limited(sk, buf))
if (sk_add_backlog(sk, buf))
res = TIPC_ERR_OVERLOAD;
else
res = TIPC_OK;
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/x25/x25_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static int x25_receive_data(struct sk_buff *skb, struct x25_neigh *nb)
if (!sock_owned_by_user(sk)) {
queued = x25_process_rx_frame(sk, skb);
} else {
queued = !sk_add_backlog_limited(sk, skb);
queued = !sk_add_backlog(sk, skb);
}
bh_unlock_sock(sk);
sock_put(sk);
Expand Down

0 comments on commit ae400b9

Please sign in to comment.