git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.5.x5
[linux-2.6.git]
/
net
/
sctp
/
protocol.c
diff --git
a/net/sctp/protocol.c
b/net/sctp/protocol.c
index
191682b
..
c1ee92a
100644
(file)
--- a/
net/sctp/protocol.c
+++ b/
net/sctp/protocol.c
@@
-65,7
+65,7
@@
struct proc_dir_entry *proc_net_sctp;
DEFINE_SNMP_STAT(struct sctp_mib, sctp_statistics);
struct idr sctp_assocs_id;
DEFINE_SNMP_STAT(struct sctp_mib, sctp_statistics);
struct idr sctp_assocs_id;
-
spinlock_t sctp_assocs_id_lock = SPIN_LOCK_UNLOCKED
;
+
DEFINE_SPINLOCK(sctp_assocs_id_lock)
;
/* This is the global socket data structure used for responding to
* the Out-of-the-blue (OOTB) packets. A control sock will be created
/* This is the global socket data structure used for responding to
* the Out-of-the-blue (OOTB) packets. A control sock will be created
@@
-95,7
+95,7
@@
struct sock *sctp_get_ctl_sock(void)
}
/* Set up the proc fs entry for the SCTP protocol. */
}
/* Set up the proc fs entry for the SCTP protocol. */
-__init int sctp_proc_init(void)
+
static
__init int sctp_proc_init(void)
{
if (!proc_net_sctp) {
struct proc_dir_entry *ent;
{
if (!proc_net_sctp) {
struct proc_dir_entry *ent;
@@
-124,7
+124,7
@@
out_nomem:
* Note: Do not make this __exit as it is used in the init error
* path.
*/
* Note: Do not make this __exit as it is used in the init error
* path.
*/
-void sctp_proc_exit(void)
+
static
void sctp_proc_exit(void)
{
sctp_snmp_proc_exit();
sctp_eps_proc_exit();
{
sctp_snmp_proc_exit();
sctp_eps_proc_exit();
@@
-364,7
+364,7
@@
static int sctp_v4_is_any(const union sctp_addr *addr)
* Return 0 - If the address is a non-unicast or an illegal address.
* Return 1 - If the address is a unicast.
*/
* Return 0 - If the address is a non-unicast or an illegal address.
* Return 1 - If the address is a unicast.
*/
-static int sctp_v4_addr_valid(union sctp_addr *addr, struct sctp_
opt
*sp)
+static int sctp_v4_addr_valid(union sctp_addr *addr, struct sctp_
sock
*sp)
{
/* Is this a non-unicast address or a unusable SCTP address? */
if (IS_IPV4_UNUSABLE_ADDRESS(&addr->v4.sin_addr.s_addr))
{
/* Is this a non-unicast address or a unusable SCTP address? */
if (IS_IPV4_UNUSABLE_ADDRESS(&addr->v4.sin_addr.s_addr))
@@
-374,7
+374,7
@@
static int sctp_v4_addr_valid(union sctp_addr *addr, struct sctp_opt *sp)
}
/* Should this be available for binding? */
}
/* Should this be available for binding? */
-static int sctp_v4_available(union sctp_addr *addr, struct sctp_
opt
*sp)
+static int sctp_v4_available(union sctp_addr *addr, struct sctp_
sock
*sp)
{
int ret = inet_addr_type(addr->v4.sin_addr.s_addr);
{
int ret = inet_addr_type(addr->v4.sin_addr.s_addr);
@@
-428,9
+428,9
@@
static sctp_scope_t sctp_v4_scope(union sctp_addr *addr)
* addresses. If an association is passed, trys to get a dst entry with a
* source address that matches an address in the bind address list.
*/
* addresses. If an association is passed, trys to get a dst entry with a
* source address that matches an address in the bind address list.
*/
-struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
- union sctp_addr *daddr,
- union sctp_addr *saddr)
+st
atic st
ruct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
+
union sctp_addr *daddr,
+
union sctp_addr *saddr)
{
struct rtable *rt;
struct flowi fl;
{
struct rtable *rt;
struct flowi fl;
@@
-520,10
+520,10
@@
out:
/* For v4, the source address is cached in the route entry(dst). So no need
* to cache it separately and hence this is an empty routine.
*/
/* For v4, the source address is cached in the route entry(dst). So no need
* to cache it separately and hence this is an empty routine.
*/
-void sctp_v4_get_saddr(struct sctp_association *asoc,
- struct dst_entry *dst,
- union sctp_addr *daddr,
- union sctp_addr *saddr)
+
static
void sctp_v4_get_saddr(struct sctp_association *asoc,
+
struct dst_entry *dst,
+
union sctp_addr *daddr,
+
union sctp_addr *saddr)
{
struct rtable *rt = (struct rtable *)dst;
{
struct rtable *rt = (struct rtable *)dst;
@@
-547,12
+547,12
@@
static int sctp_v4_is_ce(const struct sk_buff *skb)
}
/* Create and initialize a new sk for the socket returned by accept(). */
}
/* Create and initialize a new sk for the socket returned by accept(). */
-struct sock *sctp_v4_create_accept_sk(struct sock *sk,
- struct sctp_association *asoc)
+st
atic st
ruct sock *sctp_v4_create_accept_sk(struct sock *sk,
+
struct sctp_association *asoc)
{
struct sock *newsk;
{
struct sock *newsk;
- struct inet_
opt
*inet = inet_sk(sk);
- struct inet_
opt
*newinet;
+ struct inet_
sock
*inet = inet_sk(sk);
+ struct inet_
sock
*newinet;
newsk = sk_alloc(PF_INET, GFP_KERNEL, sk->sk_prot->slab_obj_size,
sk->sk_prot->slab);
newsk = sk_alloc(PF_INET, GFP_KERNEL, sk->sk_prot->slab_obj_size,
sk->sk_prot->slab);
@@
-608,7
+608,7
@@
out:
}
/* Map address, empty for v4 family */
}
/* Map address, empty for v4 family */
-static void sctp_v4_addr_v4map(struct sctp_
opt
*sp, union sctp_addr *addr)
+static void sctp_v4_addr_v4map(struct sctp_
sock
*sp, union sctp_addr *addr)
{
/* Empty */
}
{
/* Empty */
}
@@
-622,8
+622,8
@@
static void sctp_v4_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr)
/* Event handler for inet address addition/deletion events.
* Basically, whenever there is an event, we re-build our local address list.
*/
/* Event handler for inet address addition/deletion events.
* Basically, whenever there is an event, we re-build our local address list.
*/
-
static
int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
-
void *ptr)
+int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
+ void *ptr)
{
unsigned long flags;
{
unsigned long flags;
@@
-639,7
+639,7
@@
static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
* Initialize the control inode/socket with a control endpoint data
* structure. This endpoint is reserved exclusively for the OOTB processing.
*/
* Initialize the control inode/socket with a control endpoint data
* structure. This endpoint is reserved exclusively for the OOTB processing.
*/
-int sctp_ctl_sock_init(void)
+
static
int sctp_ctl_sock_init(void)
{
int err;
sa_family_t family;
{
int err;
sa_family_t family;
@@
-745,7
+745,7
@@
static void sctp_inet_skb_msgname(struct sk_buff *skb, char *msgname, int *len)
}
/* Do we support this AF? */
}
/* Do we support this AF? */
-static int sctp_inet_af_supported(sa_family_t family, struct sctp_
opt
*sp)
+static int sctp_inet_af_supported(sa_family_t family, struct sctp_
sock
*sp)
{
/* PF_INET only supports AF_INET addresses. */
return (AF_INET == family);
{
/* PF_INET only supports AF_INET addresses. */
return (AF_INET == family);
@@
-754,7
+754,7
@@
static int sctp_inet_af_supported(sa_family_t family, struct sctp_opt *sp)
/* Address matching with wildcards allowed. */
static int sctp_inet_cmp_addr(const union sctp_addr *addr1,
const union sctp_addr *addr2,
/* Address matching with wildcards allowed. */
static int sctp_inet_cmp_addr(const union sctp_addr *addr1,
const union sctp_addr *addr2,
- struct sctp_
opt
*opt)
+ struct sctp_
sock
*opt)
{
/* PF_INET only supports AF_INET addresses. */
if (addr1->sa.sa_family != addr2->sa.sa_family)
{
/* PF_INET only supports AF_INET addresses. */
if (addr1->sa.sa_family != addr2->sa.sa_family)
@@
-771,7
+771,7
@@
static int sctp_inet_cmp_addr(const union sctp_addr *addr1,
/* Verify that provided sockaddr looks bindable. Common verification has
* already been taken care of.
*/
/* Verify that provided sockaddr looks bindable. Common verification has
* already been taken care of.
*/
-static int sctp_inet_bind_verify(struct sctp_
opt
*opt, union sctp_addr *addr)
+static int sctp_inet_bind_verify(struct sctp_
sock
*opt, union sctp_addr *addr)
{
return sctp_v4_available(addr, opt);
}
{
return sctp_v4_available(addr, opt);
}
@@
-779,7
+779,7
@@
static int sctp_inet_bind_verify(struct sctp_opt *opt, union sctp_addr *addr)
/* Verify that sockaddr looks sendable. Common verification has already
* been taken care of.
*/
/* Verify that sockaddr looks sendable. Common verification has already
* been taken care of.
*/
-static int sctp_inet_send_verify(struct sctp_
opt
*opt, union sctp_addr *addr)
+static int sctp_inet_send_verify(struct sctp_
sock
*opt, union sctp_addr *addr)
{
return 1;
}
{
return 1;
}
@@
-787,7
+787,7
@@
static int sctp_inet_send_verify(struct sctp_opt *opt, union sctp_addr *addr)
/* Fill in Supported Address Type information for INIT and INIT-ACK
* chunks. Returns number of addresses supported.
*/
/* Fill in Supported Address Type information for INIT and INIT-ACK
* chunks. Returns number of addresses supported.
*/
-static int sctp_inet_supported_addrs(const struct sctp_
opt
*opt,
+static int sctp_inet_supported_addrs(const struct sctp_
sock
*opt,
__u16 *types)
{
types[0] = SCTP_PARAM_IPV4_ADDRESS;
__u16 *types)
{
types[0] = SCTP_PARAM_IPV4_ADDRESS;
@@
-808,7
+808,7
@@
static inline int sctp_v4_xmit(struct sk_buff *skb,
return ip_queue_xmit(skb, ipfragok);
}
return ip_queue_xmit(skb, ipfragok);
}
-struct sctp_af sctp_ipv4_specific;
+st
atic st
ruct sctp_af sctp_ipv4_specific;
static struct sctp_pf sctp_pf_inet = {
.event_msgname = sctp_inet_event_msgname,
static struct sctp_pf sctp_pf_inet = {
.event_msgname = sctp_inet_event_msgname,
@@
-824,12
+824,12
@@
static struct sctp_pf sctp_pf_inet = {
};
/* Notifier for inetaddr addition/deletion events. */
};
/* Notifier for inetaddr addition/deletion events. */
-struct notifier_block sctp_inetaddr_notifier = {
+st
atic st
ruct notifier_block sctp_inetaddr_notifier = {
.notifier_call = sctp_inetaddr_event,
};
/* Socket operations. */
.notifier_call = sctp_inetaddr_event,
};
/* Socket operations. */
-struct proto_ops inet_seqpacket_ops = {
+st
atic st
ruct proto_ops inet_seqpacket_ops = {
.family = PF_INET,
.owner = THIS_MODULE,
.release = inet_release, /* Needs to be wrapped... */
.family = PF_INET,
.owner = THIS_MODULE,
.release = inet_release, /* Needs to be wrapped... */
@@
-878,7
+878,7
@@
static struct net_protocol sctp_protocol = {
};
/* IPv4 address related functions. */
};
/* IPv4 address related functions. */
-struct sctp_af sctp_ipv4_specific = {
+st
atic st
ruct sctp_af sctp_ipv4_specific = {
.sctp_xmit = sctp_v4_xmit,
.setsockopt = ip_setsockopt,
.getsockopt = ip_getsockopt,
.sctp_xmit = sctp_v4_xmit,
.setsockopt = ip_setsockopt,
.getsockopt = ip_getsockopt,
@@
-959,7
+959,7
@@
static void cleanup_sctp_mibs(void)
}
/* Initialize the universe into something sensible. */
}
/* Initialize the universe into something sensible. */
-__init int sctp_init(void)
+
SCTP_STATIC
__init int sctp_init(void)
{
int i;
int status = -EINVAL;
{
int i;
int status = -EINVAL;
@@
-1084,7
+1084,7
@@
__init int sctp_init(void)
goto err_ahash_alloc;
}
for (i = 0; i < sctp_assoc_hashsize; i++) {
goto err_ahash_alloc;
}
for (i = 0; i < sctp_assoc_hashsize; i++) {
-
sctp_assoc_hashtable[i].lock = RW_LOCK_UNLOCKED
;
+
rwlock_init(&sctp_assoc_hashtable[i].lock)
;
sctp_assoc_hashtable[i].chain = NULL;
}
sctp_assoc_hashtable[i].chain = NULL;
}
@@
-1098,7
+1098,7
@@
__init int sctp_init(void)
goto err_ehash_alloc;
}
for (i = 0; i < sctp_ep_hashsize; i++) {
goto err_ehash_alloc;
}
for (i = 0; i < sctp_ep_hashsize; i++) {
-
sctp_ep_hashtable[i].lock = RW_LOCK_UNLOCKED
;
+
rwlock_init(&sctp_ep_hashtable[i].lock)
;
sctp_ep_hashtable[i].chain = NULL;
}
sctp_ep_hashtable[i].chain = NULL;
}
@@
-1117,11
+1117,11
@@
__init int sctp_init(void)
goto err_bhash_alloc;
}
for (i = 0; i < sctp_port_hashsize; i++) {
goto err_bhash_alloc;
}
for (i = 0; i < sctp_port_hashsize; i++) {
- s
ctp_port_hashtable[i].lock = SPIN_LOCK_UNLOCKED
;
+ s
pin_lock_init(&sctp_port_hashtable[i].lock)
;
sctp_port_hashtable[i].chain = NULL;
}
sctp_port_hashtable[i].chain = NULL;
}
- s
ctp_port_alloc_lock = SPIN_LOCK_UNLOCKED
;
+ s
pin_lock_init(&sctp_port_alloc_lock)
;
sctp_port_rover = sysctl_local_port_range[0] - 1;
printk(KERN_INFO "SCTP: Hash tables configured "
sctp_port_rover = sysctl_local_port_range[0] - 1;
printk(KERN_INFO "SCTP: Hash tables configured "
@@
-1152,7
+1152,7
@@
__init int sctp_init(void)
/* Initialize the local address list. */
INIT_LIST_HEAD(&sctp_local_addr_list);
/* Initialize the local address list. */
INIT_LIST_HEAD(&sctp_local_addr_list);
- s
ctp_local_addr_lock = SPIN_LOCK_UNLOCKED
;
+ s
pin_lock_init(&sctp_local_addr_lock)
;
/* Register notifier for inet address additions/deletions. */
register_inetaddr_notifier(&sctp_inetaddr_notifier);
/* Register notifier for inet address additions/deletions. */
register_inetaddr_notifier(&sctp_inetaddr_notifier);
@@
-1196,7
+1196,7
@@
err_bucket_cachep:
}
/* Exit handler for the SCTP protocol. */
}
/* Exit handler for the SCTP protocol. */
-__exit void sctp_exit(void)
+
SCTP_STATIC
__exit void sctp_exit(void)
{
/* BUG. This should probably do something useful like clean
* up all the remaining associations and all that memory.
{
/* BUG. This should probably do something useful like clean
* up all the remaining associations and all that memory.