Loading net/core/dst.c +20 −21 Original line number Diff line number Diff line Loading @@ -135,8 +135,8 @@ static void dst_gc_task(struct work_struct *work) } expires = dst_garbage.timer_expires; /* * if the next desired timer is more than 4 seconds in the future * then round the timer to whole seconds * if the next desired timer is more than 4 seconds in the * future then round the timer to whole seconds */ if (expires > 4*HZ) expires = round_jiffies_relative(expires); Loading @@ -151,7 +151,8 @@ static void dst_gc_task(struct work_struct *work) " expires: %lu elapsed: %lu us\n", atomic_read(&dst_total), delayed, work_performed, expires, elapsed.tv_sec * USEC_PER_SEC + elapsed.tv_nsec / NSEC_PER_USEC); elapsed.tv_sec * USEC_PER_SEC + elapsed.tv_nsec / NSEC_PER_USEC); #endif } Loading Loading @@ -184,17 +185,18 @@ void * dst_alloc(struct dst_ops * ops) atomic_inc(&ops->entries); return dst; } EXPORT_SYMBOL(dst_alloc); static void ___dst_free(struct dst_entry *dst) { /* The first case (dev==NULL) is required, when protocol module is unloaded. */ if (dst->dev == NULL || !(dst->dev->flags&IFF_UP)) { if (dst->dev == NULL || !(dst->dev->flags&IFF_UP)) dst->input = dst->output = dst_discard; } dst->obsolete = 2; } EXPORT_SYMBOL(__dst_free); void __dst_free(struct dst_entry *dst) { Loading Loading @@ -261,6 +263,7 @@ struct dst_entry *dst_destroy(struct dst_entry * dst) } return NULL; } EXPORT_SYMBOL(dst_destroy); void dst_release(struct dst_entry *dst) { Loading Loading @@ -305,7 +308,8 @@ static inline void dst_ifdown(struct dst_entry *dst, struct net_device *dev, } } static int dst_dev_event(struct notifier_block *this, unsigned long event, void *ptr) static int dst_dev_event(struct notifier_block *this, unsigned long event, void *ptr) { struct net_device *dev = ptr; struct dst_entry *dst, *last = NULL; Loading @@ -328,9 +332,8 @@ static int dst_dev_event(struct notifier_block *this, unsigned long event, void last->next = dst; else dst_busy_list = dst; for (; dst; dst = dst->next) { for (; dst; dst = dst->next) dst_ifdown(dst, dev, event != NETDEV_DOWN); } mutex_unlock(&dst_gc_mutex); break; } Loading @@ -345,7 +348,3 @@ void __init dst_init(void) { register_netdevice_notifier(&dst_dev_notifier); } EXPORT_SYMBOL(__dst_free); EXPORT_SYMBOL(dst_alloc); EXPORT_SYMBOL(dst_destroy); Loading
net/core/dst.c +20 −21 Original line number Diff line number Diff line Loading @@ -135,8 +135,8 @@ static void dst_gc_task(struct work_struct *work) } expires = dst_garbage.timer_expires; /* * if the next desired timer is more than 4 seconds in the future * then round the timer to whole seconds * if the next desired timer is more than 4 seconds in the * future then round the timer to whole seconds */ if (expires > 4*HZ) expires = round_jiffies_relative(expires); Loading @@ -151,7 +151,8 @@ static void dst_gc_task(struct work_struct *work) " expires: %lu elapsed: %lu us\n", atomic_read(&dst_total), delayed, work_performed, expires, elapsed.tv_sec * USEC_PER_SEC + elapsed.tv_nsec / NSEC_PER_USEC); elapsed.tv_sec * USEC_PER_SEC + elapsed.tv_nsec / NSEC_PER_USEC); #endif } Loading Loading @@ -184,17 +185,18 @@ void * dst_alloc(struct dst_ops * ops) atomic_inc(&ops->entries); return dst; } EXPORT_SYMBOL(dst_alloc); static void ___dst_free(struct dst_entry *dst) { /* The first case (dev==NULL) is required, when protocol module is unloaded. */ if (dst->dev == NULL || !(dst->dev->flags&IFF_UP)) { if (dst->dev == NULL || !(dst->dev->flags&IFF_UP)) dst->input = dst->output = dst_discard; } dst->obsolete = 2; } EXPORT_SYMBOL(__dst_free); void __dst_free(struct dst_entry *dst) { Loading Loading @@ -261,6 +263,7 @@ struct dst_entry *dst_destroy(struct dst_entry * dst) } return NULL; } EXPORT_SYMBOL(dst_destroy); void dst_release(struct dst_entry *dst) { Loading Loading @@ -305,7 +308,8 @@ static inline void dst_ifdown(struct dst_entry *dst, struct net_device *dev, } } static int dst_dev_event(struct notifier_block *this, unsigned long event, void *ptr) static int dst_dev_event(struct notifier_block *this, unsigned long event, void *ptr) { struct net_device *dev = ptr; struct dst_entry *dst, *last = NULL; Loading @@ -328,9 +332,8 @@ static int dst_dev_event(struct notifier_block *this, unsigned long event, void last->next = dst; else dst_busy_list = dst; for (; dst; dst = dst->next) { for (; dst; dst = dst->next) dst_ifdown(dst, dev, event != NETDEV_DOWN); } mutex_unlock(&dst_gc_mutex); break; } Loading @@ -345,7 +348,3 @@ void __init dst_init(void) { register_netdevice_notifier(&dst_dev_notifier); } EXPORT_SYMBOL(__dst_free); EXPORT_SYMBOL(dst_alloc); EXPORT_SYMBOL(dst_destroy);