projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
WorkStruct: Separate delayable and non-delayable events.
[deliverable/linux.git]
/
net
/
core
/
link_watch.c
diff --git
a/net/core/link_watch.c
b/net/core/link_watch.c
index 646937cc2d84db521aeff0b4eedb7a1bc89670d5..f2ed09e25dfd63fdba8d1d9f8e9e16550dfab239 100644
(file)
--- a/
net/core/link_watch.c
+++ b/
net/core/link_watch.c
@@
-11,7
+11,6
@@
*
*/
*
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/if.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/if.h>
@@
-36,7
+35,7
@@
static unsigned long linkwatch_flags;
static unsigned long linkwatch_nextevent;
static void linkwatch_event(void *dummy);
static unsigned long linkwatch_nextevent;
static void linkwatch_event(void *dummy);
-static DECLARE_WORK(linkwatch_work, linkwatch_event, NULL);
+static DECLARE_
DELAYED_
WORK(linkwatch_work, linkwatch_event, NULL);
static LIST_HEAD(lweventlist);
static DEFINE_SPINLOCK(lweventlist_lock);
static LIST_HEAD(lweventlist);
static DEFINE_SPINLOCK(lweventlist_lock);
@@
-91,11
+90,10
@@
static void rfc2863_policy(struct net_device *dev)
/* Must be called with the rtnl semaphore held */
void linkwatch_run_queue(void)
{
/* Must be called with the rtnl semaphore held */
void linkwatch_run_queue(void)
{
- LIST_HEAD(head);
- struct list_head *n, *next;
+ struct list_head head, *n, *next;
spin_lock_irq(&lweventlist_lock);
spin_lock_irq(&lweventlist_lock);
- list_
spli
ce_init(&lweventlist, &head);
+ list_
repla
ce_init(&lweventlist, &head);
spin_unlock_irq(&lweventlist_lock);
list_for_each_safe(n, next, &head) {
spin_unlock_irq(&lweventlist_lock);
list_for_each_safe(n, next, &head) {
@@
-173,10
+171,9
@@
void linkwatch_fire_event(struct net_device *dev)
unsigned long delay = linkwatch_nextevent - jiffies;
/* If we wrap around we'll delay it by at most HZ. */
unsigned long delay = linkwatch_nextevent - jiffies;
/* If we wrap around we'll delay it by at most HZ. */
- if (!delay || delay > HZ)
- schedule_work(&linkwatch_work);
- else
- schedule_delayed_work(&linkwatch_work, delay);
+ if (delay > HZ)
+ delay = 0;
+ schedule_delayed_work(&linkwatch_work, delay);
}
}
}
}
}
}
This page took
0.026067 seconds
and
5
git commands to generate.