aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srp
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@mellanox.co.il>2006-08-21 19:40:12 -0400
committerRoland Dreier <rolandd@cisco.com>2006-09-22 18:22:53 -0400
commitc1a0b23bf477c2e1068905f4e2b5c3cee139e853 (patch)
tree68357e32e8b6542647f639da8ca3859b4cb3b59b /drivers/infiniband/ulp/srp
parent2439a6e65ff09729c3b4215f134dc5cd4e8a30c0 (diff)
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>
Diffstat (limited to 'drivers/infiniband/ulp/srp')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index feb1fcd0f2fb..44b9e5be6687 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -96,6 +96,8 @@ static struct ib_client srp_client = {
96 .remove = srp_remove_one 96 .remove = srp_remove_one
97}; 97};
98 98
99static struct ib_sa_client srp_sa_client;
100
99static inline struct srp_target_port *host_to_target(struct Scsi_Host *host) 101static inline struct srp_target_port *host_to_target(struct Scsi_Host *host)
100{ 102{
101 return (struct srp_target_port *) host->hostdata; 103 return (struct srp_target_port *) host->hostdata;
@@ -267,7 +269,8 @@ static int srp_lookup_path(struct srp_target_port *target)
267 269
268 init_completion(&target->done); 270 init_completion(&target->done);
269 271
270 target->path_query_id = ib_sa_path_rec_get(target->srp_host->dev->dev, 272 target->path_query_id = ib_sa_path_rec_get(&srp_sa_client,
273 target->srp_host->dev->dev,
271 target->srp_host->port, 274 target->srp_host->port,
272 &target->path, 275 &target->path,
273 IB_SA_PATH_REC_DGID | 276 IB_SA_PATH_REC_DGID |
@@ -1998,9 +2001,12 @@ static int __init srp_init_module(void)
1998 return ret; 2001 return ret;
1999 } 2002 }
2000 2003
2004 ib_sa_register_client(&srp_sa_client);
2005
2001 ret = ib_register_client(&srp_client); 2006 ret = ib_register_client(&srp_client);
2002 if (ret) { 2007 if (ret) {
2003 printk(KERN_ERR PFX "couldn't register IB client\n"); 2008 printk(KERN_ERR PFX "couldn't register IB client\n");
2009 ib_sa_unregister_client(&srp_sa_client);
2004 class_unregister(&srp_class); 2010 class_unregister(&srp_class);
2005 return ret; 2011 return ret;
2006 } 2012 }
@@ -2011,6 +2017,7 @@ static int __init srp_init_module(void)
2011static void __exit srp_cleanup_module(void) 2017static void __exit srp_cleanup_module(void)
2012{ 2018{
2013 ib_unregister_client(&srp_client); 2019 ib_unregister_client(&srp_client);
2020 ib_sa_unregister_client(&srp_sa_client);
2014 class_unregister(&srp_class); 2021 class_unregister(&srp_class);
2015} 2022}
2016 2023