diff options
author | Adrian Bunk <bunk@stusta.de> | 2007-04-26 03:57:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-04-26 03:57:41 -0400 |
commit | 42bad1da506cafa7041a02ab84033a724afe88ac (patch) | |
tree | 2850b3483c2fd05341c32663f4adb8f2ce7506da | |
parent | 55404bca6c45595fee1a546f1a0cc616aeef0b00 (diff) |
[NETLINK]: Possible cleanups.
- make the following needlessly global variables static:
- core/rtnetlink.c: struct rtnl_msg_handlers[]
- netfilter/nf_conntrack_proto.c: struct nf_ct_protos[]
- make the following needlessly global functions static:
- core/rtnetlink.c: rtnl_dump_all()
- netlink/af_netlink.c: netlink_queue_skip()
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/netfilter/nf_conntrack_l4proto.h | 1 | ||||
-rw-r--r-- | include/net/netlink.h | 2 | ||||
-rw-r--r-- | include/net/rtnetlink.h | 1 | ||||
-rw-r--r-- | net/core/rtnetlink.c | 6 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_proto.c | 2 | ||||
-rw-r--r-- | net/netlink/af_netlink.c | 4 |
6 files changed, 5 insertions, 11 deletions
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h index 8415182ec126..f46cb930414c 100644 --- a/include/net/netfilter/nf_conntrack_l4proto.h +++ b/include/net/netfilter/nf_conntrack_l4proto.h | |||
@@ -97,7 +97,6 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; | |||
97 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_generic; | 97 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_generic; |
98 | 98 | ||
99 | #define MAX_NF_CT_PROTO 256 | 99 | #define MAX_NF_CT_PROTO 256 |
100 | extern struct nf_conntrack_l4proto **nf_ct_protos[PF_MAX]; | ||
101 | 100 | ||
102 | extern struct nf_conntrack_l4proto * | 101 | extern struct nf_conntrack_l4proto * |
103 | __nf_ct_l4proto_find(u_int16_t l3proto, u_int8_t l4proto); | 102 | __nf_ct_l4proto_find(u_int16_t l3proto, u_int8_t l4proto); |
diff --git a/include/net/netlink.h b/include/net/netlink.h index 2e4c90a98a7f..0bf325c29aff 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -217,8 +217,6 @@ struct nl_info { | |||
217 | extern void netlink_run_queue(struct sock *sk, unsigned int *qlen, | 217 | extern void netlink_run_queue(struct sock *sk, unsigned int *qlen, |
218 | int (*cb)(struct sk_buff *, | 218 | int (*cb)(struct sk_buff *, |
219 | struct nlmsghdr *)); | 219 | struct nlmsghdr *)); |
220 | extern void netlink_queue_skip(struct nlmsghdr *nlh, | ||
221 | struct sk_buff *skb); | ||
222 | extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb, | 220 | extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb, |
223 | u32 pid, unsigned int group, int report, | 221 | u32 pid, unsigned int group, int report, |
224 | gfp_t flags); | 222 | gfp_t flags); |
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index 086fa9e89509..3b3d4745618d 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h | |||
@@ -13,7 +13,6 @@ extern void rtnl_register(int protocol, int msgtype, | |||
13 | rtnl_doit_func, rtnl_dumpit_func); | 13 | rtnl_doit_func, rtnl_dumpit_func); |
14 | extern int rtnl_unregister(int protocol, int msgtype); | 14 | extern int rtnl_unregister(int protocol, int msgtype); |
15 | extern void rtnl_unregister_all(int protocol); | 15 | extern void rtnl_unregister_all(int protocol); |
16 | extern int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb); | ||
17 | 16 | ||
18 | static inline int rtnl_msg_family(struct nlmsghdr *nlh) | 17 | static inline int rtnl_msg_family(struct nlmsghdr *nlh) |
19 | { | 18 | { |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 4fe0f4b3a345..cec111109155 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -97,7 +97,7 @@ int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len) | |||
97 | return 0; | 97 | return 0; |
98 | } | 98 | } |
99 | 99 | ||
100 | struct rtnl_link *rtnl_msg_handlers[NPROTO]; | 100 | static struct rtnl_link *rtnl_msg_handlers[NPROTO]; |
101 | 101 | ||
102 | static inline int rtm_msgindex(int msgtype) | 102 | static inline int rtm_msgindex(int msgtype) |
103 | { | 103 | { |
@@ -765,7 +765,7 @@ errout: | |||
765 | return err; | 765 | return err; |
766 | } | 766 | } |
767 | 767 | ||
768 | int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb) | 768 | static int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb) |
769 | { | 769 | { |
770 | int idx; | 770 | int idx; |
771 | int s_idx = cb->family; | 771 | int s_idx = cb->family; |
@@ -789,8 +789,6 @@ int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb) | |||
789 | return skb->len; | 789 | return skb->len; |
790 | } | 790 | } |
791 | 791 | ||
792 | EXPORT_SYMBOL_GPL(rtnl_dump_all); | ||
793 | |||
794 | void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change) | 792 | void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change) |
795 | { | 793 | { |
796 | struct sk_buff *skb; | 794 | struct sk_buff *skb; |
diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c index e4aad2087f4d..6d947068c58f 100644 --- a/net/netfilter/nf_conntrack_proto.c +++ b/net/netfilter/nf_conntrack_proto.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <net/netfilter/nf_conntrack_l4proto.h> | 28 | #include <net/netfilter/nf_conntrack_l4proto.h> |
29 | #include <net/netfilter/nf_conntrack_core.h> | 29 | #include <net/netfilter/nf_conntrack_core.h> |
30 | 30 | ||
31 | struct nf_conntrack_l4proto **nf_ct_protos[PF_MAX] __read_mostly; | 31 | static struct nf_conntrack_l4proto **nf_ct_protos[PF_MAX] __read_mostly; |
32 | struct nf_conntrack_l3proto *nf_ct_l3protos[AF_MAX] __read_mostly; | 32 | struct nf_conntrack_l3proto *nf_ct_l3protos[AF_MAX] __read_mostly; |
33 | EXPORT_SYMBOL_GPL(nf_ct_l3protos); | 33 | EXPORT_SYMBOL_GPL(nf_ct_l3protos); |
34 | 34 | ||
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 64d4b27f25ab..42d2fb94eff1 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -121,6 +121,7 @@ static DECLARE_WAIT_QUEUE_HEAD(nl_table_wait); | |||
121 | 121 | ||
122 | static int netlink_dump(struct sock *sk); | 122 | static int netlink_dump(struct sock *sk); |
123 | static void netlink_destroy_callback(struct netlink_callback *cb); | 123 | static void netlink_destroy_callback(struct netlink_callback *cb); |
124 | static void netlink_queue_skip(struct nlmsghdr *nlh, struct sk_buff *skb); | ||
124 | 125 | ||
125 | static DEFINE_RWLOCK(nl_table_lock); | 126 | static DEFINE_RWLOCK(nl_table_lock); |
126 | static atomic_t nl_table_users = ATOMIC_INIT(0); | 127 | static atomic_t nl_table_users = ATOMIC_INIT(0); |
@@ -1568,7 +1569,7 @@ void netlink_run_queue(struct sock *sk, unsigned int *qlen, | |||
1568 | * Pulls the given netlink message off the socket buffer so the next | 1569 | * Pulls the given netlink message off the socket buffer so the next |
1569 | * call to netlink_queue_run() will not reconsider the message. | 1570 | * call to netlink_queue_run() will not reconsider the message. |
1570 | */ | 1571 | */ |
1571 | void netlink_queue_skip(struct nlmsghdr *nlh, struct sk_buff *skb) | 1572 | static void netlink_queue_skip(struct nlmsghdr *nlh, struct sk_buff *skb) |
1572 | { | 1573 | { |
1573 | int msglen = NLMSG_ALIGN(nlh->nlmsg_len); | 1574 | int msglen = NLMSG_ALIGN(nlh->nlmsg_len); |
1574 | 1575 | ||
@@ -1851,7 +1852,6 @@ core_initcall(netlink_proto_init); | |||
1851 | 1852 | ||
1852 | EXPORT_SYMBOL(netlink_ack); | 1853 | EXPORT_SYMBOL(netlink_ack); |
1853 | EXPORT_SYMBOL(netlink_run_queue); | 1854 | EXPORT_SYMBOL(netlink_run_queue); |
1854 | EXPORT_SYMBOL(netlink_queue_skip); | ||
1855 | EXPORT_SYMBOL(netlink_broadcast); | 1855 | EXPORT_SYMBOL(netlink_broadcast); |
1856 | EXPORT_SYMBOL(netlink_dump_start); | 1856 | EXPORT_SYMBOL(netlink_dump_start); |
1857 | EXPORT_SYMBOL(netlink_kernel_create); | 1857 | EXPORT_SYMBOL(netlink_kernel_create); |