[ofa-general] Re: [PATCH] opensm/complib: remove osm_log usage from complib's API

Sasha Khapyorsky sashak at voltaire.com
Tue Aug 28 02:36:35 PDT 2007


On 09:59 Sun 26 Aug     , Sasha Khapyorsky wrote:
> 
> Remove pointer to osm_log from cl_event_wheel_init() parameters list.
> This changes API, so complib version is bumped.
> 
> Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>

As suggested by Hal. Since there is API change I will bump complib
version to 2.3.0. Will do the same with libosmcomp.ver - to unify the
version numbers.

Sasha

> ---
>  opensm/complib/cl_event_wheel.c         |   12 +++++-------
>  opensm/complib/configure.in             |    2 +-
>  opensm/complib/libosmcomp.map           |    2 +-
>  opensm/complib/libosmcomp.ver           |    2 +-
>  opensm/include/complib/cl_event_wheel.h |   11 +----------
>  opensm/opensm/osm_trap_rcv.c            |    7 ++++++-
>  6 files changed, 15 insertions(+), 21 deletions(-)
> 
> diff --git a/opensm/complib/cl_event_wheel.c b/opensm/complib/cl_event_wheel.c
> index f40a15d..f83c47e 100644
> --- a/opensm/complib/cl_event_wheel.c
> +++ b/opensm/complib/cl_event_wheel.c
> @@ -196,8 +196,7 @@ void cl_event_wheel_construct(IN cl_event_wheel_t * const p_event_wheel)
>  }
>  
>  cl_status_t
> -cl_event_wheel_init(IN cl_event_wheel_t * const p_event_wheel,
> -		    IN osm_log_t * p_log)
> +cl_event_wheel_init(IN cl_event_wheel_t * const p_event_wheel)
>  {
>  	cl_status_t cl_status = CL_SUCCESS;
>  
> @@ -218,14 +217,13 @@ cl_event_wheel_init(IN cl_event_wheel_t * const p_event_wheel,
>  
>  cl_status_t
>  cl_event_wheel_init_ex(IN cl_event_wheel_t * const p_event_wheel,
> -		       IN osm_log_t * p_log, IN cl_spinlock_t * p_external_lock)
> +		       IN cl_spinlock_t * p_external_lock)
>  {
>  	cl_status_t cl_status;
>  
> -	cl_status = cl_event_wheel_init(p_event_wheel, NULL);
> -	if (CL_SUCCESS != cl_status) {
> +	cl_status = cl_event_wheel_init(p_event_wheel);
> +	if (CL_SUCCESS != cl_status)
>  		return cl_status;
> -	}
>  
>  	p_event_wheel->p_external_lock = p_external_lock;
>  	return cl_status;
> @@ -527,7 +525,7 @@ int main()
>  	cl_event_wheel_construct(&event_wheel);
>  
>  	/* init */
> -	cl_event_wheel_init(&event_wheel, NULL);
> +	cl_event_wheel_init(&event_wheel);
>  
>  	/* Start Playing */
>  	cl_event_wheel_reg(&event_wheel, 1,	/*  key */
> diff --git a/opensm/complib/configure.in b/opensm/complib/configure.in
> index 2e2bd59..6abb264 100644
> --- a/opensm/complib/configure.in
> +++ b/opensm/complib/configure.in
> @@ -1,7 +1,7 @@
>  dnl Process this file with autoconf to produce a configure script.
>  
>  AC_PREREQ(2.57)
> -AC_INIT(complib, 2.2.1, general at lists.openfabrics.org)
> +AC_INIT(complib, 2.2.2, general at lists.openfabrics.org)
>  AC_CONFIG_SRCDIR([cl_spinlock.c])
>  AC_CONFIG_AUX_DIR(config)
>  AM_CONFIG_HEADER(config.h)
> diff --git a/opensm/complib/libosmcomp.map b/opensm/complib/libosmcomp.map
> index 2a1ba63..6361554 100644
> --- a/opensm/complib/libosmcomp.map
> +++ b/opensm/complib/libosmcomp.map
> @@ -1,4 +1,4 @@
> -OSMCOMP_2.0 {
> +OSMCOMP_2.1 {
>  	global:
>  		complib_init;
>  		complib_exit;
> diff --git a/opensm/complib/libosmcomp.ver b/opensm/complib/libosmcomp.ver
> index fab9776..ab7e34e 100644
> --- a/opensm/complib/libosmcomp.ver
> +++ b/opensm/complib/libosmcomp.ver
> @@ -6,4 +6,4 @@
>  # API_REV - advance on any added API
>  # RUNNING_REV - advance any change to the vendor files
>  # AGE - number of backward versions the API still supports
> -LIBVERSION=2:0:0
> +LIBVERSION=2:1:0
> diff --git a/opensm/include/complib/cl_event_wheel.h b/opensm/include/complib/cl_event_wheel.h
> index ab34bc5..ba466c6 100644
> --- a/opensm/include/complib/cl_event_wheel.h
> +++ b/opensm/include/complib/cl_event_wheel.h
> @@ -51,7 +51,6 @@
>  #include <complib/cl_qmap.h>
>  #include <complib/cl_timer.h>
>  #include <complib/cl_spinlock.h>
> -#include <opensm/osm_log.h>
>  
>  #ifdef __cplusplus
>  #  define BEGIN_C_DECLS extern "C" {
> @@ -261,17 +260,13 @@ void cl_event_wheel_construct(IN cl_event_wheel_t * const p_event_wheel);
>  * SYNOPSIS
>  */
>  cl_status_t
> -cl_event_wheel_init(IN cl_event_wheel_t * const p_event_wheel,
> -		    IN osm_log_t * p_log);
> +cl_event_wheel_init(IN cl_event_wheel_t * const p_event_wheel);
>  
>  /*
>  * PARAMETERS
>  *	p_event_wheel
>  *		[in] Pointer to a Event_Wheel.
>  *
> -*  p_log
> -*     [in] Pointer to opensm log object to be used for logging
> -*
>  * RETURN VALUE
>  *	CL_SUCCESS if the operation is successful.
>  *
> @@ -291,7 +286,6 @@ cl_event_wheel_init(IN cl_event_wheel_t * const p_event_wheel,
>  */
>  cl_status_t
>  cl_event_wheel_init_ex(IN cl_event_wheel_t * const p_event_wheel,
> -		       IN osm_log_t * p_log,
>  		       IN cl_spinlock_t * p_external_lock);
>  
>  /*
> @@ -299,9 +293,6 @@ cl_event_wheel_init_ex(IN cl_event_wheel_t * const p_event_wheel,
>  *  p_event_wheel
>  *     [in] Pointer to a Event_Wheel.
>  *
> -*  p_log
> -*     [in] Pointer to opensm log object to be used for logging
> -*
>  *  p_external_lock
>  *     [in] Reference to external spinlock to guard internal structures
>  *          if the event wheel is part of a larger object protected by its own lock
> diff --git a/opensm/opensm/osm_trap_rcv.c b/opensm/opensm/osm_trap_rcv.c
> index 86aac94..babc625 100644
> --- a/opensm/opensm/osm_trap_rcv.c
> +++ b/opensm/opensm/osm_trap_rcv.c
> @@ -203,7 +203,12 @@ osm_trap_rcv_init(IN osm_trap_rcv_t * const p_rcv,
>  	p_rcv->p_resp = p_resp;
>  	p_rcv->p_state_mgr = p_state_mgr;
>  
> -	cl_event_wheel_init(&p_rcv->trap_aging_tracker, p_log);
> +	if(cl_event_wheel_init(&p_rcv->trap_aging_tracker)) {
> +		osm_log(p_log, OSM_LOG_ERROR,
> +			"osm_trap_rcv_init: ERR 3800: "
> +			"Failed to initialize cl_event_wheel\n");
> +		status = IB_NOT_DONE;
> +	}
>  
>  	OSM_LOG_EXIT(p_rcv->p_log);
>  	return (status);
> -- 
> 1.5.3.rc2.38.g11308
> 



More information about the general mailing list