IB/sa: Require SA registration
Require users to register with SA module, to prevent the sa_query module text from going away while an SA query callback is still running. Update all in-tree users for the new interface. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
committed by
Roland Dreier
parent
2439a6e65f
commit
c1a0b23bf4
@@ -96,6 +96,8 @@ static struct ib_client srp_client = {
|
||||
.remove = srp_remove_one
|
||||
};
|
||||
|
||||
static struct ib_sa_client srp_sa_client;
|
||||
|
||||
static inline struct srp_target_port *host_to_target(struct Scsi_Host *host)
|
||||
{
|
||||
return (struct srp_target_port *) host->hostdata;
|
||||
@@ -267,7 +269,8 @@ static int srp_lookup_path(struct srp_target_port *target)
|
||||
|
||||
init_completion(&target->done);
|
||||
|
||||
target->path_query_id = ib_sa_path_rec_get(target->srp_host->dev->dev,
|
||||
target->path_query_id = ib_sa_path_rec_get(&srp_sa_client,
|
||||
target->srp_host->dev->dev,
|
||||
target->srp_host->port,
|
||||
&target->path,
|
||||
IB_SA_PATH_REC_DGID |
|
||||
@@ -1998,9 +2001,12 @@ static int __init srp_init_module(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ib_sa_register_client(&srp_sa_client);
|
||||
|
||||
ret = ib_register_client(&srp_client);
|
||||
if (ret) {
|
||||
printk(KERN_ERR PFX "couldn't register IB client\n");
|
||||
ib_sa_unregister_client(&srp_sa_client);
|
||||
class_unregister(&srp_class);
|
||||
return ret;
|
||||
}
|
||||
@@ -2011,6 +2017,7 @@ static int __init srp_init_module(void)
|
||||
static void __exit srp_cleanup_module(void)
|
||||
{
|
||||
ib_unregister_client(&srp_client);
|
||||
ib_sa_unregister_client(&srp_sa_client);
|
||||
class_unregister(&srp_class);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user