提交 7d06b2e0 编写于 作者: B Brian Haley 提交者: David S. Miller

net: change proto destroy method to return void

Change struct proto destroy function pointer to return void.  Noticed
by Al Viro.
Signed-off-by: NBrian Haley <brian.haley@hp.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4ae127d1
...@@ -524,7 +524,7 @@ struct proto { ...@@ -524,7 +524,7 @@ struct proto {
int (*ioctl)(struct sock *sk, int cmd, int (*ioctl)(struct sock *sk, int cmd,
unsigned long arg); unsigned long arg);
int (*init)(struct sock *sk); int (*init)(struct sock *sk);
int (*destroy)(struct sock *sk); void (*destroy)(struct sock *sk);
void (*shutdown)(struct sock *sk, int how); void (*shutdown)(struct sock *sk, int how);
int (*setsockopt)(struct sock *sk, int level, int (*setsockopt)(struct sock *sk, int level,
int optname, char __user *optval, int optname, char __user *optval,
......
...@@ -1366,7 +1366,7 @@ extern void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo); ...@@ -1366,7 +1366,7 @@ extern void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo);
extern struct request_sock_ops tcp_request_sock_ops; extern struct request_sock_ops tcp_request_sock_ops;
extern struct request_sock_ops tcp6_request_sock_ops; extern struct request_sock_ops tcp6_request_sock_ops;
extern int tcp_v4_destroy_sock(struct sock *sk); extern void tcp_v4_destroy_sock(struct sock *sk);
extern int tcp_v4_gso_send_check(struct sk_buff *skb); extern int tcp_v4_gso_send_check(struct sk_buff *skb);
extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features); extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features);
......
...@@ -53,7 +53,7 @@ extern int datagram_send_ctl(struct net *net, ...@@ -53,7 +53,7 @@ extern int datagram_send_ctl(struct net *net,
*/ */
extern struct inet_connection_sock_af_ops ipv4_specific; extern struct inet_connection_sock_af_ops ipv4_specific;
extern int inet6_destroy_sock(struct sock *sk); extern void inet6_destroy_sock(struct sock *sk);
#endif #endif
......
...@@ -262,7 +262,7 @@ extern int dccp_rcv_established(struct sock *sk, struct sk_buff *skb, ...@@ -262,7 +262,7 @@ extern int dccp_rcv_established(struct sock *sk, struct sk_buff *skb,
const struct dccp_hdr *dh, const unsigned len); const struct dccp_hdr *dh, const unsigned len);
extern int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized); extern int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized);
extern int dccp_destroy_sock(struct sock *sk); extern void dccp_destroy_sock(struct sock *sk);
extern void dccp_close(struct sock *sk, long timeout); extern void dccp_close(struct sock *sk, long timeout);
extern struct sk_buff *dccp_make_response(struct sock *sk, extern struct sk_buff *dccp_make_response(struct sock *sk,
......
...@@ -1091,10 +1091,10 @@ static int dccp_v6_init_sock(struct sock *sk) ...@@ -1091,10 +1091,10 @@ static int dccp_v6_init_sock(struct sock *sk)
return err; return err;
} }
static int dccp_v6_destroy_sock(struct sock *sk) static void dccp_v6_destroy_sock(struct sock *sk)
{ {
dccp_destroy_sock(sk); dccp_destroy_sock(sk);
return inet6_destroy_sock(sk); inet6_destroy_sock(sk);
} }
static struct timewait_sock_ops dccp6_timewait_sock_ops = { static struct timewait_sock_ops dccp6_timewait_sock_ops = {
......
...@@ -237,7 +237,7 @@ int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized) ...@@ -237,7 +237,7 @@ int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized)
EXPORT_SYMBOL_GPL(dccp_init_sock); EXPORT_SYMBOL_GPL(dccp_init_sock);
int dccp_destroy_sock(struct sock *sk) void dccp_destroy_sock(struct sock *sk)
{ {
struct dccp_sock *dp = dccp_sk(sk); struct dccp_sock *dp = dccp_sk(sk);
struct dccp_minisock *dmsk = dccp_msk(sk); struct dccp_minisock *dmsk = dccp_msk(sk);
...@@ -268,8 +268,6 @@ int dccp_destroy_sock(struct sock *sk) ...@@ -268,8 +268,6 @@ int dccp_destroy_sock(struct sock *sk)
/* clean up feature negotiation state */ /* clean up feature negotiation state */
dccp_feat_clean(dmsk); dccp_feat_clean(dmsk);
return 0;
} }
EXPORT_SYMBOL_GPL(dccp_destroy_sock); EXPORT_SYMBOL_GPL(dccp_destroy_sock);
......
...@@ -606,12 +606,11 @@ static void raw_close(struct sock *sk, long timeout) ...@@ -606,12 +606,11 @@ static void raw_close(struct sock *sk, long timeout)
sk_common_release(sk); sk_common_release(sk);
} }
static int raw_destroy(struct sock *sk) static void raw_destroy(struct sock *sk)
{ {
lock_sock(sk); lock_sock(sk);
ip_flush_pending_frames(sk); ip_flush_pending_frames(sk);
release_sock(sk); release_sock(sk);
return 0;
} }
/* This gets rid of all the nasties in af_inet. -DaveM */ /* This gets rid of all the nasties in af_inet. -DaveM */
......
...@@ -1775,7 +1775,7 @@ static int tcp_v4_init_sock(struct sock *sk) ...@@ -1775,7 +1775,7 @@ static int tcp_v4_init_sock(struct sock *sk)
return 0; return 0;
} }
int tcp_v4_destroy_sock(struct sock *sk) void tcp_v4_destroy_sock(struct sock *sk)
{ {
struct tcp_sock *tp = tcp_sk(sk); struct tcp_sock *tp = tcp_sk(sk);
...@@ -1819,8 +1819,6 @@ int tcp_v4_destroy_sock(struct sock *sk) ...@@ -1819,8 +1819,6 @@ int tcp_v4_destroy_sock(struct sock *sk)
} }
atomic_dec(&tcp_sockets_allocated); atomic_dec(&tcp_sockets_allocated);
return 0;
} }
EXPORT_SYMBOL(tcp_v4_destroy_sock); EXPORT_SYMBOL(tcp_v4_destroy_sock);
......
...@@ -1253,12 +1253,11 @@ int udp_rcv(struct sk_buff *skb) ...@@ -1253,12 +1253,11 @@ int udp_rcv(struct sk_buff *skb)
return __udp4_lib_rcv(skb, udp_hash, IPPROTO_UDP); return __udp4_lib_rcv(skb, udp_hash, IPPROTO_UDP);
} }
int udp_destroy_sock(struct sock *sk) void udp_destroy_sock(struct sock *sk)
{ {
lock_sock(sk); lock_sock(sk);
udp_flush_pending_frames(sk); udp_flush_pending_frames(sk);
release_sock(sk); release_sock(sk);
return 0;
} }
/* /*
......
...@@ -26,7 +26,7 @@ extern int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -26,7 +26,7 @@ extern int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
extern int udp_sendpage(struct sock *sk, struct page *page, int offset, extern int udp_sendpage(struct sock *sk, struct page *page, int offset,
size_t size, int flags); size_t size, int flags);
extern int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb); extern int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb);
extern int udp_destroy_sock(struct sock *sk); extern void udp_destroy_sock(struct sock *sk);
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
extern int udp4_seq_show(struct seq_file *seq, void *v); extern int udp4_seq_show(struct seq_file *seq, void *v);
......
...@@ -371,7 +371,7 @@ int inet6_release(struct socket *sock) ...@@ -371,7 +371,7 @@ int inet6_release(struct socket *sock)
EXPORT_SYMBOL(inet6_release); EXPORT_SYMBOL(inet6_release);
int inet6_destroy_sock(struct sock *sk) void inet6_destroy_sock(struct sock *sk)
{ {
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
struct sk_buff *skb; struct sk_buff *skb;
...@@ -389,8 +389,6 @@ int inet6_destroy_sock(struct sock *sk) ...@@ -389,8 +389,6 @@ int inet6_destroy_sock(struct sock *sk)
if ((opt = xchg(&np->opt, NULL)) != NULL) if ((opt = xchg(&np->opt, NULL)) != NULL)
sock_kfree_s(sk, opt, opt->tot_len); sock_kfree_s(sk, opt, opt->tot_len);
return 0;
} }
EXPORT_SYMBOL_GPL(inet6_destroy_sock); EXPORT_SYMBOL_GPL(inet6_destroy_sock);
......
...@@ -1162,13 +1162,13 @@ static void rawv6_close(struct sock *sk, long timeout) ...@@ -1162,13 +1162,13 @@ static void rawv6_close(struct sock *sk, long timeout)
sk_common_release(sk); sk_common_release(sk);
} }
static int raw6_destroy(struct sock *sk) static void raw6_destroy(struct sock *sk)
{ {
lock_sock(sk); lock_sock(sk);
ip6_flush_pending_frames(sk); ip6_flush_pending_frames(sk);
release_sock(sk); release_sock(sk);
return inet6_destroy_sock(sk); inet6_destroy_sock(sk);
} }
static int rawv6_init_sk(struct sock *sk) static int rawv6_init_sk(struct sock *sk)
......
...@@ -1872,7 +1872,7 @@ static int tcp_v6_init_sock(struct sock *sk) ...@@ -1872,7 +1872,7 @@ static int tcp_v6_init_sock(struct sock *sk)
return 0; return 0;
} }
static int tcp_v6_destroy_sock(struct sock *sk) static void tcp_v6_destroy_sock(struct sock *sk)
{ {
#ifdef CONFIG_TCP_MD5SIG #ifdef CONFIG_TCP_MD5SIG
/* Clean up the MD5 key list */ /* Clean up the MD5 key list */
...@@ -1880,7 +1880,7 @@ static int tcp_v6_destroy_sock(struct sock *sk) ...@@ -1880,7 +1880,7 @@ static int tcp_v6_destroy_sock(struct sock *sk)
tcp_v6_clear_md5_list(sk); tcp_v6_clear_md5_list(sk);
#endif #endif
tcp_v4_destroy_sock(sk); tcp_v4_destroy_sock(sk);
return inet6_destroy_sock(sk); inet6_destroy_sock(sk);
} }
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
......
...@@ -879,15 +879,13 @@ int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk, ...@@ -879,15 +879,13 @@ int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
goto out; goto out;
} }
int udpv6_destroy_sock(struct sock *sk) void udpv6_destroy_sock(struct sock *sk)
{ {
lock_sock(sk); lock_sock(sk);
udp_v6_flush_pending_frames(sk); udp_v6_flush_pending_frames(sk);
release_sock(sk); release_sock(sk);
inet6_destroy_sock(sk); inet6_destroy_sock(sk);
return 0;
} }
/* /*
......
...@@ -29,7 +29,7 @@ extern int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk, ...@@ -29,7 +29,7 @@ extern int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk,
struct msghdr *msg, size_t len, struct msghdr *msg, size_t len,
int noblock, int flags, int *addr_len); int noblock, int flags, int *addr_len);
extern int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb); extern int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb);
extern int udpv6_destroy_sock(struct sock *sk); extern void udpv6_destroy_sock(struct sock *sk);
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
extern int udp6_seq_show(struct seq_file *seq, void *v); extern int udp6_seq_show(struct seq_file *seq, void *v);
......
...@@ -3588,7 +3588,7 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk) ...@@ -3588,7 +3588,7 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk)
} }
/* Cleanup any SCTP per socket resources. */ /* Cleanup any SCTP per socket resources. */
SCTP_STATIC int sctp_destroy_sock(struct sock *sk) SCTP_STATIC void sctp_destroy_sock(struct sock *sk)
{ {
struct sctp_endpoint *ep; struct sctp_endpoint *ep;
...@@ -3598,7 +3598,6 @@ SCTP_STATIC int sctp_destroy_sock(struct sock *sk) ...@@ -3598,7 +3598,6 @@ SCTP_STATIC int sctp_destroy_sock(struct sock *sk)
ep = sctp_sk(sk)->ep; ep = sctp_sk(sk)->ep;
sctp_endpoint_free(ep); sctp_endpoint_free(ep);
atomic_dec(&sctp_sockets_allocated); atomic_dec(&sctp_sockets_allocated);
return 0;
} }
/* API 4.1.7 shutdown() - TCP Style Syntax /* API 4.1.7 shutdown() - TCP Style Syntax
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册