]> bbs.cooldavid.org Git - net-next-2.6.git/commit - include/linux/netdevice.h
[NET] link_watch: Move link watch list into net_device
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 9 May 2007 01:34:17 +0000 (18:34 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 11 May 2007 06:45:07 +0000 (23:45 -0700)
commit572a103ded0ad880f75ce83e99f0512fbb80b5b0
treeb469715be284a13c3f603903cc9158baa7baa992
parentc33be3c362f1bc98f6e2d731a274ef138ae80741
[NET] link_watch: Move link watch list into net_device

These days the link watch mechanism is an integral part of the
network subsystem as it manages the carrier status.  So it now
makes sense to allocate some memory for it in net_device rather
than allocating it on demand.

In fact, this is necessary because we can't tolerate a memory
allocation failure since that means we'd have to potentially
throw a link up event away.

It also simplifies the code greatly.

In doing so I discovered a subtle race condition in the use
of singleevent.  This race condition still exists (and is
somewhat magnified) without singleevent but it's now plugged
thanks to an smp_mb__before_clear_bit.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
net/core/link_watch.c