Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.25-rc7 /net/ax25/ax25_route.c

Filename:/net/ax25/ax25_route.c
Lines Added:16
Lines Deleted:14
Also changed in: (Previous) 2.6.25-rc6  2.6.25-rc5  2.6.25-rc4  2.6.25-rc3  2.6.25-rc2  2.6.25-rc1 
(Following) 2.6.25-rc8  2.6.25-rc9  2.6.25 

Location
[  2.6.25-rc7
  [  net
    [  ax25
       o  ax25_route.c

Patch

diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c
index 9ecf6f1..8672cd8 100644
--- a/net/ax25/ax25_route.c
+++ b/net/ax25/ax25_route.c
@@ -45,7 +45,7 @@ void ax25_rt_device_down(struct net_device *dev)
 {
    ax25_route *s, *t, *ax25_rt;
 
-   write_lock(&ax25_route_lock);
+   write_lock_bh(&ax25_route_lock);
    ax25_rt = ax25_route_list;
    while (ax25_rt != NULL) {
       s       = ax25_rt;
@@ -68,7 +68,7 @@ void ax25_rt_device_down(struct net_device *dev)
          }
       }
    }
-   write_unlock(&ax25_route_lock);
+   write_unlock_bh(&ax25_route_lock);
 }
 
 static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
@@ -82,7 +82,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
    if (route->digi_count > AX25_MAX_DIGIS)
       return -EINVAL;
 
-   write_lock(&ax25_route_lock);
+   write_lock_bh(&ax25_route_lock);
 
    ax25_rt = ax25_route_list;
    while (ax25_rt != NULL) {
@@ -92,7 +92,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
          ax25_rt->digipeat = NULL;
          if (route->digi_count != 0) {
             if ((ax25_rt->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) {
-               write_unlock(&ax25_route_lock);
+               write_unlock_bh(&ax25_route_lock);
                return -ENOMEM;
             }
             ax25_rt->digipeat->lastrepeat = -1;
@@ -102,14 +102,14 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
                ax25_rt->digipeat->calls[i]    = route->digi_addr[i];
             }
          }
-         write_unlock(&ax25_route_lock);
+         write_unlock_bh(&ax25_route_lock);
          return 0;
       }
       ax25_rt = ax25_rt->next;
    }
 
    if ((ax25_rt = kmalloc(sizeof(ax25_route), GFP_ATOMIC)) == NULL) {
-      write_unlock(&ax25_route_lock);
+      write_unlock_bh(&ax25_route_lock);
       return -ENOMEM;
    }
 
@@ -120,7 +120,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
    ax25_rt->ip_mode      = ' ';
    if (route->digi_count != 0) {
       if ((ax25_rt->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) {
-         write_unlock(&ax25_route_lock);
+         write_unlock_bh(&ax25_route_lock);
          kfree(ax25_rt);
          return -ENOMEM;
       }
@@ -133,7 +133,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
    }
    ax25_rt->next   = ax25_route_list;
    ax25_route_list = ax25_rt;
-   write_unlock(&ax25_route_lock);
+   write_unlock_bh(&ax25_route_lock);
 
    return 0;
 }
@@ -152,7 +152,7 @@ static int ax25_rt_del(struct ax25_routes_struct *route)
    if ((ax25_dev = ax25_addr_ax25dev(&route->port_addr)) == NULL)
       return -EINVAL;
 
-   write_lock(&ax25_route_lock);
+   write_lock_bh(&ax25_route_lock);
 
    ax25_rt = ax25_route_list;
    while (ax25_rt != NULL) {
@@ -174,7 +174,7 @@ static int ax25_rt_del(struct ax25_routes_struct *route)
          }
       }
    }
-   write_unlock(&ax25_route_lock);
+   write_unlock_bh(&ax25_route_lock);
 
    return 0;
 }
@@ -188,7 +188,7 @@ static int ax25_rt_opt(struct ax25_route_opt_struct *rt_option)
    if ((ax25_dev = ax25_addr_ax25dev(&rt_option->port_addr)) == NULL)
       return -EINVAL;
 
-   write_lock(&ax25_route_lock);
+   write_lock_bh(&ax25_route_lock);
 
    ax25_rt = ax25_route_list;
    while (ax25_rt != NULL) {
@@ -216,7 +216,7 @@ static int ax25_rt_opt(struct ax25_route_opt_struct *rt_option)
    }
 
 out:
-   write_unlock(&ax25_route_lock);
+   write_unlock_bh(&ax25_route_lock);
    return err;
 }
 
@@ -249,6 +249,7 @@ int ax25_rt_ioctl(unsigned int cmd, void __user *arg)
 #ifdef CONFIG_PROC_FS
 
 static void *ax25_rt_seq_start(struct seq_file *seq, loff_t *pos)
+   __acquires(ax25_route_lock)
 {
    struct ax25_route *ax25_rt;
    int i = 1;
@@ -274,6 +275,7 @@ static void *ax25_rt_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 }
 
 static void ax25_rt_seq_stop(struct seq_file *seq, void *v)
+   __releases(ax25_route_lock)
 {
    read_unlock(&ax25_route_lock);
 }
@@ -490,7 +492,7 @@ void __exit ax25_rt_free(void)
 {
    ax25_route *s, *ax25_rt = ax25_route_list;
 
-   write_lock(&ax25_route_lock);
+   write_lock_bh(&ax25_route_lock);
    while (ax25_rt != NULL) {
       s       = ax25_rt;
       ax25_rt = ax25_rt->next;
@@ -498,5 +500,5 @@ void __exit ax25_rt_free(void)
       kfree(s->digipeat);
       kfree(s);
    }
-   write_unlock(&ax25_route_lock);
+   write_unlock_bh(&ax25_route_lock);
 }


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.