aboutsummaryrefslogtreecommitdiff
path: root/net/rose
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2008-01-31 11:25:51 +1100
committerPaul Mackerras <paulus@samba.org>2008-01-31 11:25:51 +1100
commitbd45ac0c5daae35e7c71138172e63df5cf644cf6 (patch)
tree5eb5a599bf6a9d7a8a34e802db932aa9e9555de4 /net/rose
parent4eece4ccf997c0e6d8fdad3d842e37b16b8d705f (diff)
parent5bdeae46be6dfe9efa44a548bd622af325f4bdb4 (diff)
Merge branch 'linux-2.6'
Diffstat (limited to 'net/rose')
-rw-r--r--net/rose/af_rose.c13
-rw-r--r--net/rose/rose_in.c2
-rw-r--r--net/rose/rose_route.c10
-rw-r--r--net/rose/sysctl_net_rose.c24
4 files changed, 21 insertions, 28 deletions
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index ed2d65cd801..4a31a81059a 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -116,7 +116,7 @@ int rosecmp(rose_address *addr1, rose_address *addr2)
*/
int rosecmpm(rose_address *addr1, rose_address *addr2, unsigned short mask)
{
- int i, j;
+ unsigned int i, j;
if (mask > 10)
return 1;
@@ -345,10 +345,9 @@ void rose_destroy_socket(struct sock *sk)
if (atomic_read(&sk->sk_wmem_alloc) ||
atomic_read(&sk->sk_rmem_alloc)) {
/* Defer: outstanding buffers */
- init_timer(&sk->sk_timer);
+ setup_timer(&sk->sk_timer, rose_destroy_timer,
+ (unsigned long)sk);
sk->sk_timer.expires = jiffies + 10 * HZ;
- sk->sk_timer.function = rose_destroy_timer;
- sk->sk_timer.data = (unsigned long)sk;
add_timer(&sk->sk_timer);
} else
sock_put(sk);
@@ -974,8 +973,8 @@ int rose_rx_call_request(struct sk_buff *skb, struct net_device *dev, struct ros
*/
memset(&facilities, 0x00, sizeof(struct rose_facilities_struct));
- len = (((skb->data[3] >> 4) & 0x0F) + 1) / 2;
- len += (((skb->data[3] >> 0) & 0x0F) + 1) / 2;
+ len = (((skb->data[3] >> 4) & 0x0F) + 1) >> 1;
+ len += (((skb->data[3] >> 0) & 0x0F) + 1) >> 1;
if (!rose_parse_facilities(skb->data + len + 4, &facilities)) {
rose_transmit_clear_request(neigh, lci, ROSE_INVALID_FACILITY, 76);
return 0;
@@ -1378,6 +1377,7 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
#ifdef CONFIG_PROC_FS
static void *rose_info_start(struct seq_file *seq, loff_t *pos)
+ __acquires(rose_list_lock)
{
int i;
struct sock *s;
@@ -1405,6 +1405,7 @@ static void *rose_info_next(struct seq_file *seq, void *v, loff_t *pos)
}
static void rose_info_stop(struct seq_file *seq, void *v)
+ __releases(rose_list_lock)
{
spin_unlock_bh(&rose_list_lock);
}
diff --git a/net/rose/rose_in.c b/net/rose/rose_in.c
index 4ee0879d354..7f7fcb46b4f 100644
--- a/net/rose/rose_in.c
+++ b/net/rose/rose_in.c
@@ -182,7 +182,7 @@ static int rose_state3_machine(struct sock *sk, struct sk_buff *skb, int framety
break;
}
if (atomic_read(&sk->sk_rmem_alloc) >
- (sk->sk_rcvbuf / 2))
+ (sk->sk_rcvbuf >> 1))
rose->condition |= ROSE_COND_OWN_RX_BUSY;
}
/*
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index 540c0f26ffe..fb9359fb235 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -994,8 +994,8 @@ int rose_route_frame(struct sk_buff *skb, ax25_cb *ax25)
goto out;
}
- len = (((skb->data[3] >> 4) & 0x0F) + 1) / 2;
- len += (((skb->data[3] >> 0) & 0x0F) + 1) / 2;
+ len = (((skb->data[3] >> 4) & 0x0F) + 1) >> 1;
+ len += (((skb->data[3] >> 0) & 0x0F) + 1) >> 1;
memset(&facilities, 0x00, sizeof(struct rose_facilities_struct));
@@ -1068,6 +1068,7 @@ out:
#ifdef CONFIG_PROC_FS
static void *rose_node_start(struct seq_file *seq, loff_t *pos)
+ __acquires(rose_neigh_list_lock)
{
struct rose_node *rose_node;
int i = 1;
@@ -1091,6 +1092,7 @@ static void *rose_node_next(struct seq_file *seq, void *v, loff_t *pos)
}
static void rose_node_stop(struct seq_file *seq, void *v)
+ __releases(rose_neigh_list_lock)
{
spin_unlock_bh(&rose_neigh_list_lock);
}
@@ -1144,6 +1146,7 @@ const struct file_operations rose_nodes_fops = {
};
static void *rose_neigh_start(struct seq_file *seq, loff_t *pos)
+ __acquires(rose_neigh_list_lock)
{
struct rose_neigh *rose_neigh;
int i = 1;
@@ -1167,6 +1170,7 @@ static void *rose_neigh_next(struct seq_file *seq, void *v, loff_t *pos)
}
static void rose_neigh_stop(struct seq_file *seq, void *v)
+ __releases(rose_neigh_list_lock)
{
spin_unlock_bh(&rose_neigh_list_lock);
}
@@ -1227,6 +1231,7 @@ const struct file_operations rose_neigh_fops = {
static void *rose_route_start(struct seq_file *seq, loff_t *pos)
+ __acquires(rose_route_list_lock)
{
struct rose_route *rose_route;
int i = 1;
@@ -1250,6 +1255,7 @@ static void *rose_route_next(struct seq_file *seq, void *v, loff_t *pos)
}
static void rose_route_stop(struct seq_file *seq, void *v)
+ __releases(rose_route_list_lock)
{
spin_unlock_bh(&rose_route_list_lock);
}
diff --git a/net/rose/sysctl_net_rose.c b/net/rose/sysctl_net_rose.c
index 455b0555a66..20be3485a97 100644
--- a/net/rose/sysctl_net_rose.c
+++ b/net/rose/sysctl_net_rose.c
@@ -138,29 +138,15 @@ static ctl_table rose_table[] = {
{ .ctl_name = 0 }
};
-static ctl_table rose_dir_table[] = {
- {
- .ctl_name = NET_ROSE,
- .procname = "rose",
- .mode = 0555,
- .child = rose_table
- },
- { .ctl_name = 0 }
-};
-
-static ctl_table rose_root_table[] = {
- {
- .ctl_name = CTL_NET,
- .procname = "net",
- .mode = 0555,
- .child = rose_dir_table
- },
- { .ctl_name = 0 }
+static struct ctl_path rose_path[] = {
+ { .procname = "net", .ctl_name = CTL_NET, },
+ { .procname = "rose", .ctl_name = NET_ROSE, },
+ { }
};
void __init rose_register_sysctl(void)
{
- rose_table_header = register_sysctl_table(rose_root_table);
+ rose_table_header = register_sysctl_paths(rose_path, rose_table);
}
void rose_unregister_sysctl(void)