[openib-general][PATCH][kdapl]: inc/dec module ref count

Guy German guyg at voltaire.com
Thu Jul 28 00:14:15 PDT 2005


[kdapl]: increments the module ref count on ia_open, thus making
sure the kdapl_ib module would not be rmmod-ed while in use

Signed-off-by: Guy German <guyg at voltaire.com>

Index: infiniband/ulp/kdapl/ib/dapl_ia.c
===================================================================
--- infiniband/ulp/kdapl/ib/dapl_ia.c	(revision 2914)
+++ infiniband/ulp/kdapl/ib/dapl_ia.c	(working copy)
@@ -649,6 +649,7 @@ int dapl_ia_open(const char *name, int a
  	status = 0;
  	*ia_ptr = (struct dat_ia *)ia;
  	*async_evd = (struct dat_evd *)evd;
+	try_module_get(THIS_MODULE);

  bail:
  	if (status != 0)
@@ -679,6 +680,7 @@ int dapl_ia_close(struct dat_ia *ia_ptr,
  	else
  		status = -EINVAL;

+	module_put(THIS_MODULE);
  	return status;
  }




More information about the general mailing list