Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
62fcaee9
Commit
62fcaee9
authored
Aug 05, 2002
by
Ralf Bächle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace interrupt-safe spinlocks with their bh-safe equivalents.
parent
9c81c0a2
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
163 additions
and
228 deletions
+163
-228
net/ax25/af_ax25.c
net/ax25/af_ax25.c
+20
-30
net/ax25/ax25_dev.c
net/ax25/ax25_dev.c
+12
-17
net/ax25/ax25_ds_subr.c
net/ax25/ax25_ds_subr.c
+4
-6
net/ax25/ax25_ds_timer.c
net/ax25/ax25_ds_timer.c
+2
-3
net/ax25/ax25_iface.c
net/ax25/ax25_iface.c
+16
-22
net/ax25/ax25_out.c
net/ax25/ax25_out.c
+3
-4
net/ax25/sysctl_net_ax25.c
net/ax25/sysctl_net_ax25.c
+3
-4
net/netrom/af_netrom.c
net/netrom/af_netrom.c
+19
-27
net/netrom/nr_route.c
net/netrom/nr_route.c
+18
-24
net/rose/af_rose.c
net/rose/af_rose.c
+19
-26
net/rose/rose_route.c
net/rose/rose_route.c
+47
-65
No files found.
net/ax25/af_ax25.c
View file @
62fcaee9
...
...
@@ -83,25 +83,24 @@ static void ax25_free_sock(struct sock *sk)
static
void
ax25_remove_socket
(
ax25_cb
*
ax25
)
{
ax25_cb
*
s
;
unsigned
long
flags
;
spin_lock_
irqsave
(
&
ax25_list_lock
,
flags
);
spin_lock_
bh
(
&
ax25_list_lock
);
if
((
s
=
ax25_list
)
==
ax25
)
{
ax25_list
=
s
->
next
;
spin_unlock_
irqrestore
(
&
ax25_list_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_list_lock
);
return
;
}
while
(
s
!=
NULL
&&
s
->
next
!=
NULL
)
{
if
(
s
->
next
==
ax25
)
{
s
->
next
=
ax25
->
next
;
spin_unlock_
irqrestore
(
&
ax25_list_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_list_lock
);
return
;
}
s
=
s
->
next
;
}
spin_unlock_
irqrestore
(
&
ax25_list_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_list_lock
);
}
/*
...
...
@@ -109,21 +108,20 @@ static void ax25_remove_socket(ax25_cb *ax25)
*/
static
void
ax25_kill_by_device
(
struct
net_device
*
dev
)
{
unsigned
long
flags
;
ax25_dev
*
ax25_dev
;
ax25_cb
*
s
;
if
((
ax25_dev
=
ax25_dev_ax25dev
(
dev
))
==
NULL
)
return
;
spin_lock_
irqsave
(
&
ax25_list_lock
,
flags
);
spin_lock_
bh
(
&
ax25_list_lock
);
for
(
s
=
ax25_list
;
s
!=
NULL
;
s
=
s
->
next
)
{
if
(
s
->
ax25_dev
==
ax25_dev
)
{
s
->
ax25_dev
=
NULL
;
ax25_disconnect
(
s
,
ENETUNREACH
);
}
}
spin_unlock_
irqrestore
(
&
ax25_list_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_list_lock
);
}
/*
...
...
@@ -159,12 +157,10 @@ static int ax25_device_event(struct notifier_block *this, unsigned long event,
*/
void
ax25_insert_socket
(
ax25_cb
*
ax25
)
{
unsigned
long
flags
;
spin_lock_irqsave
(
&
ax25_list_lock
,
flags
);
spin_lock_bh
(
&
ax25_list_lock
);
ax25
->
next
=
ax25_list
;
ax25_list
=
ax25
;
spin_unlock_
irqrestore
(
&
ax25_list_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_list_lock
);
}
/*
...
...
@@ -174,23 +170,22 @@ void ax25_insert_socket(ax25_cb *ax25)
struct
sock
*
ax25_find_listener
(
ax25_address
*
addr
,
int
digi
,
struct
net_device
*
dev
,
int
type
)
{
unsigned
long
flags
;
ax25_cb
*
s
;
spin_lock_
irqsave
(
&
ax25_list_lock
,
flags
);
spin_lock_
bh
(
&
ax25_list_lock
);
for
(
s
=
ax25_list
;
s
!=
NULL
;
s
=
s
->
next
)
{
if
((
s
->
iamdigi
&&
!
digi
)
||
(
!
s
->
iamdigi
&&
digi
))
continue
;
if
(
s
->
sk
!=
NULL
&&
ax25cmp
(
&
s
->
source_addr
,
addr
)
==
0
&&
s
->
sk
->
type
==
type
&&
s
->
sk
->
state
==
TCP_LISTEN
)
{
/* If device is null we match any device */
if
(
s
->
ax25_dev
==
NULL
||
s
->
ax25_dev
->
dev
==
dev
)
{
spin_unlock_
irqrestore
(
&
ax25_list_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_list_lock
);
return
s
->
sk
;
}
}
}
spin_unlock_
irqrestore
(
&
ax25_list_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_list_lock
);
return
NULL
;
}
...
...
@@ -202,10 +197,9 @@ struct sock *ax25_get_socket(ax25_address *my_addr, ax25_address *dest_addr,
int
type
)
{
struct
sock
*
sk
=
NULL
;
unsigned
long
flags
;
ax25_cb
*
s
;
spin_lock_
irqsave
(
&
ax25_list_lock
,
flags
);
spin_lock_
bh
(
&
ax25_list_lock
);
for
(
s
=
ax25_list
;
s
!=
NULL
;
s
=
s
->
next
)
{
if
(
s
->
sk
!=
NULL
&&
ax25cmp
(
&
s
->
source_addr
,
my_addr
)
==
0
&&
ax25cmp
(
&
s
->
dest_addr
,
dest_addr
)
==
0
&&
s
->
sk
->
type
==
type
)
{
sk
=
s
->
sk
;
...
...
@@ -215,7 +209,7 @@ struct sock *ax25_get_socket(ax25_address *my_addr, ax25_address *dest_addr,
}
out:
spin_unlock_
irqrestore
(
&
ax25_list_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_list_lock
);
return
NULL
;
}
...
...
@@ -228,9 +222,8 @@ ax25_cb *ax25_find_cb(ax25_address *src_addr, ax25_address *dest_addr,
ax25_digi
*
digi
,
struct
net_device
*
dev
)
{
ax25_cb
*
s
;
unsigned
long
flags
;
spin_lock_
irqsave
(
&
ax25_list_lock
,
flags
);
spin_lock_
bh
(
&
ax25_list_lock
);
for
(
s
=
ax25_list
;
s
!=
NULL
;
s
=
s
->
next
)
{
if
(
s
->
sk
!=
NULL
&&
s
->
sk
->
type
!=
SOCK_SEQPACKET
)
continue
;
...
...
@@ -246,12 +239,12 @@ ax25_cb *ax25_find_cb(ax25_address *src_addr, ax25_address *dest_addr,
if
(
s
->
digipeat
!=
NULL
&&
s
->
digipeat
->
ndigi
!=
0
)
continue
;
}
spin_unlock_
irqrestore
(
&
ax25_list_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_list_lock
);
return
s
;
}
}
spin_unlock_
irqrestore
(
&
ax25_list_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_list_lock
);
return
NULL
;
}
...
...
@@ -261,11 +254,10 @@ ax25_cb *ax25_find_cb(ax25_address *src_addr, ax25_address *dest_addr,
*/
struct
sock
*
ax25_addr_match
(
ax25_address
*
addr
)
{
unsigned
long
flags
;
struct
sock
*
sk
=
NULL
;
ax25_cb
*
s
;
spin_lock_
irqsave
(
&
ax25_list_lock
,
flags
);
spin_lock_
bh
(
&
ax25_list_lock
);
for
(
s
=
ax25_list
;
s
!=
NULL
;
s
=
s
->
next
)
{
if
(
s
->
sk
!=
NULL
&&
ax25cmp
(
&
s
->
source_addr
,
addr
)
==
0
&&
s
->
sk
->
type
==
SOCK_RAW
)
{
...
...
@@ -274,7 +266,7 @@ struct sock *ax25_addr_match(ax25_address *addr)
break
;
}
}
spin_unlock_
irqrestore
(
&
ax25_list_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_list_lock
);
return
sk
;
}
...
...
@@ -320,7 +312,6 @@ static void ax25_destroy_timer(unsigned long data)
void
ax25_destroy_socket
(
ax25_cb
*
ax25
)
{
struct
sk_buff
*
skb
;
unsigned
long
flags
;
ax25_remove_socket
(
ax25
);
...
...
@@ -1847,14 +1838,13 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
static
int
ax25_get_info
(
char
*
buffer
,
char
**
start
,
off_t
offset
,
int
length
)
{
unsigned
long
flags
;
ax25_cb
*
ax25
;
int
k
;
int
len
=
0
;
off_t
pos
=
0
;
off_t
begin
=
0
;
spin_lock_
irqsave
(
&
ax25_list_lock
,
flags
);
spin_lock_
bh
(
&
ax25_list_lock
);
/*
* New format:
...
...
@@ -1909,7 +1899,7 @@ static int ax25_get_info(char *buffer, char **start, off_t offset, int length)
break
;
}
spin_unlock_
irqrestore
(
&
ax25_list_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_list_lock
);
*
start
=
buffer
+
(
offset
-
begin
);
len
-=
(
offset
-
begin
);
...
...
net/ax25/ax25_dev.c
View file @
62fcaee9
...
...
@@ -37,15 +37,14 @@ spinlock_t ax25_dev_lock = SPIN_LOCK_UNLOCKED;
ax25_dev
*
ax25_dev_ax25dev
(
struct
net_device
*
dev
)
{
ax25_dev
*
ax25_dev
,
*
res
=
NULL
;
unsigned
long
flags
;
spin_lock_
irqsave
(
&
ax25_dev_lock
,
flags
);
spin_lock_
bh
(
&
ax25_dev_lock
);
for
(
ax25_dev
=
ax25_dev_list
;
ax25_dev
!=
NULL
;
ax25_dev
=
ax25_dev
->
next
)
if
(
ax25_dev
->
dev
==
dev
)
{
res
=
ax25_dev
;
break
;
}
spin_unlock_
irqrestore
(
&
ax25_dev_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_dev_lock
);
return
res
;
}
...
...
@@ -53,14 +52,13 @@ ax25_dev *ax25_dev_ax25dev(struct net_device *dev)
ax25_dev
*
ax25_addr_ax25dev
(
ax25_address
*
addr
)
{
ax25_dev
*
ax25_dev
,
*
res
=
NULL
;
unsigned
long
flags
;
spin_lock_
irqsave
(
&
ax25_dev_lock
,
flags
);
spin_lock_
bh
(
&
ax25_dev_lock
);
for
(
ax25_dev
=
ax25_dev_list
;
ax25_dev
!=
NULL
;
ax25_dev
=
ax25_dev
->
next
)
if
(
ax25cmp
(
addr
,
(
ax25_address
*
)
ax25_dev
->
dev
->
dev_addr
)
==
0
)
{
res
=
ax25_dev
;
}
spin_unlock_
irqrestore
(
&
ax25_dev_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_dev_lock
);
return
res
;
}
...
...
@@ -72,7 +70,6 @@ ax25_dev *ax25_addr_ax25dev(ax25_address *addr)
void
ax25_dev_device_up
(
struct
net_device
*
dev
)
{
ax25_dev
*
ax25_dev
;
unsigned
long
flags
;
if
((
ax25_dev
=
kmalloc
(
sizeof
(
*
ax25_dev
),
GFP_ATOMIC
))
==
NULL
)
{
printk
(
KERN_ERR
"AX.25: ax25_dev_device_up - out of memory
\n
"
);
...
...
@@ -101,10 +98,10 @@ void ax25_dev_device_up(struct net_device *dev)
ax25_dev
->
values
[
AX25_VALUES_PROTOCOL
]
=
AX25_DEF_PROTOCOL
;
ax25_dev
->
values
[
AX25_VALUES_DS_TIMEOUT
]
=
AX25_DEF_DS_TIMEOUT
;
spin_lock_
irqsave
(
&
ax25_dev_lock
,
flags
);
spin_lock_
bh
(
&
ax25_dev_lock
);
ax25_dev
->
next
=
ax25_dev_list
;
ax25_dev_list
=
ax25_dev
;
spin_unlock_
irqrestore
(
&
ax25_dev_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_dev_lock
);
ax25_register_sysctl
();
}
...
...
@@ -112,14 +109,13 @@ void ax25_dev_device_up(struct net_device *dev)
void
ax25_dev_device_down
(
struct
net_device
*
dev
)
{
ax25_dev
*
s
,
*
ax25_dev
;
unsigned
long
flags
;
if
((
ax25_dev
=
ax25_dev_ax25dev
(
dev
))
==
NULL
)
return
;
ax25_unregister_sysctl
();
spin_lock_
irqsave
(
&
ax25_dev_lock
,
flags
);
spin_lock_
bh
(
&
ax25_dev_lock
);
#ifdef CONFIG_AX25_DAMA_SLAVE
ax25_ds_del_timer
(
ax25_dev
);
...
...
@@ -134,7 +130,7 @@ void ax25_dev_device_down(struct net_device *dev)
if
((
s
=
ax25_dev_list
)
==
ax25_dev
)
{
ax25_dev_list
=
s
->
next
;
spin_unlock_
irqrestore
(
&
ax25_dev_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_dev_lock
);
kfree
(
ax25_dev
);
ax25_register_sysctl
();
return
;
...
...
@@ -143,7 +139,7 @@ void ax25_dev_device_down(struct net_device *dev)
while
(
s
!=
NULL
&&
s
->
next
!=
NULL
)
{
if
(
s
->
next
==
ax25_dev
)
{
s
->
next
=
ax25_dev
->
next
;
spin_unlock_
irqrestore
(
&
ax25_dev_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_dev_lock
);
kfree
(
ax25_dev
);
ax25_register_sysctl
();
return
;
...
...
@@ -151,7 +147,7 @@ void ax25_dev_device_down(struct net_device *dev)
s
=
s
->
next
;
}
spin_unlock_
irqrestore
(
&
ax25_dev_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_dev_lock
);
ax25_register_sysctl
();
}
...
...
@@ -204,9 +200,8 @@ struct net_device *ax25_fwd_dev(struct net_device *dev)
void
__exit
ax25_dev_free
(
void
)
{
ax25_dev
*
s
,
*
ax25_dev
;
unsigned
long
flags
;
spin_lock_
irqsave
(
&
ax25_dev_lock
,
flags
);
spin_lock_
bh
(
&
ax25_dev_lock
);
ax25_dev
=
ax25_dev_list
;
while
(
ax25_dev
!=
NULL
)
{
s
=
ax25_dev
;
...
...
@@ -215,5 +210,5 @@ void __exit ax25_dev_free(void)
kfree
(
s
);
}
ax25_dev_list
=
NULL
;
spin_unlock_
irqrestore
(
&
ax25_dev_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_dev_lock
);
}
net/ax25/ax25_ds_subr.c
View file @
62fcaee9
...
...
@@ -39,7 +39,6 @@ void ax25_ds_nr_error_recovery(ax25_cb *ax25)
*/
void
ax25_ds_enquiry_response
(
ax25_cb
*
ax25
)
{
unsigned
long
flags
;
ax25_cb
*
ax25o
;
/* Please note that neither DK4EGs nor DG2FEFs
...
...
@@ -80,7 +79,7 @@ void ax25_ds_enquiry_response(ax25_cb *ax25)
ax25_start_t3timer
(
ax25
);
ax25_ds_set_timer
(
ax25
->
ax25_dev
);
spin_lock_
irqsave
(
&
ax25_list_lock
,
flags
);
spin_lock_
bh
(
&
ax25_list_lock
);
for
(
ax25o
=
ax25_list
;
ax25o
!=
NULL
;
ax25o
=
ax25o
->
next
)
{
if
(
ax25o
==
ax25
)
continue
;
...
...
@@ -106,7 +105,7 @@ void ax25_ds_enquiry_response(ax25_cb *ax25)
if
(
ax25o
->
state
!=
AX25_STATE_0
)
ax25_start_t3timer
(
ax25o
);
}
spin_unlock_
irqrestore
(
&
ax25_list_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_list_lock
);
}
void
ax25_ds_establish_data_link
(
ax25_cb
*
ax25
)
...
...
@@ -159,17 +158,16 @@ static void ax25_kiss_cmd(ax25_dev *ax25_dev, unsigned char cmd, unsigned char p
*/
static
int
ax25_check_dama_slave
(
ax25_dev
*
ax25_dev
)
{
unsigned
long
flags
;
ax25_cb
*
ax25
;
int
res
=
0
;
spin_lock_
irqsave
(
&
ax25_list_lock
,
flags
);
spin_lock_
bh
(
&
ax25_list_lock
);
for
(
ax25
=
ax25_list
;
ax25
!=
NULL
;
ax25
=
ax25
->
next
)
if
(
ax25
->
ax25_dev
==
ax25_dev
&&
(
ax25
->
condition
&
AX25_COND_DAMA_MODE
)
&&
ax25
->
state
>
AX25_STATE_1
)
{
res
=
1
;
break
;
}
spin_unlock_
irqrestore
(
&
ax25_list_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_list_lock
);
return
res
;
}
...
...
net/ax25/ax25_ds_timer.c
View file @
62fcaee9
...
...
@@ -73,7 +73,6 @@ void ax25_ds_set_timer(ax25_dev *ax25_dev)
static
void
ax25_ds_timeout
(
unsigned
long
arg
)
{
ax25_dev
*
ax25_dev
=
(
struct
ax25_dev
*
)
arg
;
unsigned
long
flags
;
ax25_cb
*
ax25
;
if
(
ax25_dev
==
NULL
||
!
ax25_dev
->
dama
.
slave
)
...
...
@@ -84,7 +83,7 @@ static void ax25_ds_timeout(unsigned long arg)
return
;
}
spin_lock_
irqsave
(
&
ax25_list_lock
,
flags
);
spin_lock_
bh
(
&
ax25_list_lock
);
for
(
ax25
=
ax25_list
;
ax25
!=
NULL
;
ax25
=
ax25
->
next
)
{
if
(
ax25
->
ax25_dev
!=
ax25_dev
||
!
(
ax25
->
condition
&
AX25_COND_DAMA_MODE
))
continue
;
...
...
@@ -92,7 +91,7 @@ static void ax25_ds_timeout(unsigned long arg)
ax25_send_control
(
ax25
,
AX25_DISC
,
AX25_POLLON
,
AX25_COMMAND
);
ax25_disconnect
(
ax25
,
ETIMEDOUT
);
}
spin_unlock_
irqrestore
(
&
ax25_list_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_list_lock
);
ax25_dev_dama_off
(
ax25_dev
);
}
...
...
net/ax25/ax25_iface.c
View file @
62fcaee9
...
...
@@ -109,17 +109,16 @@ void ax25_protocol_release(unsigned int pid)
int
ax25_linkfail_register
(
void
(
*
func
)(
ax25_cb
*
,
int
))
{
struct
linkfail_struct
*
linkfail
;
unsigned
long
flags
;
if
((
linkfail
=
kmalloc
(
sizeof
(
*
linkfail
),
GFP_ATOMIC
))
==
NULL
)
return
0
;
linkfail
->
func
=
func
;
spin_lock_
irqsave
(
&
linkfail_lock
,
flags
);
spin_lock_
bh
(
&
linkfail_lock
);
linkfail
->
next
=
linkfail_list
;
linkfail_list
=
linkfail
;
spin_unlock_
irqrestore
(
&
linkfail_lock
,
flags
);
spin_unlock_
bh
(
&
linkfail_lock
);
return
1
;
}
...
...
@@ -127,16 +126,15 @@ int ax25_linkfail_register(void (*func)(ax25_cb *, int))
void
ax25_linkfail_release
(
void
(
*
func
)(
ax25_cb
*
,
int
))
{
struct
linkfail_struct
*
s
,
*
linkfail
;
unsigned
long
flags
;
spin_lock_
irqsave
(
&
linkfail_lock
,
flags
);
spin_lock_
bh
(
&
linkfail_lock
);
linkfail
=
linkfail_list
;
if
(
linkfail
==
NULL
)
return
;
if
(
linkfail
->
func
==
func
)
{
linkfail_list
=
linkfail
->
next
;
spin_unlock_
irqrestore
(
&
linkfail_lock
,
flags
);
spin_unlock_
bh
(
&
linkfail_lock
);
kfree
(
linkfail
);
return
;
}
...
...
@@ -145,20 +143,19 @@ void ax25_linkfail_release(void (*func)(ax25_cb *, int))
if
(
linkfail
->
next
->
func
==
func
)
{
s
=
linkfail
->
next
;
linkfail
->
next
=
linkfail
->
next
->
next
;
spin_unlock_
irqrestore
(
&
linkfail_lock
,
flags
);
spin_unlock_
bh
(
&
linkfail_lock
);
kfree
(
s
);
return
;
}
linkfail
=
linkfail
->
next
;
}
spin_unlock_
irqrestore
(
&
linkfail_lock
,
flags
);
spin_unlock_
bh
(
&
linkfail_lock
);
}
int
ax25_listen_register
(
ax25_address
*
callsign
,
struct
net_device
*
dev
)
{
struct
listen_struct
*
listen
;
unsigned
long
flags
;
if
(
ax25_listen_mine
(
callsign
,
dev
))
return
0
;
...
...
@@ -169,10 +166,10 @@ int ax25_listen_register(ax25_address *callsign, struct net_device *dev)
listen
->
callsign
=
*
callsign
;
listen
->
dev
=
dev
;
spin_lock_
irqsave
(
&
listen_lock
,
flags
);
spin_lock_
bh
(
&
listen_lock
);
listen
->
next
=
listen_list
;
listen_list
=
listen
;
spin_unlock_
irqrestore
(
&
listen_lock
,
flags
);
spin_unlock_
bh
(
&
listen_lock
);
return
1
;
}
...
...
@@ -180,16 +177,15 @@ int ax25_listen_register(ax25_address *callsign, struct net_device *dev)
void
ax25_listen_release
(
ax25_address
*
callsign
,
struct
net_device
*
dev
)
{
struct
listen_struct
*
s
,
*
listen
;
unsigned
long
flags
;
spin_lock_
irqsave
(
&
listen_lock
,
flags
);
spin_lock_
bh
(
&
listen_lock
);
listen
=
listen_list
;
if
(
listen
==
NULL
)
return
;
if
(
ax25cmp
(
&
listen
->
callsign
,
callsign
)
==
0
&&
listen
->
dev
==
dev
)
{
listen_list
=
listen
->
next
;
spin_unlock_
irqrestore
(
&
listen_lock
,
flags
);
spin_unlock_
bh
(
&
listen_lock
);
kfree
(
listen
);
return
;
}
...
...
@@ -198,14 +194,14 @@ void ax25_listen_release(ax25_address *callsign, struct net_device *dev)
if
(
ax25cmp
(
&
listen
->
next
->
callsign
,
callsign
)
==
0
&&
listen
->
next
->
dev
==
dev
)
{
s
=
listen
->
next
;
listen
->
next
=
listen
->
next
->
next
;
spin_unlock_
irqrestore
(
&
listen_lock
,
flags
);
spin_unlock_
bh
(
&
listen_lock
);
kfree
(
s
);
return
;
}
listen
=
listen
->
next
;
}
spin_unlock_
irqrestore
(
&
listen_lock
,
flags
);
spin_unlock_
bh
(
&
listen_lock
);
}
int
(
*
ax25_protocol_function
(
unsigned
int
pid
))(
struct
sk_buff
*
,
ax25_cb
*
)
...
...
@@ -227,13 +223,12 @@ int (*ax25_protocol_function(unsigned int pid))(struct sk_buff *, ax25_cb *)
int
ax25_listen_mine
(
ax25_address
*
callsign
,
struct
net_device
*
dev
)
{
struct
listen_struct
*
listen
;
unsigned
long
flags
;
spin_lock_
irqsave
(
&
listen_lock
,
flags
);
spin_lock_
bh
(
&
listen_lock
);
for
(
listen
=
listen_list
;
listen
!=
NULL
;
listen
=
listen
->
next
)
if
(
ax25cmp
(
&
listen
->
callsign
,
callsign
)
==
0
&&
(
listen
->
dev
==
dev
||
listen
->
dev
==
NULL
))
return
1
;
spin_unlock_
irqrestore
(
&
listen_lock
,
flags
);
spin_unlock_
bh
(
&
listen_lock
);
return
0
;
}
...
...
@@ -241,12 +236,11 @@ int ax25_listen_mine(ax25_address *callsign, struct net_device *dev)
void
ax25_link_failed
(
ax25_cb
*
ax25
,
int
reason
)
{
struct
linkfail_struct
*
linkfail
;
unsigned
long
flags
;
spin_lock_
irqsave
(
&
linkfail_lock
,
flags
);
spin_lock_
bh
(
&
linkfail_lock
);
for
(
linkfail
=
linkfail_list
;
linkfail
!=
NULL
;
linkfail
=
linkfail
->
next
)
(
linkfail
->
func
)(
ax25
,
reason
);
spin_unlock_
irqrestore
(
&
linkfail_lock
,
flags
);
spin_unlock_
bh
(
&
linkfail_lock
);
}
int
ax25_protocol_is_registered
(
unsigned
int
pid
)
...
...
net/ax25/ax25_out.c
View file @
62fcaee9
...
...
@@ -115,7 +115,6 @@ void ax25_output(ax25_cb *ax25, int paclen, struct sk_buff *skb)
struct
sk_buff
*
skbn
;
unsigned
char
*
p
;
int
frontlen
,
len
,
fragno
,
ka9qfrag
,
first
=
1
;
long
flags
;
if
((
skb
->
len
-
1
)
>
paclen
)
{
if
(
*
skb
->
data
==
AX25_P_TEXT
)
{
...
...
@@ -132,9 +131,9 @@ void ax25_output(ax25_cb *ax25, int paclen, struct sk_buff *skb)
frontlen
=
skb_headroom
(
skb
);
/* Address space + CTRL */
while
(
skb
->
len
>
0
)
{
spin_lock_
irqsave
(
&
ax25_frag_lock
,
flags
);
spin_lock_
bh
(
&
ax25_frag_lock
);
if
((
skbn
=
alloc_skb
(
paclen
+
2
+
frontlen
,
GFP_ATOMIC
))
==
NULL
)
{
spin_unlock_
irqrestore
(
&
ax25_frag_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_frag_lock
);
printk
(
KERN_CRIT
"AX.25: ax25_output - out of memory
\n
"
);
return
;
}
...
...
@@ -142,7 +141,7 @@ void ax25_output(ax25_cb *ax25, int paclen, struct sk_buff *skb)
if
(
skb
->
sk
!=
NULL
)
skb_set_owner_w
(
skbn
,
skb
->
sk
);
spin_unlock_
irqrestore
(
&
ax25_frag_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_frag_lock
);
len
=
(
paclen
>
skb
->
len
)
?
skb
->
len
:
paclen
;
...
...
net/ax25/sysctl_net_ax25.c
View file @
62fcaee9
...
...
@@ -104,11 +104,10 @@ static const ctl_table ax25_param_table[] = {
void
ax25_register_sysctl
(
void
)
{
unsigned
long
flags
;
ax25_dev
*
ax25_dev
;
int
n
,
k
;
spin_lock_
irqsave
(
&
ax25_dev_lock
,
flags
);
spin_lock_
bh
(
&
ax25_dev_lock
);
for
(
ax25_table_size
=
sizeof
(
ctl_table
),
ax25_dev
=
ax25_dev_list
;
ax25_dev
!=
NULL
;
ax25_dev
=
ax25_dev
->
next
)
ax25_table_size
+=
sizeof
(
ctl_table
);
...
...
@@ -123,7 +122,7 @@ void ax25_register_sysctl(void)
while
(
n
--
)
kfree
(
ax25_table
[
n
].
child
);
kfree
(
ax25_table
);
spin_unlock_
irqrestore
(
&
ax25_dev_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_dev_lock
);
return
;
}
memcpy
(
child
,
ax25_param_table
,
sizeof
(
ax25_param_table
));
...
...
@@ -149,7 +148,7 @@ void ax25_register_sysctl(void)
n
++
;
}
spin_unlock_
irqrestore
(
&
ax25_dev_lock
,
flags
);
spin_unlock_
bh
(
&
ax25_dev_lock
);
ax25_dir_table
[
0
].
child
=
ax25_table
;
...
...
net/netrom/af_netrom.c
View file @
62fcaee9
...
...
@@ -99,27 +99,26 @@ decmod: MOD_DEC_USE_COUNT;
static
void
nr_remove_socket
(
struct
sock
*
sk
)
{
struct
sock
*
s
;
unsigned
long
flags
;
spin_lock_
irqsave
(
&
nr_list_lock
,
flags
);
spin_lock_
bh
(
&
nr_list_lock
);
if
((
s
=
nr_list
)
==
sk
)
{
nr_list
=
s
->
next
;
spin_unlock_
irqrestore
(
&
nr_list_lock
,
flags
);
spin_unlock_
bh
(
&
nr_list_lock
);
return
;
}
while
(
s
!=
NULL
&&
s
->
next
!=
NULL
)
{
if
(
s
->
next
==
sk
)
{
s
->
next
=
sk
->
next
;
spin_unlock_
irqrestore
(
&
nr_list_lock
,
flags
);
spin_unlock_
bh
(
&
nr_list_lock
);
return
;
}
s
=
s
->
next
;
}
spin_unlock_
irqrestore
(
&
nr_list_lock
,
flags
);
spin_unlock_
bh
(
&
nr_list_lock
);
}
/*
...
...
@@ -127,15 +126,14 @@ static void nr_remove_socket(struct sock *sk)
*/
static
void
nr_kill_by_device
(
struct
net_device
*
dev
)
{
unsigned
long
flags
;
struct
sock
*
s
;
spin_lock_
irqsave
(
&
nr_list_lock
,
flags
);
spin_lock_
bh
(
&
nr_list_lock
);
for
(
s
=
nr_list
;
s
!=
NULL
;
s
=
s
->
next
)
{
if
(
nr_sk
(
s
)
->
device
==
dev
)
nr_disconnect
(
s
,
ENETUNREACH
);
}
spin_unlock_
irqrestore
(
&
nr_list_lock
,
flags
);
spin_unlock_
bh
(
&
nr_list_lock
);
}
/*
...
...
@@ -159,12 +157,10 @@ static int nr_device_event(struct notifier_block *this, unsigned long event, voi
*/
static
void
nr_insert_socket
(
struct
sock
*
sk
)
{
unsigned
long
flags
;
spin_lock_irqsave
(
&
nr_list_lock
,
flags
);
spin_lock_bh
(
&
nr_list_lock
);
sk
->
next
=
nr_list
;
nr_list
=
sk
;
spin_unlock_
irqrestore
(
&
nr_list_lock
,
flags
);
spin_unlock_
bh
(
&
nr_list_lock
);
}
/*
...
...
@@ -173,18 +169,17 @@ static void nr_insert_socket(struct sock *sk)
*/
static
struct
sock
*
nr_find_listener
(
ax25_address
*
addr
)
{
unsigned
long
flags
;
struct
sock
*
s
;
spin_lock_
irqsave
(
&
nr_list_lock
,
flags
);
spin_lock_
bh
(
&
nr_list_lock
);
for
(
s
=
nr_list
;
s
!=
NULL
;
s
=
s
->
next
)
{
if
(
!
ax25cmp
(
&
nr_sk
(
s
)
->
source_addr
,
addr
)
&&
s
->
state
==
TCP_LISTEN
)
{
spin_unlock_
irqrestore
(
&
nr_list_lock
,
flags
);
spin_unlock_
bh
(
&
nr_list_lock
);
return
s
;
}
}
spin_unlock_
irqrestore
(
&
nr_list_lock
,
flags
);
spin_unlock_
bh
(
&
nr_list_lock
);
return
NULL
;
}
...
...
@@ -195,18 +190,17 @@ static struct sock *nr_find_listener(ax25_address *addr)
static
struct
sock
*
nr_find_socket
(
unsigned
char
index
,
unsigned
char
id
)
{
struct
sock
*
s
;
unsigned
long
flags
;
spin_lock_
irqsave
(
&
nr_list_lock
,
flags
);
spin_lock_
bh
(
&
nr_list_lock
);
for
(
s
=
nr_list
;
s
!=
NULL
;
s
=
s
->
next
)
{
nr_cb
*
nr
=
nr_sk
(
s
);
if
(
nr
->
my_index
==
index
&&
nr
->
my_id
==
id
)
{
spin_unlock_
irqrestore
(
&
nr_list_lock
,
flags
);
spin_unlock_
bh
(
&
nr_list_lock
);
return
s
;
}
}
spin_unlock_
irqrestore
(
&
nr_list_lock
,
flags
);
spin_unlock_
bh
(
&
nr_list_lock
);
return
NULL
;
}
...
...
@@ -217,20 +211,19 @@ static struct sock *nr_find_socket(unsigned char index, unsigned char id)
static
struct
sock
*
nr_find_peer
(
unsigned
char
index
,
unsigned
char
id
,
ax25_address
*
dest
)
{
unsigned
long
flags
;
struct
sock
*
s
;
spin_lock_
irqsave
(
&
nr_list_lock
,
flags
);
spin_lock_
bh
(
&
nr_list_lock
);
for
(
s
=
nr_list
;
s
!=
NULL
;
s
=
s
->
next
)
{
nr_cb
*
nr
=
nr_sk
(
s
);
if
(
nr
->
your_index
==
index
&&
nr
->
your_id
==
id
&&
!
ax25cmp
(
&
nr
->
dest_addr
,
dest
))
{
spin_unlock_
irqrestore
(
&
nr_list_lock
,
flags
);
spin_unlock_
bh
(
&
nr_list_lock
);
return
s
;
}
}
spin_unlock_
irqrestore
(
&
nr_list_lock
,
flags
);
spin_unlock_
bh
(
&
nr_list_lock
);
return
NULL
;
}
...
...
@@ -1164,7 +1157,6 @@ static int nr_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
static
int
nr_get_info
(
char
*
buffer
,
char
**
start
,
off_t
offset
,
int
length
)
{
unsigned
long
flags
;
struct
sock
*
s
;
struct
net_device
*
dev
;
const
char
*
devname
;
...
...
@@ -1172,7 +1164,7 @@ static int nr_get_info(char *buffer, char **start, off_t offset, int length)
off_t
pos
=
0
;
off_t
begin
=
0
;
spin_lock_
irqsave
(
&
nr_list_lock
,
flags
);
spin_lock_
bh
(
&
nr_list_lock
);
len
+=
sprintf
(
buffer
,
"user_addr dest_node src_node dev my your st vs vr va t1 t2 t4 idle n2 wnd Snd-Q Rcv-Q inode
\n
"
);
...
...
@@ -1225,7 +1217,7 @@ static int nr_get_info(char *buffer, char **start, off_t offset, int length)
break
;
}
spin_unlock_
irqrestore
(
&
nr_list_lock
,
flags
);
spin_unlock_
bh
(
&
nr_list_lock
);
*
start
=
buffer
+
(
offset
-
begin
);
len
-=
(
offset
-
begin
);
...
...
net/netrom/nr_route.c
View file @
62fcaee9
...
...
@@ -56,7 +56,6 @@ static int nr_add_node(ax25_address *nr, const char *mnemonic, ax25_address *ax2
struct
nr_node
*
nr_node
;
struct
nr_neigh
*
nr_neigh
;
struct
nr_route
nr_route
;
unsigned
long
flags
;
int
i
,
found
;
if
(
nr_dev_get
(
nr
)
!=
NULL
)
/* Can't add routes to ourself */
...
...
@@ -114,10 +113,10 @@ static int nr_add_node(ax25_address *nr, const char *mnemonic, ax25_address *ax2
memcpy
(
nr_neigh
->
digipeat
,
ax25_digi
,
sizeof
(
ax25_digi
));
}
spin_lock_
irqsave
(
&
nr_neigh_lock
,
flags
);
spin_lock_
bh
(
&
nr_neigh_lock
);
nr_neigh
->
next
=
nr_neigh_list
;
nr_neigh_list
=
nr_neigh
;
spin_unlock_
irqrestore
(
&
nr_neigh_lock
,
flags
);
spin_unlock_
bh
(
&
nr_neigh_lock
);
}
if
(
quality
!=
0
&&
ax25cmp
(
nr
,
ax25
)
==
0
&&
!
nr_neigh
->
locked
)
...
...
@@ -137,10 +136,10 @@ static int nr_add_node(ax25_address *nr, const char *mnemonic, ax25_address *ax2
nr_node
->
routes
[
0
].
obs_count
=
obs_count
;
nr_node
->
routes
[
0
].
neighbour
=
nr_neigh
;
spin_lock_
irqsave
(
&
nr_node_lock
,
flags
);
spin_lock_
bh
(
&
nr_node_lock
);
nr_node
->
next
=
nr_node_list
;
nr_node_list
=
nr_node
;
spin_unlock_
irqrestore
(
&
nr_node_lock
,
flags
);
spin_unlock_
bh
(
&
nr_node_lock
);
nr_neigh
->
count
++
;
...
...
@@ -250,12 +249,11 @@ static int nr_add_node(ax25_address *nr, const char *mnemonic, ax25_address *ax2
static
void
nr_remove_node
(
struct
nr_node
*
nr_node
)
{
struct
nr_node
*
s
;
unsigned
long
flags
;
spin_lock_
irqsave
(
&
nr_node_lock
,
flags
);
spin_lock_
bh
(
&
nr_node_lock
);
if
((
s
=
nr_node_list
)
==
nr_node
)
{
nr_node_list
=
nr_node
->
next
;
spin_unlock_
irqrestore
(
&
nr_node_lock
,
flags
);
spin_unlock_
bh
(
&
nr_node_lock
);
kfree
(
nr_node
);
return
;
}
...
...
@@ -263,7 +261,7 @@ static void nr_remove_node(struct nr_node *nr_node)
while
(
s
!=
NULL
&&
s
->
next
!=
NULL
)
{
if
(
s
->
next
==
nr_node
)
{
s
->
next
=
nr_node
->
next
;
spin_unlock_
irqrestore
(
&
nr_node_lock
,
flags
);
spin_unlock_
bh
(
&
nr_node_lock
);
kfree
(
nr_node
);
return
;
}
...
...
@@ -271,18 +269,17 @@ static void nr_remove_node(struct nr_node *nr_node)
s
=
s
->
next
;
}
spin_unlock_
irqrestore
(
&
nr_node_lock
,
flags
);
spin_unlock_
bh
(
&
nr_node_lock
);
}
static
void
nr_remove_neigh
(
struct
nr_neigh
*
nr_neigh
)
{
struct
nr_neigh
*
s
;
unsigned
long
flags
;
spin_lock_
irqsave
(
&
nr_neigh_lock
,
flags
);
spin_lock_
bh
(
&
nr_neigh_lock
);
if
((
s
=
nr_neigh_list
)
==
nr_neigh
)
{
nr_neigh_list
=
nr_neigh
->
next
;
spin_unlock_
irqrestore
(
&
nr_neigh_lock
,
flags
);
spin_unlock_
bh
(
&
nr_neigh_lock
);
if
(
nr_neigh
->
digipeat
!=
NULL
)
kfree
(
nr_neigh
->
digipeat
);
kfree
(
nr_neigh
);
...
...
@@ -292,7 +289,7 @@ static void nr_remove_neigh(struct nr_neigh *nr_neigh)
while
(
s
!=
NULL
&&
s
->
next
!=
NULL
)
{
if
(
s
->
next
==
nr_neigh
)
{
s
->
next
=
nr_neigh
->
next
;
spin_unlock_
irqrestore
(
&
nr_neigh_lock
,
flags
);
spin_unlock_
bh
(
&
nr_neigh_lock
);
if
(
nr_neigh
->
digipeat
!=
NULL
)
kfree
(
nr_neigh
->
digipeat
);
kfree
(
nr_neigh
);
...
...
@@ -301,7 +298,7 @@ static void nr_remove_neigh(struct nr_neigh *nr_neigh)
s
=
s
->
next
;
}
spin_unlock_
irqrestore
(
&
nr_neigh_lock
,
flags
);
spin_unlock_
bh
(
&
nr_neigh_lock
);
}
/*
...
...
@@ -363,7 +360,6 @@ static int nr_del_node(ax25_address *callsign, ax25_address *neighbour, struct n
static
int
nr_add_neigh
(
ax25_address
*
callsign
,
ax25_digi
*
ax25_digi
,
struct
net_device
*
dev
,
unsigned
int
quality
)
{
struct
nr_neigh
*
nr_neigh
;
unsigned
long
flags
;
for
(
nr_neigh
=
nr_neigh_list
;
nr_neigh
!=
NULL
;
nr_neigh
=
nr_neigh
->
next
)
{
if
(
ax25cmp
(
callsign
,
&
nr_neigh
->
callsign
)
==
0
&&
nr_neigh
->
dev
==
dev
)
{
...
...
@@ -394,10 +390,10 @@ static int nr_add_neigh(ax25_address *callsign, ax25_digi *ax25_digi, struct net
memcpy
(
nr_neigh
->
digipeat
,
ax25_digi
,
sizeof
(
ax25_digi
));
}
spin_lock_
irqsave
(
&
nr_neigh_lock
,
flags
);
spin_lock_
bh
(
&
nr_neigh_lock
);
nr_neigh
->
next
=
nr_neigh_list
;
nr_neigh_list
=
nr_neigh
;
spin_unlock_
irqrestore
(
&
nr_neigh_lock
,
flags
);
spin_unlock_
bh
(
&
nr_neigh_lock
);
return
0
;
}
...
...
@@ -738,13 +734,12 @@ int nr_route_frame(struct sk_buff *skb, ax25_cb *ax25)
int
nr_nodes_get_info
(
char
*
buffer
,
char
**
start
,
off_t
offset
,
int
length
)
{
struct
nr_node
*
nr_node
;
unsigned
long
flags
;
int
len
=
0
;
off_t
pos
=
0
;
off_t
begin
=
0
;
int
i
;
spin_lock_
irqsave
(
&
nr_node_lock
,
flags
);
spin_lock_
bh
(
&
nr_node_lock
);
len
+=
sprintf
(
buffer
,
"callsign mnemonic w n qual obs neigh qual obs neigh qual obs neigh
\n
"
);
for
(
nr_node
=
nr_node_list
;
nr_node
!=
NULL
;
nr_node
=
nr_node
->
next
)
{
...
...
@@ -773,7 +768,7 @@ int nr_nodes_get_info(char *buffer, char **start, off_t offset, int length)
if
(
pos
>
offset
+
length
)
break
;
}
spin_unlock_
irqrestore
(
&
nr_node_lock
,
flags
);
spin_unlock_
bh
(
&
nr_node_lock
);
*
start
=
buffer
+
(
offset
-
begin
);
len
-=
(
offset
-
begin
);
...
...
@@ -786,13 +781,12 @@ int nr_nodes_get_info(char *buffer, char **start, off_t offset, int length)
int
nr_neigh_get_info
(
char
*
buffer
,
char
**
start
,
off_t
offset
,
int
length
)
{
struct
nr_neigh
*
nr_neigh
;
unsigned
long
flags
;
int
len
=
0
;
off_t
pos
=
0
;
off_t
begin
=
0
;
int
i
;
spin_lock_
irqsave
(
&
nr_neigh_lock
,
flags
);
spin_lock_
bh
(
&
nr_neigh_lock
);
len
+=
sprintf
(
buffer
,
"addr callsign dev qual lock count failed digipeaters
\n
"
);
for
(
nr_neigh
=
nr_neigh_list
;
nr_neigh
!=
NULL
;
nr_neigh
=
nr_neigh
->
next
)
{
...
...
@@ -823,7 +817,7 @@ int nr_neigh_get_info(char *buffer, char **start, off_t offset, int length)
break
;
}
spin_unlock_
irqrestore
(
&
nr_neigh_lock
,
flags
);
spin_unlock_
bh
(
&
nr_neigh_lock
);
*
start
=
buffer
+
(
offset
-
begin
);
len
-=
(
offset
-
begin
);
...
...
net/rose/af_rose.c
View file @
62fcaee9
...
...
@@ -160,25 +160,24 @@ decmod: MOD_DEC_USE_COUNT;
static
void
rose_remove_socket
(
struct
sock
*
sk
)
{
struct
sock
*
s
;
unsigned
long
flags
;
spin_lock_
irqsave
(
&
rose_list_lock
,
flags
);
spin_lock_
bh
(
&
rose_list_lock
);
if
((
s
=
rose_list
)
==
sk
)
{
rose_list
=
s
->
next
;
spin_unlock_
irqrestore
(
&
rose_list_lock
,
flags
);
spin_unlock_
bh
(
&
rose_list_lock
);
return
;
}
while
(
s
!=
NULL
&&
s
->
next
!=
NULL
)
{
if
(
s
->
next
==
sk
)
{
s
->
next
=
sk
->
next
;
spin_unlock_
irqrestore
(
&
rose_list_lock
,
flags
);
spin_unlock_
bh
(
&
rose_list_lock
);
return
;
}
s
=
s
->
next
;
}
spin_unlock_
irqrestore
(
&
rose_list_lock
,
flags
);
spin_unlock_
bh
(
&
rose_list_lock
);
}
/*
...
...
@@ -187,10 +186,9 @@ static void rose_remove_socket(struct sock *sk)
*/
void
rose_kill_by_neigh
(
struct
rose_neigh
*
neigh
)
{
unsigned
long
flags
;
struct
sock
*
s
;
spin_lock_
irqsave
(
&
rose_list_lock
,
flags
);
spin_lock_
bh
(
&
rose_list_lock
);
for
(
s
=
rose_list
;
s
!=
NULL
;
s
=
s
->
next
)
{
rose_cb
*
rose
=
rose_sk
(
s
);
...
...
@@ -200,7 +198,7 @@ void rose_kill_by_neigh(struct rose_neigh *neigh)
rose
->
neighbour
=
NULL
;
}
}
spin_unlock_
irqrestore
(
&
rose_list_lock
,
flags
);
spin_unlock_
bh
(
&
rose_list_lock
);
}
/*
...
...
@@ -208,10 +206,9 @@ void rose_kill_by_neigh(struct rose_neigh *neigh)
*/
static
void
rose_kill_by_device
(
struct
net_device
*
dev
)
{
unsigned
long
flags
;
struct
sock
*
s
;
spin_lock_
irqsave
(
&
rose_list_lock
,
flags
);
spin_lock_
bh
(
&
rose_list_lock
);
for
(
s
=
rose_list
;
s
!=
NULL
;
s
=
s
->
next
)
{
rose_cb
*
rose
=
rose_sk
(
s
);
...
...
@@ -221,7 +218,7 @@ static void rose_kill_by_device(struct net_device *dev)
rose
->
device
=
NULL
;
}
}
spin_unlock_
irqrestore
(
&
rose_list_lock
,
flags
);
spin_unlock_
bh
(
&
rose_list_lock
);
}
/*
...
...
@@ -253,12 +250,11 @@ static int rose_device_event(struct notifier_block *this, unsigned long event,
*/
static
void
rose_insert_socket
(
struct
sock
*
sk
)
{
unsigned
long
flags
;
spin_lock_
irqsave
(
&
rose_list_lock
,
flags
);
spin_lock_
bh
(
&
rose_list_lock
);
sk
->
next
=
rose_list
;
rose_list
=
sk
;
spin_unlock_
irqrestore
(
&
rose_list_lock
,
flags
);
spin_unlock_
bh
(
&
rose_list_lock
);
}
/*
...
...
@@ -267,17 +263,16 @@ static void rose_insert_socket(struct sock *sk)
*/
static
struct
sock
*
rose_find_listener
(
rose_address
*
addr
,
ax25_address
*
call
)
{
unsigned
long
flags
;
struct
sock
*
s
;
spin_lock_
irqsave
(
&
rose_list_lock
,
flags
);
spin_lock_
bh
(
&
rose_list_lock
);
for
(
s
=
rose_list
;
s
!=
NULL
;
s
=
s
->
next
)
{
rose_cb
*
rose
=
rose_sk
(
s
);
if
(
!
rosecmp
(
&
rose
->
source_addr
,
addr
)
&&
!
ax25cmp
(
&
rose
->
source_call
,
call
)
&&
!
rose
->
source_ndigis
&&
s
->
state
==
TCP_LISTEN
)
{
spin_unlock_
irqrestore
(
&
rose_list_lock
,
flags
);
spin_unlock_
bh
(
&
rose_list_lock
);
return
s
;
}
}
...
...
@@ -288,11 +283,11 @@ static struct sock *rose_find_listener(rose_address *addr, ax25_address *call)
if
(
!
rosecmp
(
&
rose
->
source_addr
,
addr
)
&&
!
ax25cmp
(
&
rose
->
source_call
,
&
null_ax25_address
)
&&
s
->
state
==
TCP_LISTEN
)
{
spin_unlock_
irqrestore
(
&
rose_list_lock
,
flags
);
spin_unlock_
bh
(
&
rose_list_lock
);
return
s
;
}
}
spin_unlock_
irqrestore
(
&
rose_list_lock
,
flags
);
spin_unlock_
bh
(
&
rose_list_lock
);
return
NULL
;
}
...
...
@@ -302,19 +297,18 @@ static struct sock *rose_find_listener(rose_address *addr, ax25_address *call)
*/
struct
sock
*
rose_find_socket
(
unsigned
int
lci
,
struct
rose_neigh
*
neigh
)
{
unsigned
long
flags
;
struct
sock
*
s
;
spin_lock_
irqsave
(
&
rose_list_lock
,
flags
);
spin_lock_
bh
(
&
rose_list_lock
);
for
(
s
=
rose_list
;
s
!=
NULL
;
s
=
s
->
next
)
{
rose_cb
*
rose
=
rose_sk
(
s
);
if
(
rose
->
lci
==
lci
&&
rose
->
neighbour
==
neigh
)
{
spin_unlock_
irqrestore
(
&
rose_list_lock
,
flags
);
spin_unlock_
bh
(
&
rose_list_lock
);
return
s
;
}
}
spin_unlock_
irqrestore
(
&
rose_list_lock
,
flags
);
spin_unlock_
bh
(
&
rose_list_lock
);
return
NULL
;
}
...
...
@@ -1362,7 +1356,6 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
static
int
rose_get_info
(
char
*
buffer
,
char
**
start
,
off_t
offset
,
int
length
)
{
unsigned
long
flags
;
struct
sock
*
s
;
struct
net_device
*
dev
;
const
char
*
devname
,
*
callsign
;
...
...
@@ -1370,7 +1363,7 @@ static int rose_get_info(char *buffer, char **start, off_t offset, int length)
off_t
pos
=
0
;
off_t
begin
=
0
;
spin_lock_
irqsave
(
&
rose_list_lock
,
flags
);
spin_lock_
bh
(
&
rose_list_lock
);
len
+=
sprintf
(
buffer
,
"dest_addr dest_call src_addr src_call dev lci neigh st vs vr va t t1 t2 t3 hb idle Snd-Q Rcv-Q inode
\n
"
);
...
...
@@ -1422,7 +1415,7 @@ static int rose_get_info(char *buffer, char **start, off_t offset, int length)
if
(
pos
>
offset
+
length
)
break
;
}
spin_unlock_
irqrestore
(
&
rose_list_lock
,
flags
);
spin_unlock_
bh
(
&
rose_list_lock
);
*
start
=
buffer
+
(
offset
-
begin
);
len
-=
(
offset
-
begin
);
...
...
net/rose/rose_route.c
View file @
62fcaee9
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment