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

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

Advertisement

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

Filename:/net/ax25/af_ax25.c
Lines Added:13
Lines Deleted:21
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  2.6.25-git2  2.6.25-git3  2.6.25-git4 

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

Patch

diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index b4725ff..48bfcc7 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -330,10 +330,9 @@ void ax25_destroy_socket(ax25_cb *ax25)
       if (atomic_read(&ax25->sk->sk_wmem_alloc) ||
           atomic_read(&ax25->sk->sk_rmem_alloc)) {
          /* Defer: outstanding buffers */
-         init_timer(&ax25->dtimer);
+         setup_timer(&ax25->dtimer, ax25_destroy_timer,
+               (unsigned long)ax25);
          ax25->dtimer.expires  = jiffies + 2 * HZ;
-         ax25->dtimer.function = ax25_destroy_timer;
-         ax25->dtimer.data     = (unsigned long)ax25;
          add_timer(&ax25->dtimer);
       } else {
          struct sock *sk=ax25->sk;
@@ -511,11 +510,7 @@ ax25_cb *ax25_create_cb(void)
    skb_queue_head_init(&ax25->ack_queue);
    skb_queue_head_init(&ax25->reseq_queue);
 
-   init_timer(&ax25->timer);
-   init_timer(&ax25->t1timer);
-   init_timer(&ax25->t2timer);
-   init_timer(&ax25->t3timer);
-   init_timer(&ax25->idletimer);
+   ax25_setup_timers(ax25);
 
    ax25_fillin_cb(ax25, NULL);
 
@@ -571,7 +566,7 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,
          res = -EINVAL;
          break;
       }
-      ax25->rtt = (opt * HZ) / 2;
+      ax25->rtt = (opt * HZ) >> 1;
       ax25->t1  = opt * HZ;
       break;
 
@@ -1038,16 +1033,13 @@ static int ax25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
    int err = 0;
 
    if (addr_len != sizeof(struct sockaddr_ax25) &&
-       addr_len != sizeof(struct full_sockaddr_ax25)) {
-      /* support for old structure may go away some time */
+       addr_len != sizeof(struct full_sockaddr_ax25))
+      /* support for old structure may go away some time
+       * ax25_bind(): uses old (6 digipeater) socket structure.
+       */
       if ((addr_len < sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 6) ||
-          (addr_len > sizeof(struct full_sockaddr_ax25))) {
+          (addr_len > sizeof(struct full_sockaddr_ax25)))
          return -EINVAL;
-   }
-
-      printk(KERN_WARNING "ax25_bind(): %s uses old (6 digipeater) socket structure.\n",
-         current->comm);
-   }
 
    if (addr->fsa_ax25.sax25_family != AF_AX25)
       return -EINVAL;
@@ -1864,6 +1856,7 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 #ifdef CONFIG_PROC_FS
 
 static void *ax25_info_start(struct seq_file *seq, loff_t *pos)
+   __acquires(ax25_list_lock)
 {
    struct ax25_cb *ax25;
    struct hlist_node *node;
@@ -1887,6 +1880,7 @@ static void *ax25_info_next(struct seq_file *seq, void *v, loff_t *pos)
 }
 
 static void ax25_info_stop(struct seq_file *seq, void *v)
+   __releases(ax25_list_lock)
 {
    spin_unlock_bh(&ax25_list_lock);
 }
@@ -1930,12 +1924,10 @@ static int ax25_info_show(struct seq_file *seq, void *v)
          ax25->paclen);
 
    if (ax25->sk != NULL) {
-      bh_lock_sock(ax25->sk);
-      seq_printf(seq," %d %d %ld\n",
+      seq_printf(seq, " %d %d %lu\n",
             atomic_read(&ax25->sk->sk_wmem_alloc),
             atomic_read(&ax25->sk->sk_rmem_alloc),
-            ax25->sk->sk_socket != NULL ? SOCK_INODE(ax25->sk->sk_socket)->i_ino : 0L);
-      bh_unlock_sock(ax25->sk);
+            sock_i_ino(ax25->sk));
    } else {
       seq_puts(seq, " * * *\n");
    }


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