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
        
*** 19,28 ****
--- 19,29 ----
   * CDDL HEADER END
   */
  
  /*
   * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+  * Copyright 2016 Nexenta Systems, Inc.  All rights reserved.
   */
  
  #ifndef _FMD_API_H
  #define _FMD_API_H
  
*** 89,99 ****
  typedef struct fmd_stat {
          char fmds_name[32];             /* statistic name */
          uint_t fmds_type;               /* statistic type (see above) */
          char fmds_desc[64];             /* statistic description */
          union {
!                 int bool;               /* FMD_TYPE_BOOL */
                  int32_t i32;            /* FMD_TYPE_INT32 */
                  uint32_t ui32;          /* FMD_TYPE_UINT32 */
                  int64_t i64;            /* FMD_TYPE_INT64 */
                  uint64_t ui64;          /* FMD_TYPE_UINT64, TIME, SIZE */
                  char *str;              /* FMD_TYPE_STRING */
--- 90,100 ----
  typedef struct fmd_stat {
          char fmds_name[32];             /* statistic name */
          uint_t fmds_type;               /* statistic type (see above) */
          char fmds_desc[64];             /* statistic description */
          union {
!                 int b;                  /* FMD_TYPE_BOOL */
                  int32_t i32;            /* FMD_TYPE_INT32 */
                  uint32_t ui32;          /* FMD_TYPE_UINT32 */
                  int64_t i64;            /* FMD_TYPE_INT64 */
                  uint64_t ui64;          /* FMD_TYPE_UINT64, TIME, SIZE */
                  char *str;              /* FMD_TYPE_STRING */
*** 135,144 ****
--- 136,154 ----
  
  extern void fmd_hdl_opendict(fmd_hdl_t *, const char *);
  extern struct topo_hdl *fmd_hdl_topo_hold(fmd_hdl_t *, int);
  extern void fmd_hdl_topo_rele(fmd_hdl_t *, struct topo_hdl *);
  
+ typedef struct fmd_hdl_topo_node_info {
+         const char *device;
+         nvlist_t *fru;
+         nvlist_t *resource;
+ } fmd_hdl_topo_node_info_t;
+ 
+ extern fmd_hdl_topo_node_info_t *fmd_hdl_topo_node_get_by_devid(
+     fmd_hdl_t *hdl, char *device);
+ 
  #define FMD_NOSLEEP             0x0     /* do not sleep or retry on failure */
  #define FMD_SLEEP               0x1     /* sleep or retry if alloc fails */
  
  extern void *fmd_hdl_alloc(fmd_hdl_t *, size_t, int);
  extern void *fmd_hdl_zalloc(fmd_hdl_t *, size_t, int);