diff options
Diffstat (limited to 'drivers/infiniband/core/sa_query.c')
-rw-r--r-- | drivers/infiniband/core/sa_query.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c index e45afba753..d7d4a5309b 100644 --- a/drivers/infiniband/core/sa_query.c +++ b/drivers/infiniband/core/sa_query.c | |||
@@ -47,8 +47,8 @@ | |||
47 | #include <linux/workqueue.h> | 47 | #include <linux/workqueue.h> |
48 | 48 | ||
49 | #include <rdma/ib_pack.h> | 49 | #include <rdma/ib_pack.h> |
50 | #include <rdma/ib_sa.h> | ||
51 | #include <rdma/ib_cache.h> | 50 | #include <rdma/ib_cache.h> |
51 | #include "sa.h" | ||
52 | 52 | ||
53 | MODULE_AUTHOR("Roland Dreier"); | 53 | MODULE_AUTHOR("Roland Dreier"); |
54 | MODULE_DESCRIPTION("InfiniBand subnet administration query support"); | 54 | MODULE_DESCRIPTION("InfiniBand subnet administration query support"); |
@@ -425,17 +425,6 @@ void ib_sa_register_client(struct ib_sa_client *client) | |||
425 | } | 425 | } |
426 | EXPORT_SYMBOL(ib_sa_register_client); | 426 | EXPORT_SYMBOL(ib_sa_register_client); |
427 | 427 | ||
428 | static inline void ib_sa_client_get(struct ib_sa_client *client) | ||
429 | { | ||
430 | atomic_inc(&client->users); | ||
431 | } | ||
432 | |||
433 | static inline void ib_sa_client_put(struct ib_sa_client *client) | ||
434 | { | ||
435 | if (atomic_dec_and_test(&client->users)) | ||
436 | complete(&client->comp); | ||
437 | } | ||
438 | |||
439 | void ib_sa_unregister_client(struct ib_sa_client *client) | 428 | void ib_sa_unregister_client(struct ib_sa_client *client) |
440 | { | 429 | { |
441 | ib_sa_client_put(client); | 430 | ib_sa_client_put(client); |
@@ -901,7 +890,6 @@ err1: | |||
901 | kfree(query); | 890 | kfree(query); |
902 | return ret; | 891 | return ret; |
903 | } | 892 | } |
904 | EXPORT_SYMBOL(ib_sa_mcmember_rec_query); | ||
905 | 893 | ||
906 | static void send_handler(struct ib_mad_agent *agent, | 894 | static void send_handler(struct ib_mad_agent *agent, |
907 | struct ib_mad_send_wc *mad_send_wc) | 895 | struct ib_mad_send_wc *mad_send_wc) |
@@ -1053,14 +1041,27 @@ static int __init ib_sa_init(void) | |||
1053 | get_random_bytes(&tid, sizeof tid); | 1041 | get_random_bytes(&tid, sizeof tid); |
1054 | 1042 | ||
1055 | ret = ib_register_client(&sa_client); | 1043 | ret = ib_register_client(&sa_client); |
1056 | if (ret) | 1044 | if (ret) { |
1057 | printk(KERN_ERR "Couldn't register ib_sa client\n"); | 1045 | printk(KERN_ERR "Couldn't register ib_sa client\n"); |
1046 | goto err1; | ||
1047 | } | ||
1048 | |||
1049 | ret = mcast_init(); | ||
1050 | if (ret) { | ||
1051 | printk(KERN_ERR "Couldn't initialize multicast handling\n"); | ||
1052 | goto err2; | ||
1053 | } | ||
1058 | 1054 | ||
1055 | return 0; | ||
1056 | err2: | ||
1057 | ib_unregister_client(&sa_client); | ||
1058 | err1: | ||
1059 | return ret; | 1059 | return ret; |
1060 | } | 1060 | } |
1061 | 1061 | ||
1062 | static void __exit ib_sa_cleanup(void) | 1062 | static void __exit ib_sa_cleanup(void) |
1063 | { | 1063 | { |
1064 | mcast_cleanup(); | ||
1064 | ib_unregister_client(&sa_client); | 1065 | ib_unregister_client(&sa_client); |
1065 | idr_destroy(&query_idr); | 1066 | idr_destroy(&query_idr); |
1066 | } | 1067 | } |