aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-05-08 21:34:17 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-05-11 02:45:07 -0400
commit572a103ded0ad880f75ce83e99f0512fbb80b5b0 (patch)
treeb469715be284a13c3f603903cc9158baa7baa992 /include/linux/netdevice.h
parentc33be3c362f1bc98f6e2d731a274ef138ae80741 (diff)
[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>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 30446222b396..f671cd2f133f 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -467,6 +467,8 @@ struct net_device
467 /* device index hash chain */ 467 /* device index hash chain */
468 struct hlist_node index_hlist; 468 struct hlist_node index_hlist;
469 469
470 struct net_device *link_watch_next;
471
470 /* register/unregister state machine */ 472 /* register/unregister state machine */
471 enum { NETREG_UNINITIALIZED=0, 473 enum { NETREG_UNINITIALIZED=0,
472 NETREG_REGISTERED, /* completed register_netdevice */ 474 NETREG_REGISTERED, /* completed register_netdevice */