perf: Optimize perf_output_copy()
[safe/jmp/linux-2.6] / net / rose / rose_link.c
index 09e9e9d..a750a28 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/string.h>
 #include <linux/sockios.h>
 #include <linux/net.h>
+#include <linux/slab.h>
 #include <net/ax25.h>
 #include <linux/inet.h>
 #include <linux/netdevice.h>
@@ -40,7 +41,8 @@ void rose_start_ftimer(struct rose_neigh *neigh)
 
        neigh->ftimer.data     = (unsigned long)neigh;
        neigh->ftimer.function = &rose_ftimer_expiry;
-       neigh->ftimer.expires  = jiffies + sysctl_rose_link_fail_timeout;
+       neigh->ftimer.expires  =
+               jiffies + msecs_to_jiffies(sysctl_rose_link_fail_timeout);
 
        add_timer(&neigh->ftimer);
 }
@@ -51,7 +53,8 @@ static void rose_start_t0timer(struct rose_neigh *neigh)
 
        neigh->t0timer.data     = (unsigned long)neigh;
        neigh->t0timer.function = &rose_t0timer_expiry;
-       neigh->t0timer.expires  = jiffies + sysctl_rose_restart_request_timeout;
+       neigh->t0timer.expires  =
+               jiffies + msecs_to_jiffies(sysctl_rose_restart_request_timeout);
 
        add_timer(&neigh->t0timer);
 }
@@ -99,13 +102,17 @@ static void rose_t0timer_expiry(unsigned long param)
 static int rose_send_frame(struct sk_buff *skb, struct rose_neigh *neigh)
 {
        ax25_address *rose_call;
+       ax25_cb *ax25s;
 
        if (ax25cmp(&rose_callsign, &null_ax25_address) == 0)
                rose_call = (ax25_address *)neigh->dev->dev_addr;
        else
                rose_call = &rose_callsign;
 
+       ax25s = neigh->ax25;
        neigh->ax25 = ax25_send_frame(skb, 260, rose_call, &neigh->callsign, neigh->digipeat, neigh->dev);
+       if (ax25s)
+               ax25_cb_put(ax25s);
 
        return (neigh->ax25 != NULL);
 }
@@ -118,13 +125,17 @@ static int rose_send_frame(struct sk_buff *skb, struct rose_neigh *neigh)
 static int rose_link_up(struct rose_neigh *neigh)
 {
        ax25_address *rose_call;
+       ax25_cb *ax25s;
 
        if (ax25cmp(&rose_callsign, &null_ax25_address) == 0)
                rose_call = (ax25_address *)neigh->dev->dev_addr;
        else
                rose_call = &rose_callsign;
 
+       ax25s = neigh->ax25;
        neigh->ax25 = ax25_find_cb(rose_call, &neigh->callsign, neigh->digipeat, neigh->dev);
+       if (ax25s)
+               ax25_cb_put(ax25s);
 
        return (neigh->ax25 != NULL);
 }