diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2006-03-21 01:48:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-21 01:48:35 -0500 |
commit | 543d9cfeec4d58ad3fd974db5531b06b6b95deb4 (patch) | |
tree | b5f79a92ec01b4a97f26d48cae11566498641822 /net/dccp | |
parent | f94691acf9df35d5cd828373e35391bdc4a3fde6 (diff) |
[NET]: Identation & other cleanups related to compat_[gs]etsockopt cset
No code changes, just tidying up, in some cases moving EXPORT_SYMBOLs
to just after the function exported, etc.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/ipv4.c | 72 | ||||
-rw-r--r-- | net/dccp/ipv6.c | 138 | ||||
-rw-r--r-- | net/dccp/proto.c | 9 |
3 files changed, 111 insertions, 108 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 8a33c8498d9c..29047995c695 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -986,20 +986,20 @@ do_time_wait: | |||
986 | } | 986 | } |
987 | 987 | ||
988 | static struct inet_connection_sock_af_ops dccp_ipv4_af_ops = { | 988 | static struct inet_connection_sock_af_ops dccp_ipv4_af_ops = { |
989 | .queue_xmit = ip_queue_xmit, | 989 | .queue_xmit = ip_queue_xmit, |
990 | .send_check = dccp_v4_send_check, | 990 | .send_check = dccp_v4_send_check, |
991 | .rebuild_header = inet_sk_rebuild_header, | 991 | .rebuild_header = inet_sk_rebuild_header, |
992 | .conn_request = dccp_v4_conn_request, | 992 | .conn_request = dccp_v4_conn_request, |
993 | .syn_recv_sock = dccp_v4_request_recv_sock, | 993 | .syn_recv_sock = dccp_v4_request_recv_sock, |
994 | .net_header_len = sizeof(struct iphdr), | 994 | .net_header_len = sizeof(struct iphdr), |
995 | .setsockopt = ip_setsockopt, | 995 | .setsockopt = ip_setsockopt, |
996 | .getsockopt = ip_getsockopt, | 996 | .getsockopt = ip_getsockopt, |
997 | .addr2sockaddr = inet_csk_addr2sockaddr, | ||
998 | .sockaddr_len = sizeof(struct sockaddr_in), | ||
997 | #ifdef CONFIG_COMPAT | 999 | #ifdef CONFIG_COMPAT |
998 | .compat_setsockopt = compat_ip_setsockopt, | 1000 | .compat_setsockopt = compat_ip_setsockopt, |
999 | .compat_getsockopt = compat_ip_getsockopt, | 1001 | .compat_getsockopt = compat_ip_getsockopt, |
1000 | #endif | 1002 | #endif |
1001 | .addr2sockaddr = inet_csk_addr2sockaddr, | ||
1002 | .sockaddr_len = sizeof(struct sockaddr_in), | ||
1003 | }; | 1003 | }; |
1004 | 1004 | ||
1005 | static int dccp_v4_init_sock(struct sock *sk) | 1005 | static int dccp_v4_init_sock(struct sock *sk) |
@@ -1044,10 +1044,6 @@ static struct proto dccp_v4_prot = { | |||
1044 | .init = dccp_v4_init_sock, | 1044 | .init = dccp_v4_init_sock, |
1045 | .setsockopt = dccp_setsockopt, | 1045 | .setsockopt = dccp_setsockopt, |
1046 | .getsockopt = dccp_getsockopt, | 1046 | .getsockopt = dccp_getsockopt, |
1047 | #ifdef CONFIG_COMPAT | ||
1048 | .compat_setsockopt = compat_dccp_setsockopt, | ||
1049 | .compat_getsockopt = compat_dccp_getsockopt, | ||
1050 | #endif | ||
1051 | .sendmsg = dccp_sendmsg, | 1047 | .sendmsg = dccp_sendmsg, |
1052 | .recvmsg = dccp_recvmsg, | 1048 | .recvmsg = dccp_recvmsg, |
1053 | .backlog_rcv = dccp_v4_do_rcv, | 1049 | .backlog_rcv = dccp_v4_do_rcv, |
@@ -1062,6 +1058,10 @@ static struct proto dccp_v4_prot = { | |||
1062 | .obj_size = sizeof(struct dccp_sock), | 1058 | .obj_size = sizeof(struct dccp_sock), |
1063 | .rsk_prot = &dccp_request_sock_ops, | 1059 | .rsk_prot = &dccp_request_sock_ops, |
1064 | .twsk_prot = &dccp_timewait_sock_ops, | 1060 | .twsk_prot = &dccp_timewait_sock_ops, |
1061 | #ifdef CONFIG_COMPAT | ||
1062 | .compat_setsockopt = compat_dccp_setsockopt, | ||
1063 | .compat_getsockopt = compat_dccp_getsockopt, | ||
1064 | #endif | ||
1065 | }; | 1065 | }; |
1066 | 1066 | ||
1067 | static struct net_protocol dccp_v4_protocol = { | 1067 | static struct net_protocol dccp_v4_protocol = { |
@@ -1071,30 +1071,30 @@ static struct net_protocol dccp_v4_protocol = { | |||
1071 | }; | 1071 | }; |
1072 | 1072 | ||
1073 | static const struct proto_ops inet_dccp_ops = { | 1073 | static const struct proto_ops inet_dccp_ops = { |
1074 | .family = PF_INET, | 1074 | .family = PF_INET, |
1075 | .owner = THIS_MODULE, | 1075 | .owner = THIS_MODULE, |
1076 | .release = inet_release, | 1076 | .release = inet_release, |
1077 | .bind = inet_bind, | 1077 | .bind = inet_bind, |
1078 | .connect = inet_stream_connect, | 1078 | .connect = inet_stream_connect, |
1079 | .socketpair = sock_no_socketpair, | 1079 | .socketpair = sock_no_socketpair, |
1080 | .accept = inet_accept, | 1080 | .accept = inet_accept, |
1081 | .getname = inet_getname, | 1081 | .getname = inet_getname, |
1082 | /* FIXME: work on tcp_poll to rename it to inet_csk_poll */ | 1082 | /* FIXME: work on tcp_poll to rename it to inet_csk_poll */ |
1083 | .poll = dccp_poll, | 1083 | .poll = dccp_poll, |
1084 | .ioctl = inet_ioctl, | 1084 | .ioctl = inet_ioctl, |
1085 | /* FIXME: work on inet_listen to rename it to sock_common_listen */ | 1085 | /* FIXME: work on inet_listen to rename it to sock_common_listen */ |
1086 | .listen = inet_dccp_listen, | 1086 | .listen = inet_dccp_listen, |
1087 | .shutdown = inet_shutdown, | 1087 | .shutdown = inet_shutdown, |
1088 | .setsockopt = sock_common_setsockopt, | 1088 | .setsockopt = sock_common_setsockopt, |
1089 | .getsockopt = sock_common_getsockopt, | 1089 | .getsockopt = sock_common_getsockopt, |
1090 | .sendmsg = inet_sendmsg, | ||
1091 | .recvmsg = sock_common_recvmsg, | ||
1092 | .mmap = sock_no_mmap, | ||
1093 | .sendpage = sock_no_sendpage, | ||
1090 | #ifdef CONFIG_COMPAT | 1094 | #ifdef CONFIG_COMPAT |
1091 | .compat_setsockopt = compat_sock_common_setsockopt, | 1095 | .compat_setsockopt = compat_sock_common_setsockopt, |
1092 | .compat_getsockopt = compat_sock_common_getsockopt, | 1096 | .compat_getsockopt = compat_sock_common_getsockopt, |
1093 | #endif | 1097 | #endif |
1094 | .sendmsg = inet_sendmsg, | ||
1095 | .recvmsg = sock_common_recvmsg, | ||
1096 | .mmap = sock_no_mmap, | ||
1097 | .sendpage = sock_no_sendpage, | ||
1098 | }; | 1098 | }; |
1099 | 1099 | ||
1100 | static struct inet_protosw dccp_v4_protosw = { | 1100 | static struct inet_protosw dccp_v4_protosw = { |
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 89106c7d3247..65e2ab0886e6 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
@@ -1106,40 +1106,40 @@ do_time_wait: | |||
1106 | } | 1106 | } |
1107 | 1107 | ||
1108 | static struct inet_connection_sock_af_ops dccp_ipv6_af_ops = { | 1108 | static struct inet_connection_sock_af_ops dccp_ipv6_af_ops = { |
1109 | .queue_xmit = inet6_csk_xmit, | 1109 | .queue_xmit = inet6_csk_xmit, |
1110 | .send_check = dccp_v6_send_check, | 1110 | .send_check = dccp_v6_send_check, |
1111 | .rebuild_header = inet6_sk_rebuild_header, | 1111 | .rebuild_header = inet6_sk_rebuild_header, |
1112 | .conn_request = dccp_v6_conn_request, | 1112 | .conn_request = dccp_v6_conn_request, |
1113 | .syn_recv_sock = dccp_v6_request_recv_sock, | 1113 | .syn_recv_sock = dccp_v6_request_recv_sock, |
1114 | .net_header_len = sizeof(struct ipv6hdr), | 1114 | .net_header_len = sizeof(struct ipv6hdr), |
1115 | .setsockopt = ipv6_setsockopt, | 1115 | .setsockopt = ipv6_setsockopt, |
1116 | .getsockopt = ipv6_getsockopt, | 1116 | .getsockopt = ipv6_getsockopt, |
1117 | .addr2sockaddr = inet6_csk_addr2sockaddr, | ||
1118 | .sockaddr_len = sizeof(struct sockaddr_in6), | ||
1117 | #ifdef CONFIG_COMPAT | 1119 | #ifdef CONFIG_COMPAT |
1118 | .compat_setsockopt = compat_ipv6_setsockopt, | 1120 | .compat_setsockopt = compat_ipv6_setsockopt, |
1119 | .compat_getsockopt = compat_ipv6_getsockopt, | 1121 | .compat_getsockopt = compat_ipv6_getsockopt, |
1120 | #endif | 1122 | #endif |
1121 | .addr2sockaddr = inet6_csk_addr2sockaddr, | ||
1122 | .sockaddr_len = sizeof(struct sockaddr_in6) | ||
1123 | }; | 1123 | }; |
1124 | 1124 | ||
1125 | /* | 1125 | /* |
1126 | * DCCP over IPv4 via INET6 API | 1126 | * DCCP over IPv4 via INET6 API |
1127 | */ | 1127 | */ |
1128 | static struct inet_connection_sock_af_ops dccp_ipv6_mapped = { | 1128 | static struct inet_connection_sock_af_ops dccp_ipv6_mapped = { |
1129 | .queue_xmit = ip_queue_xmit, | 1129 | .queue_xmit = ip_queue_xmit, |
1130 | .send_check = dccp_v4_send_check, | 1130 | .send_check = dccp_v4_send_check, |
1131 | .rebuild_header = inet_sk_rebuild_header, | 1131 | .rebuild_header = inet_sk_rebuild_header, |
1132 | .conn_request = dccp_v6_conn_request, | 1132 | .conn_request = dccp_v6_conn_request, |
1133 | .syn_recv_sock = dccp_v6_request_recv_sock, | 1133 | .syn_recv_sock = dccp_v6_request_recv_sock, |
1134 | .net_header_len = sizeof(struct iphdr), | 1134 | .net_header_len = sizeof(struct iphdr), |
1135 | .setsockopt = ipv6_setsockopt, | 1135 | .setsockopt = ipv6_setsockopt, |
1136 | .getsockopt = ipv6_getsockopt, | 1136 | .getsockopt = ipv6_getsockopt, |
1137 | .addr2sockaddr = inet6_csk_addr2sockaddr, | ||
1138 | .sockaddr_len = sizeof(struct sockaddr_in6), | ||
1137 | #ifdef CONFIG_COMPAT | 1139 | #ifdef CONFIG_COMPAT |
1138 | .compat_setsockopt = compat_ipv6_setsockopt, | 1140 | .compat_setsockopt = compat_ipv6_setsockopt, |
1139 | .compat_getsockopt = compat_ipv6_getsockopt, | 1141 | .compat_getsockopt = compat_ipv6_getsockopt, |
1140 | #endif | 1142 | #endif |
1141 | .addr2sockaddr = inet6_csk_addr2sockaddr, | ||
1142 | .sockaddr_len = sizeof(struct sockaddr_in6) | ||
1143 | }; | 1143 | }; |
1144 | 1144 | ||
1145 | /* NOTE: A lot of things set to zero explicitly by call to | 1145 | /* NOTE: A lot of things set to zero explicitly by call to |
@@ -1166,33 +1166,33 @@ static int dccp_v6_destroy_sock(struct sock *sk) | |||
1166 | } | 1166 | } |
1167 | 1167 | ||
1168 | static struct proto dccp_v6_prot = { | 1168 | static struct proto dccp_v6_prot = { |
1169 | .name = "DCCPv6", | 1169 | .name = "DCCPv6", |
1170 | .owner = THIS_MODULE, | 1170 | .owner = THIS_MODULE, |
1171 | .close = dccp_close, | 1171 | .close = dccp_close, |
1172 | .connect = dccp_v6_connect, | 1172 | .connect = dccp_v6_connect, |
1173 | .disconnect = dccp_disconnect, | 1173 | .disconnect = dccp_disconnect, |
1174 | .ioctl = dccp_ioctl, | 1174 | .ioctl = dccp_ioctl, |
1175 | .init = dccp_v6_init_sock, | 1175 | .init = dccp_v6_init_sock, |
1176 | .setsockopt = dccp_setsockopt, | 1176 | .setsockopt = dccp_setsockopt, |
1177 | .getsockopt = dccp_getsockopt, | 1177 | .getsockopt = dccp_getsockopt, |
1178 | .sendmsg = dccp_sendmsg, | ||
1179 | .recvmsg = dccp_recvmsg, | ||
1180 | .backlog_rcv = dccp_v6_do_rcv, | ||
1181 | .hash = dccp_v6_hash, | ||
1182 | .unhash = dccp_unhash, | ||
1183 | .accept = inet_csk_accept, | ||
1184 | .get_port = dccp_v6_get_port, | ||
1185 | .shutdown = dccp_shutdown, | ||
1186 | .destroy = dccp_v6_destroy_sock, | ||
1187 | .orphan_count = &dccp_orphan_count, | ||
1188 | .max_header = MAX_DCCP_HEADER, | ||
1189 | .obj_size = sizeof(struct dccp6_sock), | ||
1190 | .rsk_prot = &dccp6_request_sock_ops, | ||
1191 | .twsk_prot = &dccp6_timewait_sock_ops, | ||
1178 | #ifdef CONFIG_COMPAT | 1192 | #ifdef CONFIG_COMPAT |
1179 | .compat_setsockopt = compat_dccp_setsockopt, | 1193 | .compat_setsockopt = compat_dccp_setsockopt, |
1180 | .compat_getsockopt = compat_dccp_getsockopt, | 1194 | .compat_getsockopt = compat_dccp_getsockopt, |
1181 | #endif | 1195 | #endif |
1182 | .sendmsg = dccp_sendmsg, | ||
1183 | .recvmsg = dccp_recvmsg, | ||
1184 | .backlog_rcv = dccp_v6_do_rcv, | ||
1185 | .hash = dccp_v6_hash, | ||
1186 | .unhash = dccp_unhash, | ||
1187 | .accept = inet_csk_accept, | ||
1188 | .get_port = dccp_v6_get_port, | ||
1189 | .shutdown = dccp_shutdown, | ||
1190 | .destroy = dccp_v6_destroy_sock, | ||
1191 | .orphan_count = &dccp_orphan_count, | ||
1192 | .max_header = MAX_DCCP_HEADER, | ||
1193 | .obj_size = sizeof(struct dccp6_sock), | ||
1194 | .rsk_prot = &dccp6_request_sock_ops, | ||
1195 | .twsk_prot = &dccp6_timewait_sock_ops, | ||
1196 | }; | 1196 | }; |
1197 | 1197 | ||
1198 | static struct inet6_protocol dccp_v6_protocol = { | 1198 | static struct inet6_protocol dccp_v6_protocol = { |
@@ -1202,28 +1202,28 @@ static struct inet6_protocol dccp_v6_protocol = { | |||
1202 | }; | 1202 | }; |
1203 | 1203 | ||
1204 | static struct proto_ops inet6_dccp_ops = { | 1204 | static struct proto_ops inet6_dccp_ops = { |
1205 | .family = PF_INET6, | 1205 | .family = PF_INET6, |
1206 | .owner = THIS_MODULE, | 1206 | .owner = THIS_MODULE, |
1207 | .release = inet6_release, | 1207 | .release = inet6_release, |
1208 | .bind = inet6_bind, | 1208 | .bind = inet6_bind, |
1209 | .connect = inet_stream_connect, | 1209 | .connect = inet_stream_connect, |
1210 | .socketpair = sock_no_socketpair, | 1210 | .socketpair = sock_no_socketpair, |
1211 | .accept = inet_accept, | 1211 | .accept = inet_accept, |
1212 | .getname = inet6_getname, | 1212 | .getname = inet6_getname, |
1213 | .poll = dccp_poll, | 1213 | .poll = dccp_poll, |
1214 | .ioctl = inet6_ioctl, | 1214 | .ioctl = inet6_ioctl, |
1215 | .listen = inet_dccp_listen, | 1215 | .listen = inet_dccp_listen, |
1216 | .shutdown = inet_shutdown, | 1216 | .shutdown = inet_shutdown, |
1217 | .setsockopt = sock_common_setsockopt, | 1217 | .setsockopt = sock_common_setsockopt, |
1218 | .getsockopt = sock_common_getsockopt, | 1218 | .getsockopt = sock_common_getsockopt, |
1219 | .sendmsg = inet_sendmsg, | ||
1220 | .recvmsg = sock_common_recvmsg, | ||
1221 | .mmap = sock_no_mmap, | ||
1222 | .sendpage = sock_no_sendpage, | ||
1219 | #ifdef CONFIG_COMPAT | 1223 | #ifdef CONFIG_COMPAT |
1220 | .compat_setsockopt = compat_sock_common_setsockopt, | 1224 | .compat_setsockopt = compat_sock_common_setsockopt, |
1221 | .compat_getsockopt = compat_sock_common_getsockopt, | 1225 | .compat_getsockopt = compat_sock_common_getsockopt, |
1222 | #endif | 1226 | #endif |
1223 | .sendmsg = inet_sendmsg, | ||
1224 | .recvmsg = sock_common_recvmsg, | ||
1225 | .mmap = sock_no_mmap, | ||
1226 | .sendpage = sock_no_sendpage, | ||
1227 | }; | 1227 | }; |
1228 | 1228 | ||
1229 | static struct inet_protosw dccp_v6_protosw = { | 1229 | static struct inet_protosw dccp_v6_protosw = { |
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 6d7aef9647de..8a6d0a83047c 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
@@ -516,18 +516,19 @@ int dccp_setsockopt(struct sock *sk, int level, int optname, | |||
516 | optlen); | 516 | optlen); |
517 | return do_dccp_setsockopt(sk, level, optname, optval, optlen); | 517 | return do_dccp_setsockopt(sk, level, optname, optval, optlen); |
518 | } | 518 | } |
519 | |||
519 | EXPORT_SYMBOL_GPL(dccp_setsockopt); | 520 | EXPORT_SYMBOL_GPL(dccp_setsockopt); |
520 | 521 | ||
521 | #ifdef CONFIG_COMPAT | 522 | #ifdef CONFIG_COMPAT |
522 | int compat_dccp_setsockopt(struct sock *sk, int level, int optname, | 523 | int compat_dccp_setsockopt(struct sock *sk, int level, int optname, |
523 | char __user *optval, int optlen) | 524 | char __user *optval, int optlen) |
524 | { | 525 | { |
525 | if (level != SOL_DCCP) | 526 | if (level != SOL_DCCP) |
526 | return inet_csk_compat_setsockopt(sk, level, optname, | 527 | return inet_csk_compat_setsockopt(sk, level, optname, |
527 | optval, optlen); | 528 | optval, optlen); |
528 | |||
529 | return do_dccp_setsockopt(sk, level, optname, optval, optlen); | 529 | return do_dccp_setsockopt(sk, level, optname, optval, optlen); |
530 | } | 530 | } |
531 | |||
531 | EXPORT_SYMBOL_GPL(compat_dccp_setsockopt); | 532 | EXPORT_SYMBOL_GPL(compat_dccp_setsockopt); |
532 | #endif | 533 | #endif |
533 | 534 | ||
@@ -609,17 +610,19 @@ int dccp_getsockopt(struct sock *sk, int level, int optname, | |||
609 | optlen); | 610 | optlen); |
610 | return do_dccp_getsockopt(sk, level, optname, optval, optlen); | 611 | return do_dccp_getsockopt(sk, level, optname, optval, optlen); |
611 | } | 612 | } |
613 | |||
612 | EXPORT_SYMBOL_GPL(dccp_getsockopt); | 614 | EXPORT_SYMBOL_GPL(dccp_getsockopt); |
613 | 615 | ||
614 | #ifdef CONFIG_COMPAT | 616 | #ifdef CONFIG_COMPAT |
615 | int compat_dccp_getsockopt(struct sock *sk, int level, int optname, | 617 | int compat_dccp_getsockopt(struct sock *sk, int level, int optname, |
616 | char __user *optval, int __user *optlen) | 618 | char __user *optval, int __user *optlen) |
617 | { | 619 | { |
618 | if (level != SOL_DCCP) | 620 | if (level != SOL_DCCP) |
619 | return inet_csk_compat_getsockopt(sk, level, optname, | 621 | return inet_csk_compat_getsockopt(sk, level, optname, |
620 | optval, optlen); | 622 | optval, optlen); |
621 | return do_dccp_getsockopt(sk, level, optname, optval, optlen); | 623 | return do_dccp_getsockopt(sk, level, optname, optval, optlen); |
622 | } | 624 | } |
625 | |||
623 | EXPORT_SYMBOL_GPL(compat_dccp_getsockopt); | 626 | EXPORT_SYMBOL_GPL(compat_dccp_getsockopt); |
624 | #endif | 627 | #endif |
625 | 628 | ||