aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Haley <brian.haley@hp.com>2008-06-14 20:04:49 -0400
committerDavid S. Miller <davem@davemloft.net>2008-06-14 20:04:49 -0400
commit7d06b2e053d2d536348e3a0f6bb02982a41bea37 (patch)
treeec6a5c3f448e84cd431a0397b9e2a87ca25aec17
parent4ae127d1b6c71f9240dd4245f240e6dd8fc98014 (diff)
net: change proto destroy method to return void
Change struct proto destroy function pointer to return void. Noticed by Al Viro. Signed-off-by: Brian Haley <brian.haley@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/sock.h2
-rw-r--r--include/net/tcp.h2
-rw-r--r--include/net/transp_v6.h2
-rw-r--r--net/dccp/dccp.h2
-rw-r--r--net/dccp/ipv6.c4
-rw-r--r--net/dccp/proto.c4
-rw-r--r--net/ipv4/raw.c3
-rw-r--r--net/ipv4/tcp_ipv4.c4
-rw-r--r--net/ipv4/udp.c3
-rw-r--r--net/ipv4/udp_impl.h2
-rw-r--r--net/ipv6/af_inet6.c4
-rw-r--r--net/ipv6/raw.c4
-rw-r--r--net/ipv6/tcp_ipv6.c4
-rw-r--r--net/ipv6/udp.c4
-rw-r--r--net/ipv6/udp_impl.h2
-rw-r--r--net/sctp/socket.c3
16 files changed, 19 insertions, 30 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index dc42b44c2aa1..0a80961a83c0 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -524,7 +524,7 @@ struct proto {
524 int (*ioctl)(struct sock *sk, int cmd, 524 int (*ioctl)(struct sock *sk, int cmd,
525 unsigned long arg); 525 unsigned long arg);
526 int (*init)(struct sock *sk); 526 int (*init)(struct sock *sk);
527 int (*destroy)(struct sock *sk); 527 void (*destroy)(struct sock *sk);
528 void (*shutdown)(struct sock *sk, int how); 528 void (*shutdown)(struct sock *sk, int how);
529 int (*setsockopt)(struct sock *sk, int level, 529 int (*setsockopt)(struct sock *sk, int level,
530 int optname, char __user *optval, 530 int optname, char __user *optval,
diff --git a/include/net/tcp.h b/include/net/tcp.h
index b5a1b9eb12e8..6b827cc6c52f 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1366,7 +1366,7 @@ extern void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo);
1366extern struct request_sock_ops tcp_request_sock_ops; 1366extern struct request_sock_ops tcp_request_sock_ops;
1367extern struct request_sock_ops tcp6_request_sock_ops; 1367extern struct request_sock_ops tcp6_request_sock_ops;
1368 1368
1369extern int tcp_v4_destroy_sock(struct sock *sk); 1369extern void tcp_v4_destroy_sock(struct sock *sk);
1370 1370
1371extern int tcp_v4_gso_send_check(struct sk_buff *skb); 1371extern int tcp_v4_gso_send_check(struct sk_buff *skb);
1372extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features); 1372extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features);
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
index 112934a3288d..876b6f2bb4fd 100644
--- a/include/net/transp_v6.h
+++ b/include/net/transp_v6.h
@@ -53,7 +53,7 @@ extern int datagram_send_ctl(struct net *net,
53 */ 53 */
54extern struct inet_connection_sock_af_ops ipv4_specific; 54extern struct inet_connection_sock_af_ops ipv4_specific;
55 55
56extern int inet6_destroy_sock(struct sock *sk); 56extern void inet6_destroy_sock(struct sock *sk);
57 57
58#endif 58#endif
59 59
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h
index f44d492d3b74..1b2cea244e12 100644
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -262,7 +262,7 @@ extern int dccp_rcv_established(struct sock *sk, struct sk_buff *skb,
262 const struct dccp_hdr *dh, const unsigned len); 262 const struct dccp_hdr *dh, const unsigned len);
263 263
264extern int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized); 264extern int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized);
265extern int dccp_destroy_sock(struct sock *sk); 265extern void dccp_destroy_sock(struct sock *sk);
266 266
267extern void dccp_close(struct sock *sk, long timeout); 267extern void dccp_close(struct sock *sk, long timeout);
268extern struct sk_buff *dccp_make_response(struct sock *sk, 268extern struct sk_buff *dccp_make_response(struct sock *sk,
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index f7fe2a572d7b..eec3c4717890 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -1091,10 +1091,10 @@ static int dccp_v6_init_sock(struct sock *sk)
1091 return err; 1091 return err;
1092} 1092}
1093 1093
1094static int dccp_v6_destroy_sock(struct sock *sk) 1094static void dccp_v6_destroy_sock(struct sock *sk)
1095{ 1095{
1096 dccp_destroy_sock(sk); 1096 dccp_destroy_sock(sk);
1097 return inet6_destroy_sock(sk); 1097 inet6_destroy_sock(sk);
1098} 1098}
1099 1099
1100static struct timewait_sock_ops dccp6_timewait_sock_ops = { 1100static struct timewait_sock_ops dccp6_timewait_sock_ops = {
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 9dfe2470962c..a0b56009611f 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -237,7 +237,7 @@ int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized)
237 237
238EXPORT_SYMBOL_GPL(dccp_init_sock); 238EXPORT_SYMBOL_GPL(dccp_init_sock);
239 239
240int dccp_destroy_sock(struct sock *sk) 240void dccp_destroy_sock(struct sock *sk)
241{ 241{
242 struct dccp_sock *dp = dccp_sk(sk); 242 struct dccp_sock *dp = dccp_sk(sk);
243 struct dccp_minisock *dmsk = dccp_msk(sk); 243 struct dccp_minisock *dmsk = dccp_msk(sk);
@@ -268,8 +268,6 @@ int dccp_destroy_sock(struct sock *sk)
268 268
269 /* clean up feature negotiation state */ 269 /* clean up feature negotiation state */
270 dccp_feat_clean(dmsk); 270 dccp_feat_clean(dmsk);
271
272 return 0;
273} 271}
274 272
275EXPORT_SYMBOL_GPL(dccp_destroy_sock); 273EXPORT_SYMBOL_GPL(dccp_destroy_sock);
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 1d0c97c8712d..36035a0c6dc2 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -606,12 +606,11 @@ static void raw_close(struct sock *sk, long timeout)
606 sk_common_release(sk); 606 sk_common_release(sk);
607} 607}
608 608
609static int raw_destroy(struct sock *sk) 609static void raw_destroy(struct sock *sk)
610{ 610{
611 lock_sock(sk); 611 lock_sock(sk);
612 ip_flush_pending_frames(sk); 612 ip_flush_pending_frames(sk);
613 release_sock(sk); 613 release_sock(sk);
614 return 0;
615} 614}
616 615
617/* This gets rid of all the nasties in af_inet. -DaveM */ 616/* This gets rid of all the nasties in af_inet. -DaveM */
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index b219a7a7cd08..64b385f65930 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1775,7 +1775,7 @@ static int tcp_v4_init_sock(struct sock *sk)
1775 return 0; 1775 return 0;
1776} 1776}
1777 1777
1778int tcp_v4_destroy_sock(struct sock *sk) 1778void tcp_v4_destroy_sock(struct sock *sk)
1779{ 1779{
1780 struct tcp_sock *tp = tcp_sk(sk); 1780 struct tcp_sock *tp = tcp_sk(sk);
1781 1781
@@ -1819,8 +1819,6 @@ int tcp_v4_destroy_sock(struct sock *sk)
1819 } 1819 }
1820 1820
1821 atomic_dec(&tcp_sockets_allocated); 1821 atomic_dec(&tcp_sockets_allocated);
1822
1823 return 0;
1824} 1822}
1825 1823
1826EXPORT_SYMBOL(tcp_v4_destroy_sock); 1824EXPORT_SYMBOL(tcp_v4_destroy_sock);
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 355e6d62d483..eba790dcd16b 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1253,12 +1253,11 @@ int udp_rcv(struct sk_buff *skb)
1253 return __udp4_lib_rcv(skb, udp_hash, IPPROTO_UDP); 1253 return __udp4_lib_rcv(skb, udp_hash, IPPROTO_UDP);
1254} 1254}
1255 1255
1256int udp_destroy_sock(struct sock *sk) 1256void udp_destroy_sock(struct sock *sk)
1257{ 1257{
1258 lock_sock(sk); 1258 lock_sock(sk);
1259 udp_flush_pending_frames(sk); 1259 udp_flush_pending_frames(sk);
1260 release_sock(sk); 1260 release_sock(sk);
1261 return 0;
1262} 1261}
1263 1262
1264/* 1263/*
diff --git a/net/ipv4/udp_impl.h b/net/ipv4/udp_impl.h
index 7288bf7977fb..2e9bad2fa1bc 100644
--- a/net/ipv4/udp_impl.h
+++ b/net/ipv4/udp_impl.h
@@ -26,7 +26,7 @@ extern int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
26extern int udp_sendpage(struct sock *sk, struct page *page, int offset, 26extern int udp_sendpage(struct sock *sk, struct page *page, int offset,
27 size_t size, int flags); 27 size_t size, int flags);
28extern int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb); 28extern int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb);
29extern int udp_destroy_sock(struct sock *sk); 29extern void udp_destroy_sock(struct sock *sk);
30 30
31#ifdef CONFIG_PROC_FS 31#ifdef CONFIG_PROC_FS
32extern int udp4_seq_show(struct seq_file *seq, void *v); 32extern int udp4_seq_show(struct seq_file *seq, void *v);
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 350457c761e6..3ce8d2f318c6 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -371,7 +371,7 @@ int inet6_release(struct socket *sock)
371 371
372EXPORT_SYMBOL(inet6_release); 372EXPORT_SYMBOL(inet6_release);
373 373
374int inet6_destroy_sock(struct sock *sk) 374void inet6_destroy_sock(struct sock *sk)
375{ 375{
376 struct ipv6_pinfo *np = inet6_sk(sk); 376 struct ipv6_pinfo *np = inet6_sk(sk);
377 struct sk_buff *skb; 377 struct sk_buff *skb;
@@ -389,8 +389,6 @@ int inet6_destroy_sock(struct sock *sk)
389 389
390 if ((opt = xchg(&np->opt, NULL)) != NULL) 390 if ((opt = xchg(&np->opt, NULL)) != NULL)
391 sock_kfree_s(sk, opt, opt->tot_len); 391 sock_kfree_s(sk, opt, opt->tot_len);
392
393 return 0;
394} 392}
395 393
396EXPORT_SYMBOL_GPL(inet6_destroy_sock); 394EXPORT_SYMBOL_GPL(inet6_destroy_sock);
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 70a57e45bf0e..456777d7a407 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -1162,13 +1162,13 @@ static void rawv6_close(struct sock *sk, long timeout)
1162 sk_common_release(sk); 1162 sk_common_release(sk);
1163} 1163}
1164 1164
1165static int raw6_destroy(struct sock *sk) 1165static void raw6_destroy(struct sock *sk)
1166{ 1166{
1167 lock_sock(sk); 1167 lock_sock(sk);
1168 ip6_flush_pending_frames(sk); 1168 ip6_flush_pending_frames(sk);
1169 release_sock(sk); 1169 release_sock(sk);
1170 1170
1171 return inet6_destroy_sock(sk); 1171 inet6_destroy_sock(sk);
1172} 1172}
1173 1173
1174static int rawv6_init_sk(struct sock *sk) 1174static int rawv6_init_sk(struct sock *sk)
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index ebed5d3adb82..daefc18d50a0 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1872,7 +1872,7 @@ static int tcp_v6_init_sock(struct sock *sk)
1872 return 0; 1872 return 0;
1873} 1873}
1874 1874
1875static int tcp_v6_destroy_sock(struct sock *sk) 1875static void tcp_v6_destroy_sock(struct sock *sk)
1876{ 1876{
1877#ifdef CONFIG_TCP_MD5SIG 1877#ifdef CONFIG_TCP_MD5SIG
1878 /* Clean up the MD5 key list */ 1878 /* Clean up the MD5 key list */
@@ -1880,7 +1880,7 @@ static int tcp_v6_destroy_sock(struct sock *sk)
1880 tcp_v6_clear_md5_list(sk); 1880 tcp_v6_clear_md5_list(sk);
1881#endif 1881#endif
1882 tcp_v4_destroy_sock(sk); 1882 tcp_v4_destroy_sock(sk);
1883 return inet6_destroy_sock(sk); 1883 inet6_destroy_sock(sk);
1884} 1884}
1885 1885
1886#ifdef CONFIG_PROC_FS 1886#ifdef CONFIG_PROC_FS
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index e0693fffc9bd..09687f7a8564 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -879,15 +879,13 @@ do_confirm:
879 goto out; 879 goto out;
880} 880}
881 881
882int udpv6_destroy_sock(struct sock *sk) 882void udpv6_destroy_sock(struct sock *sk)
883{ 883{
884 lock_sock(sk); 884 lock_sock(sk);
885 udp_v6_flush_pending_frames(sk); 885 udp_v6_flush_pending_frames(sk);
886 release_sock(sk); 886 release_sock(sk);
887 887
888 inet6_destroy_sock(sk); 888 inet6_destroy_sock(sk);
889
890 return 0;
891} 889}
892 890
893/* 891/*
diff --git a/net/ipv6/udp_impl.h b/net/ipv6/udp_impl.h
index 321b81a4d418..92dd7da766d8 100644
--- a/net/ipv6/udp_impl.h
+++ b/net/ipv6/udp_impl.h
@@ -29,7 +29,7 @@ extern int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk,
29 struct msghdr *msg, size_t len, 29 struct msghdr *msg, size_t len,
30 int noblock, int flags, int *addr_len); 30 int noblock, int flags, int *addr_len);
31extern int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb); 31extern int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb);
32extern int udpv6_destroy_sock(struct sock *sk); 32extern void udpv6_destroy_sock(struct sock *sk);
33 33
34#ifdef CONFIG_PROC_FS 34#ifdef CONFIG_PROC_FS
35extern int udp6_seq_show(struct seq_file *seq, void *v); 35extern int udp6_seq_show(struct seq_file *seq, void *v);
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 253e5ea7e1e8..f98650cc48d8 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -3588,7 +3588,7 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk)
3588} 3588}
3589 3589
3590/* Cleanup any SCTP per socket resources. */ 3590/* Cleanup any SCTP per socket resources. */
3591SCTP_STATIC int sctp_destroy_sock(struct sock *sk) 3591SCTP_STATIC void sctp_destroy_sock(struct sock *sk)
3592{ 3592{
3593 struct sctp_endpoint *ep; 3593 struct sctp_endpoint *ep;
3594 3594
@@ -3598,7 +3598,6 @@ SCTP_STATIC int sctp_destroy_sock(struct sock *sk)
3598 ep = sctp_sk(sk)->ep; 3598 ep = sctp_sk(sk)->ep;
3599 sctp_endpoint_free(ep); 3599 sctp_endpoint_free(ep);
3600 atomic_dec(&sctp_sockets_allocated); 3600 atomic_dec(&sctp_sockets_allocated);
3601 return 0;
3602} 3601}
3603 3602
3604/* API 4.1.7 shutdown() - TCP Style Syntax 3603/* API 4.1.7 shutdown() - TCP Style Syntax