From d8ab6e129d75d7c3f21a7909bf811a3de65faea8 Mon Sep 17 00:00:00 2001 From: Don Brady Date: Wed, 5 Feb 2020 14:01:39 -0700 Subject: 12235 Add libzutil for libzfs or libzpool consumers Portions contributed by: Jerry Jelinek Reviewed by: Matthew Ahrens Reviewed by: Brian Behlendorf Reviewed by: C Fraire Reviewed by: Jason King Approved by: Dan McDonald --- usr/src/lib/libzfs/common/libzfs_util.c | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) (limited to 'usr/src/lib/libzfs/common/libzfs_util.c') diff --git a/usr/src/lib/libzfs/common/libzfs_util.c b/usr/src/lib/libzfs/common/libzfs_util.c index 75eb9722b3..3285cf7ce0 100644 --- a/usr/src/lib/libzfs/common/libzfs_util.c +++ b/usr/src/lib/libzfs/common/libzfs_util.c @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2019 Joyent, Inc. + * Copyright 2020 Joyent, Inc. * Copyright (c) 2011, 2017 by Delphix. All rights reserved. * Copyright 2016 Igor Kozhukhov * Copyright (c) 2017 Datto Inc. @@ -31,6 +31,7 @@ * Internal utility routines for the ZFS library. */ +#include #include #include #include @@ -38,8 +39,6 @@ #include #include #include -#include -#include #include #include #include @@ -54,6 +53,7 @@ #include "zfs_prop.h" #include "zfs_comutil.h" #include "zfeature_common.h" +#include int libzfs_errno(libzfs_handle_t *hdl) @@ -630,15 +630,6 @@ zfs_strdup(libzfs_handle_t *hdl, const char *str) return (ret); } -/* - * Convert a number to an appropriately human-readable output. - */ -void -zfs_nicenum(uint64_t num, char *buf, size_t buflen) -{ - nicenum(num, buf, buflen); -} - void libzfs_print_on_error(libzfs_handle_t *hdl, boolean_t printerr) { @@ -1622,20 +1613,3 @@ zfs_get_hole_count(const char *path, uint64_t *count, uint64_t *bs) } return (0); } - -ulong_t -get_system_hostid(void) -{ - char *env; - - /* - * Allow the hostid to be subverted for testing. - */ - env = getenv("ZFS_HOSTID"); - if (env) { - ulong_t hostid = strtoull(env, NULL, 16); - return (hostid & 0xFFFFFFFF); - } - - return (gethostid()); -} -- cgit v1.2.3