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
c3e626e1
Commit
c3e626e1
authored
Oct 18, 2002
by
Steven Whitehouse
Committed by
David S. Miller
Oct 18, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Kill old sklist_foo interfaces.
parent
56951b54
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
98 deletions
+30
-98
include/net/sock.h
include/net/sock.h
+0
-4
net/core/sock.c
net/core/sock.c
+0
-88
net/econet/af_econet.c
net/econet/af_econet.c
+30
-2
net/netsyms.c
net/netsyms.c
+0
-4
No files found.
include/net/sock.h
View file @
c3e626e1
...
...
@@ -439,10 +439,6 @@ extern void sock_def_destruct(struct sock *);
/* Initialise core socket variables */
extern
void
sock_init_data
(
struct
socket
*
sock
,
struct
sock
*
sk
);
extern
void
sklist_remove_socket
(
struct
sock
**
list
,
struct
sock
*
sk
);
extern
void
sklist_insert_socket
(
struct
sock
**
list
,
struct
sock
*
sk
);
extern
void
sklist_destroy_socket
(
struct
sock
**
list
,
struct
sock
*
sk
);
#ifdef CONFIG_FILTER
/**
...
...
net/core/sock.c
View file @
c3e626e1
...
...
@@ -888,94 +888,6 @@ void __release_sock(struct sock *sk)
}
while
((
skb
=
sk
->
backlog
.
head
)
!=
NULL
);
}
/*
* Generic socket manager library. Most simpler socket families
* use this to manage their socket lists. At some point we should
* hash these. By making this generic we get the lot hashed for free.
*
* It is broken by design. All the protocols using it must be fixed. --ANK
*/
rwlock_t
net_big_sklist_lock
=
RW_LOCK_UNLOCKED
;
void
sklist_remove_socket
(
struct
sock
**
list
,
struct
sock
*
sk
)
{
struct
sock
*
s
;
write_lock_bh
(
&
net_big_sklist_lock
);
while
((
s
=
*
list
)
!=
NULL
)
{
if
(
s
==
sk
)
{
*
list
=
s
->
next
;
break
;
}
list
=
&
s
->
next
;
}
write_unlock_bh
(
&
net_big_sklist_lock
);
if
(
s
)
sock_put
(
s
);
}
void
sklist_insert_socket
(
struct
sock
**
list
,
struct
sock
*
sk
)
{
write_lock_bh
(
&
net_big_sklist_lock
);
sk
->
next
=
*
list
;
*
list
=
sk
;
sock_hold
(
sk
);
write_unlock_bh
(
&
net_big_sklist_lock
);
}
/*
* This is only called from user mode. Thus it protects itself against
* interrupt users but doesn't worry about being called during work.
* Once it is removed from the queue no interrupt or bottom half will
* touch it and we are (fairly 8-) ) safe.
*/
void
sklist_destroy_socket
(
struct
sock
**
list
,
struct
sock
*
sk
);
/*
* Handler for deferred kills.
*/
static
void
sklist_destroy_timer
(
unsigned
long
data
)
{
struct
sock
*
sk
=
(
struct
sock
*
)
data
;
sklist_destroy_socket
(
NULL
,
sk
);
}
/*
* Destroy a socket. We pass NULL for a list if we know the
* socket is not on a list.
*/
void
sklist_destroy_socket
(
struct
sock
**
list
,
struct
sock
*
sk
)
{
if
(
list
)
sklist_remove_socket
(
list
,
sk
);
skb_queue_purge
(
&
sk
->
receive_queue
);
if
(
atomic_read
(
&
sk
->
wmem_alloc
)
==
0
&&
atomic_read
(
&
sk
->
rmem_alloc
)
==
0
&&
sk
->
dead
)
{
sock_put
(
sk
);
}
else
{
/*
* Someone is using our buffers still.. defer
*/
init_timer
(
&
sk
->
timer
);
sk
->
timer
.
expires
=
jiffies
+
SOCK_DESTROY_TIME
;
sk
->
timer
.
function
=
sklist_destroy_timer
;
sk
->
timer
.
data
=
(
unsigned
long
)
sk
;
add_timer
(
&
sk
->
timer
);
}
}
/*
* Set of default routines for initialising struct proto_ops when
* the protocol does not support a particular function. In certain
...
...
net/econet/af_econet.c
View file @
c3e626e1
...
...
@@ -46,6 +46,7 @@
static
struct
proto_ops
econet_ops
;
static
struct
sock
*
econet_sklist
;
static
rwlock_t
econet_lock
=
RW_LOCK_UNLOCKED
;
/* Since there are only 256 possible network numbers (or fewer, depends
how you count) it makes sense to use a simple lookup table. */
...
...
@@ -92,6 +93,33 @@ struct ec_cb
#endif
};
static
void
econet_remove_socket
(
struct
sock
**
list
,
struct
sock
*
sk
)
{
struct
sock
*
s
;
write_lock_bh
(
&
econet_lock
);
while
((
s
=
*
list
)
!=
NULL
)
{
if
(
s
==
sk
)
{
*
list
=
s
->
next
;
break
;
}
list
=
&
s
->
next
;
}
write_unlock_bh
(
&
econet_lock
);
if
(
s
)
sock_put
(
s
);
}
static
void
econet_insert_socket
(
struct
sock
**
list
,
struct
sock
*
sk
)
{
write_lock_bh
(
&
econet_lock
);
sk
->
next
=
*
list
;
sock_hold
(
sk
);
write_unlock_bh
(
&
econet_lock
);
}
/*
* Pull a packet from our receive queue and hand it to the user.
* If necessary we block.
...
...
@@ -494,7 +522,7 @@ static int econet_release(struct socket *sock)
if
(
!
sk
)
return
0
;
sklis
t_remove_socket
(
&
econet_sklist
,
sk
);
econe
t_remove_socket
(
&
econet_sklist
,
sk
);
/*
* Now the socket is dead. No more input will appear.
...
...
@@ -557,7 +585,7 @@ static int econet_create(struct socket *sock, int protocol)
sk
->
family
=
PF_ECONET
;
eo
->
num
=
protocol
;
sklis
t_insert_socket
(
&
econet_sklist
,
sk
);
econe
t_insert_socket
(
&
econet_sklist
,
sk
);
return
(
0
);
out_free:
...
...
net/netsyms.c
View file @
c3e626e1
...
...
@@ -224,9 +224,6 @@ EXPORT_SYMBOL(dev_change_flags);
EXPORT_SYMBOL
(
vlan_ioctl_hook
);
#endif
EXPORT_SYMBOL
(
sklist_destroy_socket
);
EXPORT_SYMBOL
(
sklist_insert_socket
);
EXPORT_SYMBOL
(
scm_detach_fds
);
#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
...
...
@@ -434,7 +431,6 @@ EXPORT_SYMBOL(neigh_dump_info);
EXPORT_SYMBOL
(
dev_set_allmulti
);
EXPORT_SYMBOL
(
dev_set_promiscuity
);
EXPORT_SYMBOL
(
sklist_remove_socket
);
EXPORT_SYMBOL
(
rtnl_sem
);
EXPORT_SYMBOL
(
rtnl_lock
);
EXPORT_SYMBOL
(
rtnl_unlock
);
...
...
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