diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-12-01 00:05:23 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:32:08 -0500 |
commit | c40a27f48ceee648e9cfdda040b69e7010d9f82c (patch) | |
tree | dde14f99417f4ce5d2ac367aa09f5f4fca18a5b2 /net/atm/ipcommon.c | |
parent | 1e9b3d5339d2afd6348e8211f0db695b00261e17 (diff) |
[ATM]: Kill ipcommon.[ch]
All that remained was skb_migrate() and that was overkill
for what the two call sites were trying to do.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm/ipcommon.c')
-rw-r--r-- | net/atm/ipcommon.c | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/net/atm/ipcommon.c b/net/atm/ipcommon.c deleted file mode 100644 index 1d3de42fada0..000000000000 --- a/net/atm/ipcommon.c +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | /* net/atm/ipcommon.c - Common items for all ways of doing IP over ATM */ | ||
2 | |||
3 | /* Written 1996-2000 by Werner Almesberger, EPFL LRC/ICA */ | ||
4 | |||
5 | |||
6 | #include <linux/module.h> | ||
7 | #include <linux/string.h> | ||
8 | #include <linux/skbuff.h> | ||
9 | #include <linux/netdevice.h> | ||
10 | #include <linux/in.h> | ||
11 | #include <linux/atmdev.h> | ||
12 | #include <linux/atmclip.h> | ||
13 | |||
14 | #include "common.h" | ||
15 | #include "ipcommon.h" | ||
16 | |||
17 | |||
18 | #if 0 | ||
19 | #define DPRINTK(format,args...) printk(KERN_DEBUG format,##args) | ||
20 | #else | ||
21 | #define DPRINTK(format,args...) | ||
22 | #endif | ||
23 | |||
24 | |||
25 | /* | ||
26 | * skb_migrate appends the list at "from" to "to", emptying "from" in the | ||
27 | * process. skb_migrate is atomic with respect to all other skb operations on | ||
28 | * "from" and "to". Note that it locks both lists at the same time, so to deal | ||
29 | * with the lock ordering, the locks are taken in address order. | ||
30 | * | ||
31 | * This function should live in skbuff.c or skbuff.h. | ||
32 | */ | ||
33 | |||
34 | |||
35 | void skb_migrate(struct sk_buff_head *from, struct sk_buff_head *to) | ||
36 | { | ||
37 | unsigned long flags; | ||
38 | struct sk_buff *skb_from = (struct sk_buff *) from; | ||
39 | struct sk_buff *skb_to = (struct sk_buff *) to; | ||
40 | struct sk_buff *prev; | ||
41 | |||
42 | if ((unsigned long) from < (unsigned long) to) { | ||
43 | spin_lock_irqsave(&from->lock, flags); | ||
44 | spin_lock_nested(&to->lock, SINGLE_DEPTH_NESTING); | ||
45 | } else { | ||
46 | spin_lock_irqsave(&to->lock, flags); | ||
47 | spin_lock_nested(&from->lock, SINGLE_DEPTH_NESTING); | ||
48 | } | ||
49 | prev = from->prev; | ||
50 | from->next->prev = to->prev; | ||
51 | prev->next = skb_to; | ||
52 | to->prev->next = from->next; | ||
53 | to->prev = from->prev; | ||
54 | to->qlen += from->qlen; | ||
55 | spin_unlock(&to->lock); | ||
56 | from->prev = skb_from; | ||
57 | from->next = skb_from; | ||
58 | from->qlen = 0; | ||
59 | spin_unlock_irqrestore(&from->lock, flags); | ||
60 | } | ||
61 | |||
62 | |||
63 | EXPORT_SYMBOL(skb_migrate); | ||