RDMA/netlink: Reduce exposure of RDMA netlink functions
PATCH 1/1 RDMA/netlink: Reduce exposure of RDMA netlink functions
From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>
RDMA netlink is part of ib_core, hence ibnl_chk_listeners(), ibnl_init() and ibnl_cleanup() don't need to be published in public header file.
Let's remove EXPORT_SYMBOL from ibnl_chk_listeners() and move all these functions to private header file.
---
Changes from v0:
* Move ibnl_init(), ibnl_cleanup() and ibnl_chk_listeners() functions to private header.
* Change titile and commit message to reflect that change
--- drivers/infiniband/core/core_priv.h | 10 ++++++++++ drivers/infiniband/core/netlink.c | 1 - include/rdma/rdma_netlink.h | 10 ---------- 3 files changed, 10 insertions(+), 11 deletions(-)
drivers/infiniband/core/core_priv.h +10 -0
@@ -169,6 +169,16 @@ void ib_mad_cleanup(void);int ib_sa_init (void );void ib_sa_cleanup (void ); +int ibnl_init (void ); +void ibnl_cleanup (void ); + +/** +* Check if there are any listeners to the netlink group +* @group: the netlink group ID +* Returns 0 on success or a negative for no listeners. +*/ +int ibnl_chk_listeners (unsigned int group); +int ib_nl_handle_resolve_resp (struct sk_buff *skb,struct netlink_callback *cb); int ib_nl_handle_set_timeout(struct sk_buff *skb,
drivers/infiniband/core/netlink.c +0 -1
@@ -55,7 +55,6 @@ int ibnl_chk_listeners(unsigned int group)return -1 ;return 0 ; } -EXPORT_SYMBOL (ibnl_chk_listeners);int ibnl_add_client (int index,int nops,const struct ibnl_client_cbs cb_table[])
include/rdma/rdma_netlink.h +0 -10
@@ -10,9 +10,6 @@ struct ibnl_client_cbs {struct module *module; }; -int ibnl_init (void ); -void ibnl_cleanup (void ); -/** * Add a a client to the list of IB netlink exporters. * @index: Index of the added client
@@ -77,11 +74,4 @@ int ibnl_unicast(struct sk_buff *skb, struct nlmsghdr *nlh,int ibnl_multicast (struct sk_buff *skb,struct nlmsghdr *nlh,unsigned int group,gfp_t flags); -/** -* Check if there are any listeners to the netlink group -* @group: the netlink group ID -* Returns 0 on success or a negative for no listeners. -*/ -int ibnl_chk_listeners (unsigned int group); -#endif /* _RDMA_NETLINK_H */
--
2.12.2
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20170509064234.31094-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Yuval Shaia
Reviewed-byQuoted 71 lines · Leon Romanovsky
From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>
RDMA netlink is part of
ib_core, henceibnl_chk_listeners(),ibnl_init()andibnl_cleanup()don't need to be published in public header file.Let's remove
EXPORT_SYMBOLfromibnl_chk_listeners()and move all these functions to private header file.CC Yuval Shaia <[email protected]>---
Changes from v0:
* Moveibnl_init(),ibnl_cleanup()andibnl_chk_listeners()functions to private header.
* Change titile and commit message to reflect that change--- drivers/infiniband/core/core_priv.h | 10 ++++++++++ drivers/infiniband/core/netlink.c | 1 - include/rdma/rdma_netlink.h | 10 ---------- 3 files changed, 10 insertions(+), 11 deletions(-)drivers/infiniband/core/core_priv.h +10
-0@@ -169,6 +169,16 @@ void ib_mad_cleanup(void);int ib_sa_init (void );void ib_sa_cleanup (void ); +int ibnl_init (void ); +void ibnl_cleanup (void ); + +/** +* Check if there are any listeners to the netlink group +* @group: the netlink group ID +* Returns 0 on success or a negative for no listeners. +*/ +int ibnl_chk_listeners (unsigned int group); +int ib_nl_handle_resolve_resp (struct sk_buff *skb,struct netlink_callback *cb); int ib_nl_handle_set_timeout(struct sk_buff *skb,drivers/infiniband/core/netlink.c +0
-1@@ -55,7 +55,6 @@ int ibnl_chk_listeners(unsigned int group)return -1 ;return 0 ; } -EXPORT_SYMBOL (ibnl_chk_listeners);int ibnl_add_client (int index,int nops,const struct ibnl_client_cbs cb_table[])include/rdma/rdma_netlink.h +0
-3@@ -10,9 +10,6 @@ struct ibnl_client_cbs {struct module *module; }; -int ibnl_init (void ); -void ibnl_cleanup (void ); -/** * Add a a client to the list of IB netlink exporters. * @index: Index of the added client @@ -77,11 +74,4 @@ int ibnl_unicast(struct sk_buff *skb, struct nlmsghdr *nlh, int ibnl_multicast(struct sk_buff *skb, struct nlmsghdr *nlh,
include/rdma/rdma_netlink.h int ibnl_unicast(struct sk_buff *skb, struct nlmsghdr *nlh, · line 77
Quoted 10 lines
include/rdma/rdma_netlink.h +0
-7unsigned int group, gfp_t flags); -/** -* Check if there are any listeners to the netlink group -* @group: the netlink group ID -* Returns 0 on success or a negative for no listeners. -*/ -int ibnl_chk_listeners (unsigned int group); -#endif /* _RDMA_NETLINK_H */
Quoted 3 lines
--
2.12.2
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html