From 757df529280d789029bb91761e31031c45c68b8f Mon Sep 17 00:00:00 2001 From: наб Date: Sat, 15 May 2021 12:35:46 +0200 Subject: libzfs: add zfs_get_underlying_type. Stop including libzfs_impl.h in cmd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Brian Behlendorf Reviewed-by: Ryan Moeller Signed-off-by: Ahelenia Ziemiańska Closes #12116 --- cmd/zpool_influxdb/zpool_influxdb.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'cmd/zpool_influxdb') diff --git a/cmd/zpool_influxdb/zpool_influxdb.c b/cmd/zpool_influxdb/zpool_influxdb.c index 71ffcb253..5dc39afe8 100644 --- a/cmd/zpool_influxdb/zpool_influxdb.c +++ b/cmd/zpool_influxdb/zpool_influxdb.c @@ -71,7 +71,7 @@ #include #include #include -#include +#include #define POOL_MEASUREMENT "zpool_stats" #define SCAN_MEASUREMENT "zpool_scan_stats" @@ -101,9 +101,10 @@ typedef int (*stat_printer_f)(nvlist_t *, const char *, const char *); * caller is responsible for freeing result */ static char * -escape_string(char *s) +escape_string(const char *s) { - char *c, *d; + const char *c; + char *d; char *t = (char *)malloc(ZFS_MAX_DATASET_NAME_LEN * 2); if (t == NULL) { fprintf(stderr, "error: cannot allocate memory\n"); @@ -714,7 +715,7 @@ print_stats(zpool_handle_t *zhp, void *data) /* if not this pool return quickly */ if (data && - strncmp(data, zhp->zpool_name, ZFS_MAX_DATASET_NAME_LEN) != 0) { + strncmp(data, zpool_get_name(zhp), ZFS_MAX_DATASET_NAME_LEN) != 0) { zpool_close(zhp); return (0); } @@ -742,7 +743,7 @@ print_stats(zpool_handle_t *zhp, void *data) return (3); } - pool_name = escape_string(zhp->zpool_name); + pool_name = escape_string(zpool_get_name(zhp)); err = print_recursive_stats(print_summary_stats, nvroot, pool_name, NULL, 1); /* if any of these return an error, skip the rest */ -- cgit v1.2.3