]> granicus.if.org Git - zfs/commitdiff
Fix undefined reference to `libzfs_fru_compare'
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 24 Mar 2017 01:24:09 +0000 (18:24 -0700)
committerGitHub <noreply@github.com>
Fri, 24 Mar 2017 01:24:09 +0000 (18:24 -0700)
Add trivial libzfs_fru_compare() function which can be used when
HAVE_LIBTOPO is not defined.  The only caller is find_vdev() and
this function should never be reached because search_fru must be
NULL unless HAVE_LIBTOPO is defined.

Rename _HAS_FMD_TOPO to existing HAVE_LIBTOPO which was
originally added for this purpose.  This macro will never be defined.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #5402
Closes #5909

cmd/zed/agents/zfs_diagnosis.c
cmd/zed/agents/zfs_retire.c
lib/libzfs/libzfs_fru.c

index 2f2a26cd96aa700cc9632c2bb416d068aeb24a5f..70487349922efa4564c63a5ae10a339285530c79 100644 (file)
@@ -377,7 +377,7 @@ zfs_case_solve(fmd_hdl_t *hdl, zfs_case_t *zcp, const char *faultname,
        nvlist_t *detector, *fault;
        boolean_t serialize;
        nvlist_t *fru = NULL;
-#ifdef _HAS_FMD_TOPO
+#ifdef HAVE_LIBTOPO
        nvlist_t *fmri;
        topo_hdl_t *thp;
        int err;
@@ -400,7 +400,7 @@ zfs_case_solve(fmd_hdl_t *hdl, zfs_case_t *zcp, const char *faultname,
                    zcp->zc_data.zc_vdev_guid);
        }
 
-#ifdef _HAS_FMD_TOPO
+#ifdef HAVE_LIBTOPO
        /*
         * We also want to make sure that the detector (pool or vdev) properly
         * reflects the diagnosed state, when the fault corresponds to internal
index 444f23ac8fd5cb19575fe5c42aac7d18d4bbe9b9..c1349fb304aa053a8dc138db40a8734f97236235 100644 (file)
@@ -177,7 +177,7 @@ find_by_guid(libzfs_handle_t *zhdl, uint64_t pool_guid, uint64_t vdev_guid,
        return (zhp);
 }
 
-#ifdef _HAS_FMD_TOPO
+#ifdef HAVE_LIBTOPO
 static int
 search_pool(zpool_handle_t *zhp, void *data)
 {
@@ -218,7 +218,7 @@ find_by_fru(libzfs_handle_t *zhdl, const char *fru, nvlist_t **vdevp)
        *vdevp = cb.cb_vdev;
        return (cb.cb_zhp);
 }
-#endif /* _HAS_FMD_TOPO */
+#endif /* HAVE_LIBTOPO */
 
 /*
  * Given a vdev, attempt to replace it with every known spare until one
@@ -289,7 +289,7 @@ zfs_vdev_repair(fmd_hdl_t *hdl, nvlist_t *nvl)
        zfs_retire_data_t *zdp = fmd_hdl_getspecific(hdl);
        zfs_retire_repaired_t *zrp;
        uint64_t pool_guid, vdev_guid;
-#ifdef _HAS_FMD_TOPO
+#ifdef HAVE_LIBTOPO
        nvlist_t *asru;
 #endif
 
@@ -315,7 +315,7 @@ zfs_vdev_repair(fmd_hdl_t *hdl, nvlist_t *nvl)
                        return;
        }
 
-#ifdef _HAS_FMD_TOPO
+#ifdef HAVE_LIBTOPO
        asru = fmd_nvl_alloc(hdl, FMD_SLEEP);
 
        (void) nvlist_add_uint8(asru, FM_VERSION, ZFS_SCHEME_VERSION0);
@@ -477,7 +477,7 @@ zfs_retire_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl,
                }
 
                if (is_disk) {
-#ifdef _HAS_FMD_TOPO
+#ifdef HAVE_LIBTOPO
                        /*
                         * This is a disk fault.  Lookup the FRU, convert it to
                         * an FMRI string, and attempt to find a matching vdev.
index 6be927f809bd155933c9f9f2a8b309c475828a89..bb278aa7bf49b9980a6746f85a7306cad3c6f101 100644 (file)
@@ -455,6 +455,15 @@ libzfs_fru_clear(libzfs_handle_t *hdl, boolean_t final)
 
 #else /* HAVE_LIBTOPO */
 
+/*
+ * Compare to two FRUs, ignoring any authority information.
+ */
+boolean_t
+libzfs_fru_compare(libzfs_handle_t *hdl, const char *a, const char *b)
+{
+       return (B_FALSE);
+}
+
 /*
  * Clear memory associated with the FRU hash.
  */