lkml.org 
[lkml]   [2003]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH][ATM] make atm (and clip) modular + try_module_get()
Date
From
In message <20030305.063158.53514369.davem@redhat.com>,"David S. Miller" writes
:
>If you own both objects, why lock anything?

i believe the original intent was to prevent anyone else from
appending to either of the lists while the lists are being joined.
while it would be slightly less efficient, should it use the
skb primitives? this is quite a bit easier to read:

void skb_migrate(struct sk_buff_head *from,struct sk_buff_head *to)
{
struct sk_buff *skb;
unsigned long flags;

local_irq_save(flags);
spin_lock(&to->lock);
spin_lock(&from->lock);

while(skb = __skb_dequeue(from))
__skb_queue_tail(to, skb);

spin_unlock(&to->lock);
spin_unlock(&from->lock);
local_irq_restore(flags);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.645 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site