Skip to content

Commit

Permalink
unix/garbage: kill copy of the skb queue walker
Browse files Browse the repository at this point in the history
Worse yet, it seems that its arguments were in reverse order. Also
remove one related helper which seems hardly worth keeping.

Signed-off-by: Ilpo Järvinen <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ij1 authored and davem330 committed May 3, 2010
1 parent 26d2784 commit a2f3be1
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions net/unix/garbage.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,23 +153,14 @@ void unix_notinflight(struct file *fp)
}
}

static inline struct sk_buff *sock_queue_head(struct sock *sk)
{
return (struct sk_buff *)&sk->sk_receive_queue;
}

#define receive_queue_for_each_skb(sk, next, skb) \
for (skb = sock_queue_head(sk)->next, next = skb->next; \
skb != sock_queue_head(sk); skb = next, next = skb->next)

static void scan_inflight(struct sock *x, void (*func)(struct unix_sock *),
struct sk_buff_head *hitlist)
{
struct sk_buff *skb;
struct sk_buff *next;

spin_lock(&x->sk_receive_queue.lock);
receive_queue_for_each_skb(x, next, skb) {
skb_queue_walk_safe(&x->sk_receive_queue, skb, next) {
/*
* Do we have file descriptors ?
*/
Expand Down Expand Up @@ -225,7 +216,7 @@ static void scan_children(struct sock *x, void (*func)(struct unix_sock *),
* and perform a scan on them as well.
*/
spin_lock(&x->sk_receive_queue.lock);
receive_queue_for_each_skb(x, next, skb) {
skb_queue_walk_safe(&x->sk_receive_queue, skb, next) {
u = unix_sk(skb->sk);

/*
Expand Down

0 comments on commit a2f3be1

Please sign in to comment.