Print this page
NEX-2846 Enable Automatic/Intelligent Hot Sparing capability
Reviewed by: Jeffry Molanus <jeffry.molanus@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
re #13388 rb4382 fmd_api.h uses bool which is a C99/C++ keyword

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/fm/fmd/common/fmd_api.h
          +++ new/usr/src/cmd/fm/fmd/common/fmd_api.h
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2016 Nexenta Systems, Inc.  All rights reserved.
  24   25   */
  25   26  
  26   27  #ifndef _FMD_API_H
  27   28  #define _FMD_API_H
  28   29  
  29   30  #include <sys/types.h>
  30   31  #include <libnvpair.h>
  31   32  #include <stdarg.h>
  32   33  #include <door.h>
  33   34  
↓ open down ↓ 50 lines elided ↑ open up ↑
  84   85          const char *fmdp_name;          /* property name */
  85   86          uint_t fmdp_type;               /* property type (see above) */
  86   87          const char *fmdp_defv;          /* default value */
  87   88  } fmd_prop_t;
  88   89  
  89   90  typedef struct fmd_stat {
  90   91          char fmds_name[32];             /* statistic name */
  91   92          uint_t fmds_type;               /* statistic type (see above) */
  92   93          char fmds_desc[64];             /* statistic description */
  93   94          union {
  94      -                int bool;               /* FMD_TYPE_BOOL */
       95 +                int b;                  /* FMD_TYPE_BOOL */
  95   96                  int32_t i32;            /* FMD_TYPE_INT32 */
  96   97                  uint32_t ui32;          /* FMD_TYPE_UINT32 */
  97   98                  int64_t i64;            /* FMD_TYPE_INT64 */
  98   99                  uint64_t ui64;          /* FMD_TYPE_UINT64, TIME, SIZE */
  99  100                  char *str;              /* FMD_TYPE_STRING */
 100  101          } fmds_value;
 101  102  } fmd_stat_t;
 102  103  
 103  104  typedef struct fmd_hdl_ops {
 104  105          void (*fmdo_recv)(fmd_hdl_t *, fmd_event_t *, nvlist_t *, const char *);
↓ open down ↓ 25 lines elided ↑ open up ↑
 130  131  extern void fmd_hdl_subscribe(fmd_hdl_t *, const char *);
 131  132  extern void fmd_hdl_unsubscribe(fmd_hdl_t *, const char *);
 132  133  
 133  134  extern void fmd_hdl_setspecific(fmd_hdl_t *, void *);
 134  135  extern void *fmd_hdl_getspecific(fmd_hdl_t *);
 135  136  
 136  137  extern void fmd_hdl_opendict(fmd_hdl_t *, const char *);
 137  138  extern struct topo_hdl *fmd_hdl_topo_hold(fmd_hdl_t *, int);
 138  139  extern void fmd_hdl_topo_rele(fmd_hdl_t *, struct topo_hdl *);
 139  140  
      141 +typedef struct fmd_hdl_topo_node_info {
      142 +        const char *device;
      143 +        nvlist_t *fru;
      144 +        nvlist_t *resource;
      145 +} fmd_hdl_topo_node_info_t;
      146 +
      147 +extern fmd_hdl_topo_node_info_t *fmd_hdl_topo_node_get_by_devid(
      148 +    fmd_hdl_t *hdl, char *device);
      149 +
 140  150  #define FMD_NOSLEEP             0x0     /* do not sleep or retry on failure */
 141  151  #define FMD_SLEEP               0x1     /* sleep or retry if alloc fails */
 142  152  
 143  153  extern void *fmd_hdl_alloc(fmd_hdl_t *, size_t, int);
 144  154  extern void *fmd_hdl_zalloc(fmd_hdl_t *, size_t, int);
 145  155  extern void fmd_hdl_free(fmd_hdl_t *, void *, size_t);
 146  156  
 147  157  extern char *fmd_hdl_strdup(fmd_hdl_t *, const char *, int);
 148  158  extern void fmd_hdl_strfree(fmd_hdl_t *, char *);
 149  159  
↓ open down ↓ 139 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX