Skip to content

Commit a2f3be1

Browse files
ij1davem330
authored andcommitted
unix/garbage: kill copy of the skb queue walker
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 <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 26d2784 commit a2f3be1

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

‎net/unix/garbage.c‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,14 @@ void unix_notinflight(struct file *fp)
153153
}
154154
}
155155

156-
static inline struct sk_buff *sock_queue_head(struct sock *sk)
157-
{
158-
return (struct sk_buff *)&sk->sk_receive_queue;
159-
}
160-
161-
#define receive_queue_for_each_skb(sk, next, skb) \
162-
for (skb = sock_queue_head(sk)->next, next = skb->next; \
163-
skb != sock_queue_head(sk); skb = next, next = skb->next)
164-
165156
static void scan_inflight(struct sock *x, void (*func)(struct unix_sock *),
166157
struct sk_buff_head *hitlist)
167158
{
168159
struct sk_buff *skb;
169160
struct sk_buff *next;
170161

171162
spin_lock(&x->sk_receive_queue.lock);
172-
receive_queue_for_each_skb(x, next, skb) {
163+
skb_queue_walk_safe(&x->sk_receive_queue, skb, next) {
173164
/*
174165
* Do we have file descriptors ?
175166
*/
@@ -225,7 +216,7 @@ static void scan_children(struct sock *x, void (*func)(struct unix_sock *),
225216
* and perform a scan on them as well.
226217
*/
227218
spin_lock(&x->sk_receive_queue.lock);
228-
receive_queue_for_each_skb(x, next, skb) {
219+
skb_queue_walk_safe(&x->sk_receive_queue, skb, next) {
229220
u = unix_sk(skb->sk);
230221

231222
/*

0 commit comments

Comments
 (0)