Print this page
NEX-5010 Fix for NEX-4680 introduced cstyle issues
Reviewed by: Jean McCormack <jean.mccormack@nexenta.com>
NEX-4680 NEF needs Sun_HBA_* API to be working after library reload
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/hbaapi/common/HBAAPILIB.c
          +++ new/usr/src/lib/hbaapi/common/HBAAPILIB.c
↓ open down ↓ 36 lines elided ↑ open up ↑
  37   37   */
  38   38  #define HBAAPI_EXPORTS
  39   39  #else
  40   40  #include <dlfcn.h>
  41   41  #include <strings.h>
  42   42  #endif
  43   43  #include <stdio.h>
  44   44  #include <time.h>
  45   45  #include "hbaapi.h"
  46   46  #include "vendorhbaapi.h"
       47 +#include "hbaapi-sun.h"
  47   48  #include <stdlib.h>
  48   49  #ifdef USESYSLOG
  49   50  #include <syslog.h>
  50   51  #endif
  51   52  
  52   53  /*
  53   54   * LIBRARY_NUM is a shortcut to figure out which library we need to call.
  54   55   *  The top 16 bits of handle are the library index
  55   56   */
  56   57  #define LIBRARY_NUM(handle)     ((handle)>>16)
↓ open down ↓ 905 lines elided ↑ open up ↑
 962  963  #elif defined(WIN32)
 963  964      DeleteCriticalSection(&_hbaapi_LL_mutex);
 964  965      DeleteCriticalSection(&_hbaapi_AL_mutex);
 965  966      DeleteCriticalSection(&_hbaapi_AAE_mutex);
 966  967      DeleteCriticalSection(&_hbaapi_AE_mutex);
 967  968      DeleteCriticalSection(&_hbaapi_APE_mutex);
 968  969      DeleteCriticalSection(&_hbaapi_APSE_mutex);
 969  970      DeleteCriticalSection(&_hbaapi_TE_mutex);
 970  971      DeleteCriticalSection(&_hbaapi_LE_mutex);
 971  972  #endif
 972      -    
 973      -    return HBA_STATUS_OK;
      973 +
      974 +    return (Sun_HBA_FreeLibrary());
 974  975  }
 975      -
      976 +
 976  977  /*
 977  978   * The API used to use fixed size tables as its primary data structure.
 978  979   * Indexing from 1 to N identified each adapters.  Now the adapters are
 979  980   * on a linked list.  There is a unique "index" foreach each adapter.
 980  981   * Adapters always keep their index, even if they are removed from the
 981  982   * hardware.  The only time the indexing is reset is on HBA_FreeLibrary
 982  983   */
 983  984  HBA_UINT32
 984  985  HBA_GetNumberOfAdapters(void) {
 985  986      int j=0;
↓ open down ↓ 2069 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX