提交 42bad1da 编写于 作者: A Adrian Bunk 提交者: David S. Miller

[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: NAdrian Bunk <bunk@stusta.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 55404bca
...@@ -97,7 +97,6 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; ...@@ -97,7 +97,6 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6;
extern struct nf_conntrack_l4proto nf_conntrack_l4proto_generic; extern struct nf_conntrack_l4proto nf_conntrack_l4proto_generic;
#define MAX_NF_CT_PROTO 256 #define MAX_NF_CT_PROTO 256
extern struct nf_conntrack_l4proto **nf_ct_protos[PF_MAX];
extern struct nf_conntrack_l4proto * extern struct nf_conntrack_l4proto *
__nf_ct_l4proto_find(u_int16_t l3proto, u_int8_t l4proto); __nf_ct_l4proto_find(u_int16_t l3proto, u_int8_t l4proto);
......
...@@ -217,8 +217,6 @@ struct nl_info { ...@@ -217,8 +217,6 @@ struct nl_info {
extern void netlink_run_queue(struct sock *sk, unsigned int *qlen, extern void netlink_run_queue(struct sock *sk, unsigned int *qlen,
int (*cb)(struct sk_buff *, int (*cb)(struct sk_buff *,
struct nlmsghdr *)); struct nlmsghdr *));
extern void netlink_queue_skip(struct nlmsghdr *nlh,
struct sk_buff *skb);
extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb, extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb,
u32 pid, unsigned int group, int report, u32 pid, unsigned int group, int report,
gfp_t flags); gfp_t flags);
......
...@@ -13,7 +13,6 @@ extern void rtnl_register(int protocol, int msgtype, ...@@ -13,7 +13,6 @@ extern void rtnl_register(int protocol, int msgtype,
rtnl_doit_func, rtnl_dumpit_func); rtnl_doit_func, rtnl_dumpit_func);
extern int rtnl_unregister(int protocol, int msgtype); extern int rtnl_unregister(int protocol, int msgtype);
extern void rtnl_unregister_all(int protocol); extern void rtnl_unregister_all(int protocol);
extern int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb);
static inline int rtnl_msg_family(struct nlmsghdr *nlh) static inline int rtnl_msg_family(struct nlmsghdr *nlh)
{ {
......
...@@ -97,7 +97,7 @@ int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len) ...@@ -97,7 +97,7 @@ int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len)
return 0; return 0;
} }
struct rtnl_link *rtnl_msg_handlers[NPROTO]; static struct rtnl_link *rtnl_msg_handlers[NPROTO];
static inline int rtm_msgindex(int msgtype) static inline int rtm_msgindex(int msgtype)
{ {
...@@ -765,7 +765,7 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) ...@@ -765,7 +765,7 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
return err; return err;
} }
int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb) static int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb)
{ {
int idx; int idx;
int s_idx = cb->family; int s_idx = cb->family;
...@@ -789,8 +789,6 @@ int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -789,8 +789,6 @@ int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb)
return skb->len; return skb->len;
} }
EXPORT_SYMBOL_GPL(rtnl_dump_all);
void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change) void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change)
{ {
struct sk_buff *skb; struct sk_buff *skb;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <net/netfilter/nf_conntrack_l4proto.h> #include <net/netfilter/nf_conntrack_l4proto.h>
#include <net/netfilter/nf_conntrack_core.h> #include <net/netfilter/nf_conntrack_core.h>
struct nf_conntrack_l4proto **nf_ct_protos[PF_MAX] __read_mostly; static struct nf_conntrack_l4proto **nf_ct_protos[PF_MAX] __read_mostly;
struct nf_conntrack_l3proto *nf_ct_l3protos[AF_MAX] __read_mostly; struct nf_conntrack_l3proto *nf_ct_l3protos[AF_MAX] __read_mostly;
EXPORT_SYMBOL_GPL(nf_ct_l3protos); EXPORT_SYMBOL_GPL(nf_ct_l3protos);
......
...@@ -121,6 +121,7 @@ static DECLARE_WAIT_QUEUE_HEAD(nl_table_wait); ...@@ -121,6 +121,7 @@ static DECLARE_WAIT_QUEUE_HEAD(nl_table_wait);
static int netlink_dump(struct sock *sk); static int netlink_dump(struct sock *sk);
static void netlink_destroy_callback(struct netlink_callback *cb); static void netlink_destroy_callback(struct netlink_callback *cb);
static void netlink_queue_skip(struct nlmsghdr *nlh, struct sk_buff *skb);
static DEFINE_RWLOCK(nl_table_lock); static DEFINE_RWLOCK(nl_table_lock);
static atomic_t nl_table_users = ATOMIC_INIT(0); static atomic_t nl_table_users = ATOMIC_INIT(0);
...@@ -1568,7 +1569,7 @@ void netlink_run_queue(struct sock *sk, unsigned int *qlen, ...@@ -1568,7 +1569,7 @@ void netlink_run_queue(struct sock *sk, unsigned int *qlen,
* Pulls the given netlink message off the socket buffer so the next * Pulls the given netlink message off the socket buffer so the next
* call to netlink_queue_run() will not reconsider the message. * call to netlink_queue_run() will not reconsider the message.
*/ */
void netlink_queue_skip(struct nlmsghdr *nlh, struct sk_buff *skb) static void netlink_queue_skip(struct nlmsghdr *nlh, struct sk_buff *skb)
{ {
int msglen = NLMSG_ALIGN(nlh->nlmsg_len); int msglen = NLMSG_ALIGN(nlh->nlmsg_len);
...@@ -1851,7 +1852,6 @@ core_initcall(netlink_proto_init); ...@@ -1851,7 +1852,6 @@ core_initcall(netlink_proto_init);
EXPORT_SYMBOL(netlink_ack); EXPORT_SYMBOL(netlink_ack);
EXPORT_SYMBOL(netlink_run_queue); EXPORT_SYMBOL(netlink_run_queue);
EXPORT_SYMBOL(netlink_queue_skip);
EXPORT_SYMBOL(netlink_broadcast); EXPORT_SYMBOL(netlink_broadcast);
EXPORT_SYMBOL(netlink_dump_start); EXPORT_SYMBOL(netlink_dump_start);
EXPORT_SYMBOL(netlink_kernel_create); EXPORT_SYMBOL(netlink_kernel_create);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册