zfs: merge openzfs/zfs@afa7b3484 (master) into main

Notable upstream pull request merges:
  #12149: Multiple man-pages: Move to appropriate section
  #12158: Re-embed multilist_t storage
  #12191: Convert non-libzpool libraries to -fvisibility=hidden
  #12196: Unify manpage makefiles, move pages to better sexions, ...
  #12210: libzutil: import filtering optimisation
  #12212: Remove pool io kstats

Obtained from:	OpenZFS
OpenZFS commit:	afa7b34845
This commit is contained in:
Martin Matuska 2021-06-13 04:03:58 +02:00
commit 3ff01b231d
145 changed files with 4903 additions and 5210 deletions

View file

@ -40,6 +40,16 @@
# xargs -n1 | sort | uniq -d; # xargs -n1 | sort | uniq -d;
# done # done
# 20210613: Rename OpenZFS manual pages
OLD_FILES+=usr/share/man/man5/spl-module-parameters.5.gz
OLD_FILES+=usr/share/man/man5/zfs-events.5.gz
OLD_FILES+=usr/share/man/man5/zfs-module-parameters.5.gz
OLD_FILES+=usr/share/man/man8/zfsconcepts.8
OLD_FILES+=usr/share/man/man8/zfsprops.8
OLD_FILES+=usr/share/man/man5/zpool-features.5.gz
OLD_FILES+=usr/share/man/man8/zpoolconcepts.8
OLD_FILES+=usr/share/man/man8/zpoolprops.8
# 20210611: Remove svn and svnlite # 20210611: Remove svn and svnlite
OLD_FILES+=usr/bin/svn OLD_FILES+=usr/bin/svn
OLD_FILES+=usr/bin/svnadmin OLD_FILES+=usr/bin/svnadmin

View file

@ -3,6 +3,7 @@
ZFSTOP= ${SRCTOP}/sys/contrib/openzfs ZFSTOP= ${SRCTOP}/sys/contrib/openzfs
.PATH: ${ZFSTOP}/cmd/zfs .PATH: ${ZFSTOP}/cmd/zfs
.PATH: ${ZFSTOP}/man/man7
.PATH: ${ZFSTOP}/man/man8 .PATH: ${ZFSTOP}/man/man8
.PATH: ${ZFSTOP}/module/os/freebsd/spl .PATH: ${ZFSTOP}/module/os/freebsd/spl
@ -34,8 +35,8 @@ MAN= \
zfs-upgrade.8 \ zfs-upgrade.8 \
zfs-userspace.8 \ zfs-userspace.8 \
zfs-wait.8 \ zfs-wait.8 \
zfsconcepts.8 \ zfsconcepts.7 \
zfsprops.8 zfsprops.7
MLINKS= \ MLINKS= \
zfs-allow.8 zfs-unallow.8 \ zfs-allow.8 zfs-unallow.8 \
zfs-hold.8 zfs-release.8 \ zfs-hold.8 zfs-release.8 \

View file

@ -2,7 +2,9 @@
ZFSTOP= ${SRCTOP}/sys/contrib/openzfs ZFSTOP= ${SRCTOP}/sys/contrib/openzfs
.PATH: ${ZFSTOP}/man/man4
.PATH: ${ZFSTOP}/man/man5 .PATH: ${ZFSTOP}/man/man5
.PATH: ${ZFSTOP}/man/man7
.PATH: ${ZFSTOP}/man/man8 .PATH: ${ZFSTOP}/man/man8
.PATH: ${ZFSTOP}/cmd/zpool .PATH: ${ZFSTOP}/cmd/zpool
.PATH: ${ZFSTOP}/cmd/zpool/os/freebsd .PATH: ${ZFSTOP}/cmd/zpool/os/freebsd
@ -11,9 +13,8 @@ ZFSTOP= ${SRCTOP}/sys/contrib/openzfs
PACKAGE= runtime PACKAGE= runtime
PROG= zpool PROG= zpool
MAN= \ MAN= \
spl-module-parameters.5 \ spl.4 \
zfs-events.5 \ zfs.4 \
zfs-module-parameters.5 \
zpool.8 \ zpool.8 \
zpool-add.8 \ zpool-add.8 \
zpool-attach.8 \ zpool-attach.8 \
@ -24,7 +25,7 @@ MAN= \
zpool-detach.8 \ zpool-detach.8 \
zpool-events.8 \ zpool-events.8 \
zpool-export.8 \ zpool-export.8 \
zpool-features.5 \ zpool-features.7 \
zpool-get.8 \ zpool-get.8 \
zpool-history.8 \ zpool-history.8 \
zpool-import.8 \ zpool-import.8 \
@ -45,8 +46,8 @@ MAN= \
zpool-trim.8 \ zpool-trim.8 \
zpool-upgrade.8 \ zpool-upgrade.8 \
zpool-wait.8 \ zpool-wait.8 \
zpoolconcepts.8 \ zpoolconcepts.7 \
zpoolprops.8 zpoolprops.7
MLINKS= \ MLINKS= \
zpool-offline.8 zpool-online.8 \ zpool-offline.8 zpool-online.8 \
zpool-get.8 zpool-set.8 zpool-get.8 zpool-set.8

View file

@ -26,7 +26,8 @@ jobs:
xfslibs-dev libattr1-dev libacl1-dev libudev-dev libdevmapper-dev \ xfslibs-dev libattr1-dev libacl1-dev libudev-dev libdevmapper-dev \
libssl-dev libffi-dev libaio-dev libelf-dev libmount-dev \ libssl-dev libffi-dev libaio-dev libelf-dev libmount-dev \
libpam0g-dev pamtester python-dev python-setuptools python-cffi \ libpam0g-dev pamtester python-dev python-setuptools python-cffi \
python3 python3-dev python3-setuptools python3-cffi libcurl4-openssl-dev python-packaging python3 python3-dev python3-setuptools python3-cffi \
libcurl4-openssl-dev python3-packaging
- name: Autogen.sh - name: Autogen.sh
run: | run: |
sh autogen.sh sh autogen.sh

View file

@ -22,7 +22,8 @@ jobs:
xfslibs-dev libattr1-dev libacl1-dev libudev-dev libdevmapper-dev \ xfslibs-dev libattr1-dev libacl1-dev libudev-dev libdevmapper-dev \
libssl-dev libffi-dev libaio-dev libelf-dev libmount-dev \ libssl-dev libffi-dev libaio-dev libelf-dev libmount-dev \
libpam0g-dev pamtester python-dev python-setuptools python-cffi \ libpam0g-dev pamtester python-dev python-setuptools python-cffi \
python3 python3-dev python3-setuptools python3-cffi libcurl4-openssl-dev python-packaging python3 python3-dev python3-setuptools python3-cffi \
python3-packaging libcurl4-openssl-dev
- name: Autogen.sh - name: Autogen.sh
run: | run: |
sh autogen.sh sh autogen.sh

View file

@ -22,8 +22,8 @@ jobs:
xfslibs-dev libattr1-dev libacl1-dev libudev-dev libdevmapper-dev \ xfslibs-dev libattr1-dev libacl1-dev libudev-dev libdevmapper-dev \
libssl-dev libffi-dev libaio-dev libelf-dev libmount-dev \ libssl-dev libffi-dev libaio-dev libelf-dev libmount-dev \
libpam0g-dev \ libpam0g-dev \
python-dev python-setuptools python-cffi \ python-dev python-setuptools python-cffi python-packaging \
python3 python3-dev python3-setuptools python3-cffi python3 python3-dev python3-setuptools python3-cffi python3-packaging
- name: Autogen.sh - name: Autogen.sh
run: | run: |
sh autogen.sh sh autogen.sh

View file

@ -38,6 +38,7 @@
#include <sys/fs/zfs.h> #include <sys/fs/zfs.h>
#include <sys/fm/protocol.h> #include <sys/fm/protocol.h>
#include <sys/fm/fs/zfs.h> #include <sys/fm/fs/zfs.h>
#include <libzutil.h>
#include <libzfs.h> #include <libzfs.h>
#include <string.h> #include <string.h>
@ -240,7 +241,7 @@ replace_with_spare(fmd_hdl_t *hdl, zpool_handle_t *zhp, nvlist_t *vdev)
ZPOOL_CONFIG_CHILDREN, &spares[s], 1); ZPOOL_CONFIG_CHILDREN, &spares[s], 1);
fmd_hdl_debug(hdl, "zpool_vdev_replace '%s' with spare '%s'", fmd_hdl_debug(hdl, "zpool_vdev_replace '%s' with spare '%s'",
dev_name, basename(spare_name)); dev_name, zfs_basename(spare_name));
if (zpool_vdev_attach(zhp, dev_name, spare_name, if (zpool_vdev_attach(zhp, dev_name, spare_name,
replacement, B_TRUE, rebuild) == 0) { replacement, B_TRUE, rebuild) == 0) {

View file

@ -52,3 +52,6 @@ install-data-hook:
ln -s "$(zedexecdir)/$${f}" "$(DESTDIR)$(zedconfdir)"; \ ln -s "$(zedexecdir)/$${f}" "$(DESTDIR)$(zedconfdir)"; \
done done
chmod 0600 "$(DESTDIR)$(zedconfdir)/zed.rc" chmod 0600 "$(DESTDIR)$(zedconfdir)/zed.rc"
# False positive: 1>&"${ZED_FLOCK_FD}" looks suspiciously similar to a >&filename bash extension
CHECKBASHISMS_IGNORE = -e 'should be >word 2>&1' -e '&"$${ZED_FLOCK_FD}"'

View file

@ -12,15 +12,11 @@
zed_exit_if_ignoring_this_event zed_exit_if_ignoring_this_event
lockfile="$(basename -- "${ZED_DEBUG_LOG}").lock" zed_lock "${ZED_DEBUG_LOG}"
{
printenv | sort
echo
} 1>&"${ZED_FLOCK_FD}"
zed_unlock "${ZED_DEBUG_LOG}"
umask 077
zed_lock "${lockfile}"
exec >> "${ZED_DEBUG_LOG}"
printenv | sort
echo
exec >&-
zed_unlock "${lockfile}"
exit 0 exit 0

View file

@ -42,6 +42,7 @@ fi
msg="${msg} delay=$((ZEVENT_ZIO_DELAY / 1000000))ms" msg="${msg} delay=$((ZEVENT_ZIO_DELAY / 1000000))ms"
# list the bookmark data together # list the bookmark data together
# shellcheck disable=SC2153
[ -n "${ZEVENT_ZIO_OBJSET}" ] && \ [ -n "${ZEVENT_ZIO_OBJSET}" ] && \
msg="${msg} bookmark=${ZEVENT_ZIO_OBJSET}:${ZEVENT_ZIO_OBJECT}:${ZEVENT_ZIO_LEVEL}:${ZEVENT_ZIO_BLKID}" msg="${msg} bookmark=${ZEVENT_ZIO_OBJSET}:${ZEVENT_ZIO_OBJECT}:${ZEVENT_ZIO_LEVEL}:${ZEVENT_ZIO_BLKID}"

View file

@ -3,9 +3,8 @@
# Track changes to enumerated pools for use in early-boot # Track changes to enumerated pools for use in early-boot
set -ef set -ef
FSLIST_DIR="@sysconfdir@/zfs/zfs-list.cache" FSLIST="@sysconfdir@/zfs/zfs-list.cache/${ZEVENT_POOL}"
FSLIST_TMP="@runstatedir@/zfs-list.cache.new" FSLIST_TMP="@runstatedir@/zfs-list.cache@${ZEVENT_POOL}"
FSLIST="${FSLIST_DIR}/${ZEVENT_POOL}"
# If the pool specific cache file is not writeable, abort # If the pool specific cache file is not writeable, abort
[ -w "${FSLIST}" ] || exit 0 [ -w "${FSLIST}" ] || exit 0
@ -19,15 +18,15 @@ zed_check_cmd "${ZFS}" sort diff
# If we are acting on a snapshot, we have nothing to do # If we are acting on a snapshot, we have nothing to do
[ "${ZEVENT_HISTORY_DSNAME%@*}" = "${ZEVENT_HISTORY_DSNAME}" ] || exit 0 [ "${ZEVENT_HISTORY_DSNAME%@*}" = "${ZEVENT_HISTORY_DSNAME}" ] || exit 0
# We obtain a lock on zfs-list to avoid any simultaneous writes. # We lock the output file to avoid simultaneous writes.
# If we run into trouble, log and drop the lock # If we run into trouble, log and drop the lock
abort_alter() { abort_alter() {
zed_log_msg "Error updating zfs-list.cache!" zed_log_msg "Error updating zfs-list.cache for ${ZEVENT_POOL}!"
zed_unlock zfs-list zed_unlock "${FSLIST}"
} }
finished() { finished() {
zed_unlock zfs-list zed_unlock "${FSLIST}"
trap - EXIT trap - EXIT
exit 0 exit 0
} }
@ -37,7 +36,7 @@ case "${ZEVENT_HISTORY_INTERNAL_NAME}" in
;; ;;
export) export)
zed_lock zfs-list zed_lock "${FSLIST}"
trap abort_alter EXIT trap abort_alter EXIT
echo > "${FSLIST}" echo > "${FSLIST}"
finished finished
@ -63,7 +62,7 @@ case "${ZEVENT_HISTORY_INTERNAL_NAME}" in
;; ;;
esac esac
zed_lock zfs-list zed_lock "${FSLIST}"
trap abort_alter EXIT trap abort_alter EXIT
PROPS="name,mountpoint,canmount,atime,relatime,devices,exec\ PROPS="name,mountpoint,canmount,atime,relatime,devices,exec\
@ -79,7 +78,7 @@ PROPS="name,mountpoint,canmount,atime,relatime,devices,exec\
sort "${FSLIST_TMP}" -o "${FSLIST_TMP}" sort "${FSLIST_TMP}" -o "${FSLIST_TMP}"
# Don't modify the file if it hasn't changed # Don't modify the file if it hasn't changed
diff -q "${FSLIST_TMP}" "${FSLIST}" || mv "${FSLIST_TMP}" "${FSLIST}" diff -q "${FSLIST_TMP}" "${FSLIST}" || cat "${FSLIST_TMP}" > "${FSLIST}"
rm -f "${FSLIST_TMP}" rm -f "${FSLIST_TMP}"
finished finished

View file

@ -126,7 +126,7 @@ zed_lock()
# Obtain a lock on the file bound to the given file descriptor. # Obtain a lock on the file bound to the given file descriptor.
# #
eval "exec ${fd}> '${lockfile}'" eval "exec ${fd}>> '${lockfile}'"
if ! err="$(flock --exclusive "${fd}" 2>&1)"; then if ! err="$(flock --exclusive "${fd}" 2>&1)"; then
zed_log_err "failed to lock \"${lockfile}\": ${err}" zed_log_err "failed to lock \"${lockfile}\": ${err}"
fi fi

View file

@ -728,6 +728,32 @@ finish_progress(char *done)
pt_header = NULL; pt_header = NULL;
} }
/* This function checks if the passed fd refers to /dev/null or /dev/zero */
#ifdef __linux__
static boolean_t
is_dev_nullzero(int fd)
{
struct stat st;
fstat(fd, &st);
return (major(st.st_rdev) == 1 && (minor(st.st_rdev) == 3 /* null */ ||
minor(st.st_rdev) == 5 /* zero */));
}
#endif
static void
note_dev_error(int err, int fd)
{
#ifdef __linux__
if (err == EINVAL && is_dev_nullzero(fd)) {
(void) fprintf(stderr,
gettext("Error: Writing directly to /dev/{null,zero} files"
" on certain kernels is not currently implemented.\n"
"(As a workaround, "
"try \"zfs send [...] | cat > /dev/null\")\n"));
}
#endif
}
static int static int
zfs_mount_and_share(libzfs_handle_t *hdl, const char *dataset, zfs_type_t type) zfs_mount_and_share(libzfs_handle_t *hdl, const char *dataset, zfs_type_t type)
{ {
@ -4572,11 +4598,16 @@ zfs_do_send(int argc, char **argv)
err = zfs_send_saved(zhp, &flags, STDOUT_FILENO, err = zfs_send_saved(zhp, &flags, STDOUT_FILENO,
resume_token); resume_token);
if (err != 0)
note_dev_error(errno, STDOUT_FILENO);
zfs_close(zhp); zfs_close(zhp);
return (err != 0); return (err != 0);
} else if (resume_token != NULL) { } else if (resume_token != NULL) {
return (zfs_send_resume(g_zfs, &flags, STDOUT_FILENO, err = zfs_send_resume(g_zfs, &flags, STDOUT_FILENO,
resume_token)); resume_token);
if (err != 0)
note_dev_error(errno, STDOUT_FILENO);
return (err);
} }
if (flags.skipmissing && !flags.replicate) { if (flags.skipmissing && !flags.replicate) {
@ -4627,6 +4658,8 @@ zfs_do_send(int argc, char **argv)
err = zfs_send_one(zhp, fromname, STDOUT_FILENO, &flags, err = zfs_send_one(zhp, fromname, STDOUT_FILENO, &flags,
redactbook); redactbook);
zfs_close(zhp); zfs_close(zhp);
if (err != 0)
note_dev_error(errno, STDOUT_FILENO);
return (err != 0); return (err != 0);
} }
@ -4703,6 +4736,7 @@ zfs_do_send(int argc, char **argv)
nvlist_free(dbgnv); nvlist_free(dbgnv);
} }
zfs_close(zhp); zfs_close(zhp);
note_dev_error(errno, STDOUT_FILENO);
return (err != 0); return (err != 0);
} }

View file

@ -533,7 +533,7 @@ usage(boolean_t requested)
(void) fprintf(fp, "YES disabled | enabled | active\n"); (void) fprintf(fp, "YES disabled | enabled | active\n");
(void) fprintf(fp, gettext("\nThe feature@ properties must be " (void) fprintf(fp, gettext("\nThe feature@ properties must be "
"appended with a feature name.\nSee zpool-features(5).\n")); "appended with a feature name.\nSee zpool-features(7).\n"));
} }
/* /*
@ -8248,7 +8248,7 @@ status_callback(zpool_handle_t *zhp, void *data)
printf_color(ANSI_YELLOW, gettext("Enable all features using " printf_color(ANSI_YELLOW, gettext("Enable all features using "
"'zpool upgrade'. Once this is done,\n\tthe pool may no " "'zpool upgrade'. Once this is done,\n\tthe pool may no "
"longer be accessible by software that does not support\n\t" "longer be accessible by software that does not support\n\t"
"the features. See zpool-features(5) for details.\n")); "the features. See zpool-features(7) for details.\n"));
break; break;
case ZPOOL_STATUS_COMPATIBILITY_ERR: case ZPOOL_STATUS_COMPATIBILITY_ERR:
@ -8951,7 +8951,7 @@ upgrade_list_disabled_cb(zpool_handle_t *zhp, void *arg)
"pool may become incompatible with " "pool may become incompatible with "
"software\nthat does not support " "software\nthat does not support "
"the feature. See " "the feature. See "
"zpool-features(5) for " "zpool-features(7) for "
"details.\n\n" "details.\n\n"
"Note that the pool " "Note that the pool "
"'compatibility' feature can be " "'compatibility' feature can be "

View file

@ -1360,7 +1360,7 @@
"type": "row" "type": "row"
}, },
{ {
"content": "I/O requests that are satisfied by accessing pool devices are managed by the ZIO scheduler.\nThe total latency is measured from the start of the I/O to completion by the disk.\nLatency through each queue is shown prior to its submission to the disk queue.\n\nThis view is useful for observing the effects of tuning the ZIO scheduler min and max values\n(see zfs-module-parameters(5) and [ZFS on Linux Module Parameters](https://openzfs.github.io/openzfs-docs/Performance%20and%20tuning/ZFS%20on%20Linux%20Module%20Parameters.html)):\n+ *zfs_vdev_max_active* controls the ZIO scheduler's disk queue depth (do not confuse with the block device's nr_requests)\n+ *zfs_vdev_sync_read_min_active* and *zfs_vdev_sync_read_max_active* control the synchronous queue for reads: most reads are sync\n+ *zfs_vdev_sync_write_min_active* and *zfs_vdev_sync_write_max_active* control the synchronous queue for writes: \nusually metadata or user data depending on the \"sync\" property setting or I/Os that are requested to be flushed\n+ *zfs_vdev_async_read_min_active* and *zfs_vdev_async_read_max_active* control the asynchronous queue for reads: usually prefetches\n+ *zfs_vdev_async_write_min_active* and *zfs_vdev_async_write_max_active* control the asynchronous queue for writes: \nusually the bulk of all writes at transaction group (txg) commit\n+ *zfs_vdev_scrub_min_active* and *zfs_vdev_scrub_max_active* controls the scan reads: usually scrub or resilver\n\n", "content": "I/O requests that are satisfied by accessing pool devices are managed by the ZIO scheduler.\nThe total latency is measured from the start of the I/O to completion by the disk.\nLatency through each queue is shown prior to its submission to the disk queue.\n\nThis view is useful for observing the effects of tuning the ZIO scheduler min and max values\n(see zfs(4) and [ZFS on Linux Module Parameters](https://openzfs.github.io/openzfs-docs/Performance%20and%20tuning/ZFS%20on%20Linux%20Module%20Parameters.html)):\n+ *zfs_vdev_max_active* controls the ZIO scheduler's disk queue depth (do not confuse with the block device's nr_requests)\n+ *zfs_vdev_sync_read_min_active* and *zfs_vdev_sync_read_max_active* control the synchronous queue for reads: most reads are sync\n+ *zfs_vdev_sync_write_min_active* and *zfs_vdev_sync_write_max_active* control the synchronous queue for writes: \nusually metadata or user data depending on the \"sync\" property setting or I/Os that are requested to be flushed\n+ *zfs_vdev_async_read_min_active* and *zfs_vdev_async_read_max_active* control the asynchronous queue for reads: usually prefetches\n+ *zfs_vdev_async_write_min_active* and *zfs_vdev_async_write_max_active* control the asynchronous queue for writes: \nusually the bulk of all writes at transaction group (txg) commit\n+ *zfs_vdev_scrub_min_active* and *zfs_vdev_scrub_max_active* controls the scan reads: usually scrub or resilver\n\n",
"datasource": "${DS_MACBOOK-INFLUX}", "datasource": "${DS_MACBOOK-INFLUX}",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -1664,4 +1664,4 @@
"list": [] "list": []
}, },
"version": 2 "version": 2
} }

View file

@ -54,6 +54,9 @@ if BUILD_FREEBSD
AM_CPPFLAGS += -DTEXT_DOMAIN=\"zfs-freebsd-user\" AM_CPPFLAGS += -DTEXT_DOMAIN=\"zfs-freebsd-user\"
endif endif
AM_CPPFLAGS += -D"strtok(...)=strtok(__VA_ARGS__) __attribute__((deprecated(\"Use strtok_r(3) instead!\")))" AM_CPPFLAGS += -D"strtok(...)=strtok(__VA_ARGS__) __attribute__((deprecated(\"Use strtok_r(3) instead!\")))"
AM_CPPFLAGS += -D"__xpg_basename(...)=__xpg_basename(__VA_ARGS__) __attribute__((deprecated(\"basename(3) is underspecified. Use zfs_basename() instead!\")))"
AM_CPPFLAGS += -D"basename(...)=basename(__VA_ARGS__) __attribute__((deprecated(\"basename(3) is underspecified. Use zfs_basename() instead!\")))"
AM_CPPFLAGS += -D"dirname(...)=dirname(__VA_ARGS__) __attribute__((deprecated(\"dirname(3) is underspecified. Use zfs_dirnamelen() instead!\")))"
AM_LDFLAGS = $(DEBUG_LDFLAGS) AM_LDFLAGS = $(DEBUG_LDFLAGS)
AM_LDFLAGS += $(ASAN_LDFLAGS) AM_LDFLAGS += $(ASAN_LDFLAGS)

View file

@ -46,6 +46,21 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYZFS], [
]) ])
AC_SUBST(DEFINE_PYZFS) AC_SUBST(DEFINE_PYZFS)
dnl #
dnl # Python "packaging" (or, failing that, "distlib") module is required to build and install pyzfs
dnl #
AS_IF([test "x$enable_pyzfs" = xcheck -o "x$enable_pyzfs" = xyes], [
ZFS_AC_PYTHON_MODULE([packaging], [], [
ZFS_AC_PYTHON_MODULE([distlib], [], [
AS_IF([test "x$enable_pyzfs" = xyes], [
AC_MSG_ERROR("Python $PYTHON_VERSION packaging and distlib modules are not installed")
], [test "x$enable_pyzfs" != xno], [
enable_pyzfs=no
])
])
])
])
dnl # dnl #
dnl # Require python-devel libraries dnl # Require python-devel libraries
dnl # dnl #

View file

@ -97,9 +97,18 @@ AC_DEFUN([AX_PYTHON_DEVEL],[
# Check for a version of Python >= 2.1.0 # Check for a version of Python >= 2.1.0
# #
AC_MSG_CHECKING([for a version of Python >= '2.1.0']) AC_MSG_CHECKING([for a version of Python >= '2.1.0'])
ac_supports_python_ver=`$PYTHON -c "import sys; \ ac_supports_python_ver=`cat<<EOD | $PYTHON -
ver = sys.version.split ()[[0]]; \ from __future__ import print_function;
print (ver >= '2.1.0')"` import sys;
try:
from packaging import version;
except ImportError:
from distlib import version;
ver = sys.version.split ()[[0]];
(tst_cmp, tst_ver) = ">= '2.1.0'".split ();
tst_ver = tst_ver.strip ("'");
eval ("print (version.LegacyVersion (ver)"+ tst_cmp +"version.LegacyVersion (tst_ver))")
EOD`
if test "$ac_supports_python_ver" != "True"; then if test "$ac_supports_python_ver" != "True"; then
if test -z "$PYTHON_NOVERSIONCHECK"; then if test -z "$PYTHON_NOVERSIONCHECK"; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
@ -126,9 +135,21 @@ to something else than an empty string.
# #
if test -n "$1"; then if test -n "$1"; then
AC_MSG_CHECKING([for a version of Python $1]) AC_MSG_CHECKING([for a version of Python $1])
ac_supports_python_ver=`$PYTHON -c "import sys; \ # Why the strip ()? Because if we don't, version.parse
ver = sys.version.split ()[[0]]; \ # will, for example, report 3.10.0 >= '3.11.0'
print (ver $1)"` ac_supports_python_ver=`cat<<EOD | $PYTHON -
from __future__ import print_function;
import sys;
try:
from packaging import version;
except ImportError:
from distlib import version;
ver = sys.version.split ()[[0]];
(tst_cmp, tst_ver) = "$1".split ();
tst_ver = tst_ver.strip ("'");
eval ("print (version.LegacyVersion (ver)"+ tst_cmp +"version.LegacyVersion (tst_ver))")
EOD`
if test "$ac_supports_python_ver" = "True"; then if test "$ac_supports_python_ver" = "True"; then
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
else else

View file

@ -171,9 +171,6 @@ AC_CONFIG_FILES([
lib/libzstd/Makefile lib/libzstd/Makefile
lib/libzutil/Makefile lib/libzutil/Makefile
man/Makefile man/Makefile
man/man1/Makefile
man/man5/Makefile
man/man8/Makefile
module/Kbuild module/Kbuild
module/Makefile module/Makefile
module/avl/Makefile module/avl/Makefile

View file

@ -1,11 +1,2 @@
export-zfs.sh *.sh
module-setup.sh *.service
mount-zfs.sh
parse-zfs.sh
zfs-generator.sh
zfs-lib.sh
zfs-load-key.sh
zfs-needshutdown.sh
zfs-env-bootfs.service
zfs-snapshot-bootfs.service
zfs-rollback-bootfs.service

View file

@ -10,7 +10,8 @@ pkgdracut_SCRIPTS = \
zfs-generator.sh \ zfs-generator.sh \
zfs-load-key.sh \ zfs-load-key.sh \
zfs-needshutdown.sh \ zfs-needshutdown.sh \
zfs-lib.sh zfs-lib.sh \
import-opts-generator.sh
pkgdracut_DATA = \ pkgdracut_DATA = \
zfs-env-bootfs.service \ zfs-env-bootfs.service \

View file

@ -0,0 +1,5 @@
#!/bin/sh
. /lib/dracut-zfs-lib.sh
echo ZPOOL_IMPORT_OPTS="$ZPOOL_IMPORT_OPTS"

View file

@ -104,29 +104,40 @@ install() {
if dracut_module_included "systemd"; then if dracut_module_included "systemd"; then
mkdir -p "${initdir}/$systemdsystemunitdir/zfs-import.target.wants" mkdir -p "${initdir}/$systemdsystemunitdir/zfs-import.target.wants"
for _item in scan cache ; do for _service in "zfs-import-scan.service" "zfs-import-cache.service" ; do
dracut_install @systemdunitdir@/zfs-import-$_item.service dracut_install "@systemdunitdir@/$_service"
if ! [ -L "${initdir}/$systemdsystemunitdir/zfs-import.target.wants"/zfs-import-$_item.service ]; then if ! [ -L "${initdir}/$systemdsystemunitdir/zfs-import.target.wants/$_service" ]; then
ln -s ../zfs-import-$_item.service "${initdir}/$systemdsystemunitdir/zfs-import.target.wants"/zfs-import-$_item.service ln -sf ../$_service "${initdir}/$systemdsystemunitdir/zfs-import.target.wants/$_service"
type mark_hostonly >/dev/null 2>&1 && mark_hostonly @systemdunitdir@/zfs-import-$_item.service type mark_hostonly >/dev/null 2>&1 && mark_hostonly "@systemdunitdir@/$_service"
fi fi
done done
inst "${moddir}"/zfs-env-bootfs.service "${systemdsystemunitdir}"/zfs-env-bootfs.service inst "${moddir}"/zfs-env-bootfs.service "${systemdsystemunitdir}"/zfs-env-bootfs.service
ln -s ../zfs-env-bootfs.service "${initdir}/${systemdsystemunitdir}/zfs-import.target.wants"/zfs-env-bootfs.service ln -s ../zfs-env-bootfs.service "${initdir}/${systemdsystemunitdir}/zfs-import.target.wants"/zfs-env-bootfs.service
type mark_hostonly >/dev/null 2>&1 && mark_hostonly @systemdunitdir@/zfs-env-bootfs.service type mark_hostonly >/dev/null 2>&1 && mark_hostonly @systemdunitdir@/zfs-env-bootfs.service
dracut_install systemd-ask-password dracut_install systemd-ask-password
dracut_install systemd-tty-ask-password-agent dracut_install systemd-tty-ask-password-agent
mkdir -p "${initdir}/$systemdsystemunitdir/initrd.target.wants" mkdir -p "${initdir}/$systemdsystemunitdir/initrd.target.wants"
dracut_install @systemdunitdir@/zfs-import.target dracut_install @systemdunitdir@/zfs-import.target
if ! [ -L "${initdir}/$systemdsystemunitdir/initrd.target.wants"/zfs-import.target ]; then if ! [ -L "${initdir}/$systemdsystemunitdir/initrd.target.wants"/zfs-import.target ]; then
ln -s ../zfs-import.target "${initdir}/$systemdsystemunitdir/initrd.target.wants"/zfs-import.target ln -s ../zfs-import.target "${initdir}/$systemdsystemunitdir/initrd.target.wants"/zfs-import.target
type mark_hostonly >/dev/null 2>&1 && mark_hostonly @systemdunitdir@/zfs-import.target type mark_hostonly >/dev/null 2>&1 && mark_hostonly @systemdunitdir@/zfs-import.target
fi fi
for _service in zfs-snapshot-bootfs.service zfs-rollback-bootfs.service ; do for _service in zfs-snapshot-bootfs.service zfs-rollback-bootfs.service ; do
inst "${moddir}"/$_service "${systemdsystemunitdir}"/$_service inst "${moddir}/$_service" "${systemdsystemunitdir}/$_service"
if ! [ -L "${initdir}/$systemdsystemunitdir/initrd.target.wants"/$_service ]; then if ! [ -L "${initdir}/$systemdsystemunitdir/initrd.target.wants/$_service" ]; then
ln -s ../$_service "${initdir}/$systemdsystemunitdir/initrd.target.wants"/$_service ln -s "../$_service" "${initdir}/$systemdsystemunitdir/initrd.target.wants/$_service"
fi fi
done done
# There isn't a pkg-config variable for this,
# and dracut doesn't automatically resolve anything this'd be next to
local systemdsystemenvironmentgeneratordir
systemdsystemenvironmentgeneratordir="$(pkg-config --variable=prefix systemd || echo "/usr")/lib/systemd/system-environment-generators"
mkdir -p "${initdir}/${systemdsystemenvironmentgeneratordir}"
inst "${moddir}"/import-opts-generator.sh "${systemdsystemenvironmentgeneratordir}"/zfs-import-opts.sh
fi fi
} }

View file

@ -14,7 +14,7 @@ ConditionPathIsDirectory=/sys/module/zfs
[Service] [Service]
Type=oneshot Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
ExecStart=@sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN ExecStart=@sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN ${ZPOOL_IMPORT_OPTS}
[Install] [Install]
WantedBy=zfs-import.target WantedBy=zfs-import.target

View file

@ -13,7 +13,7 @@ ConditionPathIsDirectory=/sys/module/zfs
[Service] [Service]
Type=oneshot Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
ExecStart=@sbindir@/zpool import -aN -o cachefile=none ExecStart=@sbindir@/zpool import -aN -o cachefile=none ${ZPOOL_IMPORT_OPTS}
[Install] [Install]
WantedBy=zfs-import.target WantedBy=zfs-import.target

View file

@ -24,7 +24,7 @@
*/ */
#ifndef _LIBNVPAIR_H #ifndef _LIBNVPAIR_H
#define _LIBNVPAIR_H #define _LIBNVPAIR_H extern __attribute__((visibility("default")))
#include <sys/nvpair.h> #include <sys/nvpair.h>
#include <stdlib.h> #include <stdlib.h>
@ -42,13 +42,13 @@ extern "C" {
* are all imported from <sys/nvpair.h> included above. * are all imported from <sys/nvpair.h> included above.
*/ */
extern int nvpair_value_match(nvpair_t *, int, char *, char **); _LIBNVPAIR_H int nvpair_value_match(nvpair_t *, int, char *, char **);
extern int nvpair_value_match_regex(nvpair_t *, int, char *, regex_t *, _LIBNVPAIR_H int nvpair_value_match_regex(nvpair_t *, int, char *, regex_t *,
char **); char **);
extern void nvlist_print(FILE *, nvlist_t *); _LIBNVPAIR_H void nvlist_print(FILE *, nvlist_t *);
int nvlist_print_json(FILE *, nvlist_t *); _LIBNVPAIR_H int nvlist_print_json(FILE *, nvlist_t *);
extern void dump_nvlist(nvlist_t *, int); _LIBNVPAIR_H void dump_nvlist(nvlist_t *, int);
/* /*
* Private nvlist printing interface that allows the caller some control * Private nvlist printing interface that allows the caller some control
@ -88,18 +88,18 @@ enum nvlist_indent_mode {
NVLIST_INDENT_TABBED /* Indent with tabstops */ NVLIST_INDENT_TABBED /* Indent with tabstops */
}; };
extern nvlist_prtctl_t nvlist_prtctl_alloc(void); _LIBNVPAIR_H nvlist_prtctl_t nvlist_prtctl_alloc(void);
extern void nvlist_prtctl_free(nvlist_prtctl_t); _LIBNVPAIR_H void nvlist_prtctl_free(nvlist_prtctl_t);
extern void nvlist_prt(nvlist_t *, nvlist_prtctl_t); _LIBNVPAIR_H void nvlist_prt(nvlist_t *, nvlist_prtctl_t);
/* Output stream */ /* Output stream */
extern void nvlist_prtctl_setdest(nvlist_prtctl_t, FILE *); _LIBNVPAIR_H void nvlist_prtctl_setdest(nvlist_prtctl_t, FILE *);
extern FILE *nvlist_prtctl_getdest(nvlist_prtctl_t); _LIBNVPAIR_H FILE *nvlist_prtctl_getdest(nvlist_prtctl_t);
/* Indentation mode, start indent, indent increment; default tabbed/0/1 */ /* Indentation mode, start indent, indent increment; default tabbed/0/1 */
extern void nvlist_prtctl_setindent(nvlist_prtctl_t, enum nvlist_indent_mode, _LIBNVPAIR_H void nvlist_prtctl_setindent(nvlist_prtctl_t,
int, int); enum nvlist_indent_mode, int, int);
extern void nvlist_prtctl_doindent(nvlist_prtctl_t, int); _LIBNVPAIR_H void nvlist_prtctl_doindent(nvlist_prtctl_t, int);
enum nvlist_prtctl_fmt { enum nvlist_prtctl_fmt {
NVLIST_FMT_MEMBER_NAME, /* name fmt; default "%s = " */ NVLIST_FMT_MEMBER_NAME, /* name fmt; default "%s = " */
@ -107,9 +107,10 @@ enum nvlist_prtctl_fmt {
NVLIST_FMT_BTWN_ARRAY /* between array members; default " " */ NVLIST_FMT_BTWN_ARRAY /* between array members; default " " */
}; };
extern void nvlist_prtctl_setfmt(nvlist_prtctl_t, enum nvlist_prtctl_fmt, _LIBNVPAIR_H void nvlist_prtctl_setfmt(nvlist_prtctl_t, enum nvlist_prtctl_fmt,
const char *); const char *);
extern void nvlist_prtctl_dofmt(nvlist_prtctl_t, enum nvlist_prtctl_fmt, ...); _LIBNVPAIR_H void nvlist_prtctl_dofmt(nvlist_prtctl_t, enum nvlist_prtctl_fmt,
...);
/* /*
* Function prototypes for interfaces that appoint a new rendering function * Function prototypes for interfaces that appoint a new rendering function
@ -139,7 +140,7 @@ extern void nvlist_prtctl_dofmt(nvlist_prtctl_t, enum nvlist_prtctl_fmt, ...);
*/ */
#define NVLIST_PRINTCTL_SVDECL(funcname, valtype) \ #define NVLIST_PRINTCTL_SVDECL(funcname, valtype) \
extern void funcname(nvlist_prtctl_t, \ _LIBNVPAIR_H void funcname(nvlist_prtctl_t, \
int (*)(nvlist_prtctl_t, void *, nvlist_t *, const char *, valtype), \ int (*)(nvlist_prtctl_t, void *, nvlist_t *, const char *, valtype), \
void *) void *)
@ -170,7 +171,7 @@ NVLIST_PRINTCTL_SVDECL(nvlist_prtctlop_nvlist, nvlist_t *);
* Return values as above. * Return values as above.
*/ */
#define NVLIST_PRINTCTL_AVDECL(funcname, vtype) \ #define NVLIST_PRINTCTL_AVDECL(funcname, vtype) \
extern void funcname(nvlist_prtctl_t, \ _LIBNVPAIR_H void funcname(nvlist_prtctl_t, \
int (*)(nvlist_prtctl_t, void *, nvlist_t *, const char *, vtype, uint_t), \ int (*)(nvlist_prtctl_t, void *, nvlist_t *, const char *, vtype, uint_t), \
void *) void *)

View file

@ -27,7 +27,7 @@
*/ */
#ifndef _LIBZFS_CORE_H #ifndef _LIBZFS_CORE_H
#define _LIBZFS_CORE_H #define _LIBZFS_CORE_H extern __attribute__((visibility("default")))
#include <libnvpair.h> #include <libnvpair.h>
#include <sys/param.h> #include <sys/param.h>
@ -38,41 +38,42 @@
extern "C" { extern "C" {
#endif #endif
int libzfs_core_init(void); _LIBZFS_CORE_H int libzfs_core_init(void);
void libzfs_core_fini(void); _LIBZFS_CORE_H void libzfs_core_fini(void);
/* /*
* NB: this type should be kept binary compatible with dmu_objset_type_t. * NB: this type should be kept binary-compatible with dmu_objset_type_t.
*/ */
enum lzc_dataset_type { enum lzc_dataset_type {
LZC_DATSET_TYPE_ZFS = 2, LZC_DATSET_TYPE_ZFS = 2,
LZC_DATSET_TYPE_ZVOL LZC_DATSET_TYPE_ZVOL
}; };
int lzc_snapshot(nvlist_t *, nvlist_t *, nvlist_t **); _LIBZFS_CORE_H int lzc_snapshot(nvlist_t *, nvlist_t *, nvlist_t **);
int lzc_create(const char *, enum lzc_dataset_type, nvlist_t *, uint8_t *, _LIBZFS_CORE_H int lzc_create(const char *, enum lzc_dataset_type, nvlist_t *,
uint8_t *, uint_t);
_LIBZFS_CORE_H int lzc_clone(const char *, const char *, nvlist_t *);
_LIBZFS_CORE_H int lzc_promote(const char *, char *, int);
_LIBZFS_CORE_H int lzc_destroy_snaps(nvlist_t *, boolean_t, nvlist_t **);
_LIBZFS_CORE_H int lzc_bookmark(nvlist_t *, nvlist_t **);
_LIBZFS_CORE_H int lzc_get_bookmarks(const char *, nvlist_t *, nvlist_t **);
_LIBZFS_CORE_H int lzc_get_bookmark_props(const char *, nvlist_t **);
_LIBZFS_CORE_H int lzc_destroy_bookmarks(nvlist_t *, nvlist_t **);
_LIBZFS_CORE_H int lzc_load_key(const char *, boolean_t, uint8_t *, uint_t);
_LIBZFS_CORE_H int lzc_unload_key(const char *);
_LIBZFS_CORE_H int lzc_change_key(const char *, uint64_t, nvlist_t *, uint8_t *,
uint_t); uint_t);
int lzc_clone(const char *, const char *, nvlist_t *); _LIBZFS_CORE_H int lzc_initialize(const char *, pool_initialize_func_t,
int lzc_promote(const char *, char *, int);
int lzc_destroy_snaps(nvlist_t *, boolean_t, nvlist_t **);
int lzc_bookmark(nvlist_t *, nvlist_t **);
int lzc_get_bookmarks(const char *, nvlist_t *, nvlist_t **);
int lzc_get_bookmark_props(const char *, nvlist_t **);
int lzc_destroy_bookmarks(nvlist_t *, nvlist_t **);
int lzc_load_key(const char *, boolean_t, uint8_t *, uint_t);
int lzc_unload_key(const char *);
int lzc_change_key(const char *, uint64_t, nvlist_t *, uint8_t *, uint_t);
int lzc_initialize(const char *, pool_initialize_func_t, nvlist_t *,
nvlist_t **);
int lzc_trim(const char *, pool_trim_func_t, uint64_t, boolean_t,
nvlist_t *, nvlist_t **); nvlist_t *, nvlist_t **);
int lzc_redact(const char *, const char *, nvlist_t *); _LIBZFS_CORE_H int lzc_trim(const char *, pool_trim_func_t, uint64_t, boolean_t,
nvlist_t *, nvlist_t **);
_LIBZFS_CORE_H int lzc_redact(const char *, const char *, nvlist_t *);
int lzc_snaprange_space(const char *, const char *, uint64_t *); _LIBZFS_CORE_H int lzc_snaprange_space(const char *, const char *, uint64_t *);
int lzc_hold(nvlist_t *, int, nvlist_t **); _LIBZFS_CORE_H int lzc_hold(nvlist_t *, int, nvlist_t **);
int lzc_release(nvlist_t *, nvlist_t **); _LIBZFS_CORE_H int lzc_release(nvlist_t *, nvlist_t **);
int lzc_get_holds(const char *, nvlist_t **); _LIBZFS_CORE_H int lzc_get_holds(const char *, nvlist_t **);
enum lzc_send_flags { enum lzc_send_flags {
LZC_SEND_FLAG_EMBED_DATA = 1 << 0, LZC_SEND_FLAG_EMBED_DATA = 1 << 0,
@ -82,61 +83,66 @@ enum lzc_send_flags {
LZC_SEND_FLAG_SAVED = 1 << 4, LZC_SEND_FLAG_SAVED = 1 << 4,
}; };
int lzc_send(const char *, const char *, int, enum lzc_send_flags); _LIBZFS_CORE_H int lzc_send(const char *, const char *, int,
int lzc_send_resume(const char *, const char *, int, enum lzc_send_flags);
_LIBZFS_CORE_H int lzc_send_resume(const char *, const char *, int,
enum lzc_send_flags, uint64_t, uint64_t); enum lzc_send_flags, uint64_t, uint64_t);
int lzc_send_space(const char *, const char *, enum lzc_send_flags, uint64_t *); _LIBZFS_CORE_H int lzc_send_space(const char *, const char *,
enum lzc_send_flags, uint64_t *);
struct dmu_replay_record; struct dmu_replay_record;
int lzc_send_redacted(const char *, const char *, int, enum lzc_send_flags, _LIBZFS_CORE_H int lzc_send_redacted(const char *, const char *, int,
const char *); enum lzc_send_flags, const char *);
int lzc_send_resume_redacted(const char *, const char *, int, _LIBZFS_CORE_H int lzc_send_resume_redacted(const char *, const char *, int,
enum lzc_send_flags, uint64_t, uint64_t, const char *); enum lzc_send_flags, uint64_t, uint64_t, const char *);
int lzc_receive(const char *, nvlist_t *, const char *, boolean_t, boolean_t, _LIBZFS_CORE_H int lzc_receive(const char *, nvlist_t *, const char *,
int); boolean_t, boolean_t, int);
int lzc_receive_resumable(const char *, nvlist_t *, const char *, boolean_t, _LIBZFS_CORE_H int lzc_receive_resumable(const char *, nvlist_t *, const char *,
boolean_t, int); boolean_t, boolean_t, int);
int lzc_receive_with_header(const char *, nvlist_t *, const char *, boolean_t, _LIBZFS_CORE_H int lzc_receive_with_header(const char *, nvlist_t *,
boolean_t, boolean_t, int, const struct dmu_replay_record *); const char *, boolean_t, boolean_t, boolean_t, int,
int lzc_receive_one(const char *, nvlist_t *, const char *, boolean_t, const struct dmu_replay_record *);
boolean_t, boolean_t, int, const struct dmu_replay_record *, int, _LIBZFS_CORE_H int lzc_receive_one(const char *, nvlist_t *, const char *,
boolean_t, boolean_t, boolean_t, int, const struct dmu_replay_record *, int,
uint64_t *, uint64_t *, uint64_t *, nvlist_t **); uint64_t *, uint64_t *, uint64_t *, nvlist_t **);
int lzc_receive_with_cmdprops(const char *, nvlist_t *, nvlist_t *, _LIBZFS_CORE_H int lzc_receive_with_cmdprops(const char *, nvlist_t *,
uint8_t *, uint_t, const char *, boolean_t, boolean_t, boolean_t, int, nvlist_t *, uint8_t *, uint_t, const char *, boolean_t, boolean_t,
const struct dmu_replay_record *, int, uint64_t *, uint64_t *, boolean_t, int, const struct dmu_replay_record *, int, uint64_t *,
uint64_t *, nvlist_t **); uint64_t *, uint64_t *, nvlist_t **);
int lzc_send_space(const char *, const char *, enum lzc_send_flags, uint64_t *); _LIBZFS_CORE_H int lzc_send_space(const char *, const char *,
int lzc_send_space_resume_redacted(const char *, const char *, enum lzc_send_flags, uint64_t *);
_LIBZFS_CORE_H int lzc_send_space_resume_redacted(const char *, const char *,
enum lzc_send_flags, uint64_t, uint64_t, uint64_t, const char *, enum lzc_send_flags, uint64_t, uint64_t, uint64_t, const char *,
int, uint64_t *); int, uint64_t *);
uint64_t lzc_send_progress(int); _LIBZFS_CORE_H uint64_t lzc_send_progress(int);
boolean_t lzc_exists(const char *); _LIBZFS_CORE_H boolean_t lzc_exists(const char *);
int lzc_rollback(const char *, char *, int); _LIBZFS_CORE_H int lzc_rollback(const char *, char *, int);
int lzc_rollback_to(const char *, const char *); _LIBZFS_CORE_H int lzc_rollback_to(const char *, const char *);
int lzc_rename(const char *, const char *); _LIBZFS_CORE_H int lzc_rename(const char *, const char *);
int lzc_destroy(const char *); _LIBZFS_CORE_H int lzc_destroy(const char *);
int lzc_channel_program(const char *, const char *, uint64_t, _LIBZFS_CORE_H int lzc_channel_program(const char *, const char *, uint64_t,
uint64_t, nvlist_t *, nvlist_t **);
int lzc_channel_program_nosync(const char *, const char *, uint64_t,
uint64_t, nvlist_t *, nvlist_t **); uint64_t, nvlist_t *, nvlist_t **);
_LIBZFS_CORE_H int lzc_channel_program_nosync(const char *, const char *,
uint64_t, uint64_t, nvlist_t *, nvlist_t **);
int lzc_sync(const char *, nvlist_t *, nvlist_t **); _LIBZFS_CORE_H int lzc_sync(const char *, nvlist_t *, nvlist_t **);
int lzc_reopen(const char *, boolean_t); _LIBZFS_CORE_H int lzc_reopen(const char *, boolean_t);
int lzc_pool_checkpoint(const char *); _LIBZFS_CORE_H int lzc_pool_checkpoint(const char *);
int lzc_pool_checkpoint_discard(const char *); _LIBZFS_CORE_H int lzc_pool_checkpoint_discard(const char *);
int lzc_wait(const char *, zpool_wait_activity_t, boolean_t *); _LIBZFS_CORE_H int lzc_wait(const char *, zpool_wait_activity_t, boolean_t *);
int lzc_wait_tag(const char *, zpool_wait_activity_t, uint64_t, boolean_t *); _LIBZFS_CORE_H int lzc_wait_tag(const char *, zpool_wait_activity_t, uint64_t,
int lzc_wait_fs(const char *, zfs_wait_activity_t, boolean_t *); boolean_t *);
_LIBZFS_CORE_H int lzc_wait_fs(const char *, zfs_wait_activity_t, boolean_t *);
int lzc_set_bootenv(const char *, const nvlist_t *); _LIBZFS_CORE_H int lzc_set_bootenv(const char *, const nvlist_t *);
int lzc_get_bootenv(const char *, nvlist_t **); _LIBZFS_CORE_H int lzc_get_bootenv(const char *, nvlist_t **);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View file

@ -14,7 +14,7 @@
*/ */
#ifndef _LIBZFSBOOTENV_H #ifndef _LIBZFSBOOTENV_H
#define _LIBZFSBOOTENV_H #define _LIBZFSBOOTENV_H extern __attribute__((visibility("default")))
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -25,14 +25,16 @@ typedef enum lzbe_flags {
lzbe_replace /* replace current nvlist */ lzbe_replace /* replace current nvlist */
} lzbe_flags_t; } lzbe_flags_t;
extern int lzbe_nvlist_get(const char *, const char *, void **); _LIBZFSBOOTENV_H int lzbe_nvlist_get(const char *, const char *, void **);
extern int lzbe_nvlist_set(const char *, const char *, void *); _LIBZFSBOOTENV_H int lzbe_nvlist_set(const char *, const char *, void *);
extern void lzbe_nvlist_free(void *); _LIBZFSBOOTENV_H void lzbe_nvlist_free(void *);
extern int lzbe_add_pair(void *, const char *, const char *, void *, size_t); _LIBZFSBOOTENV_H int lzbe_add_pair(void *, const char *, const char *, void *,
extern int lzbe_remove_pair(void *, const char *); size_t);
extern int lzbe_set_boot_device(const char *, lzbe_flags_t, const char *); _LIBZFSBOOTENV_H int lzbe_remove_pair(void *, const char *);
extern int lzbe_get_boot_device(const char *, char **); _LIBZFSBOOTENV_H int lzbe_set_boot_device(const char *, lzbe_flags_t,
extern int lzbe_bootenv_print(const char *, const char *, FILE *); const char *);
_LIBZFSBOOTENV_H int lzbe_get_boot_device(const char *, char **);
_LIBZFSBOOTENV_H int lzbe_bootenv_print(const char *, const char *, FILE *);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -160,6 +160,9 @@ _LIBZUTIL_H void color_start(char *color);
_LIBZUTIL_H void color_end(void); _LIBZUTIL_H void color_end(void);
_LIBZUTIL_H int printf_color(char *color, char *format, ...); _LIBZUTIL_H int printf_color(char *color, char *format, ...);
_LIBZUTIL_H const char *zfs_basename(const char *path);
_LIBZUTIL_H ssize_t zfs_dirnamelen(const char *path);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View file

@ -210,10 +210,6 @@ extern kstat_t *__kstat_create(const char *ks_module, int ks_instance,
extern void __kstat_install(kstat_t *ksp); extern void __kstat_install(kstat_t *ksp);
extern void __kstat_delete(kstat_t *ksp); extern void __kstat_delete(kstat_t *ksp);
extern void kstat_waitq_enter(kstat_io_t *);
extern void kstat_waitq_exit(kstat_io_t *);
extern void kstat_runq_enter(kstat_io_t *);
extern void kstat_runq_exit(kstat_io_t *);
#define kstat_set_seq_raw_ops(k, h, d, a) \ #define kstat_set_seq_raw_ops(k, h, d, a) \
__kstat_set_seq_raw_ops(k, h, d, a) __kstat_set_seq_raw_ops(k, h, d, a)

View file

@ -206,10 +206,6 @@ extern void kstat_proc_entry_install(kstat_proc_entry_t *kpep, mode_t mode,
extern void __kstat_install(kstat_t *ksp); extern void __kstat_install(kstat_t *ksp);
extern void __kstat_delete(kstat_t *ksp); extern void __kstat_delete(kstat_t *ksp);
extern void kstat_waitq_enter(kstat_io_t *);
extern void kstat_waitq_exit(kstat_io_t *);
extern void kstat_runq_enter(kstat_io_t *);
extern void kstat_runq_exit(kstat_io_t *);
#define kstat_set_raw_ops(k, h, d, a) \ #define kstat_set_raw_ops(k, h, d, a) \
__kstat_set_raw_ops(k, h, d, a) __kstat_set_raw_ops(k, h, d, a)

View file

@ -74,20 +74,20 @@ typedef struct arc_state {
/* /*
* list of evictable buffers * list of evictable buffers
*/ */
multilist_t *arcs_list[ARC_BUFC_NUMTYPES]; multilist_t arcs_list[ARC_BUFC_NUMTYPES];
/*
* supports the "dbufs" kstat
*/
arc_state_type_t arcs_state;
/* /*
* total amount of evictable data in this state * total amount of evictable data in this state
*/ */
zfs_refcount_t arcs_esize[ARC_BUFC_NUMTYPES]; zfs_refcount_t arcs_esize[ARC_BUFC_NUMTYPES] ____cacheline_aligned;
/* /*
* total amount of data in this state; this includes: evictable, * total amount of data in this state; this includes: evictable,
* non-evictable, ARC_BUFC_DATA, and ARC_BUFC_METADATA. * non-evictable, ARC_BUFC_DATA, and ARC_BUFC_METADATA.
*/ */
zfs_refcount_t arcs_size; zfs_refcount_t arcs_size;
/*
* supports the "dbufs" kstat
*/
arc_state_type_t arcs_state;
} arc_state_t; } arc_state_t;
typedef struct arc_callback arc_callback_t; typedef struct arc_callback arc_callback_t;

View file

@ -28,7 +28,7 @@
*/ */
#ifndef _AVL_H #ifndef _AVL_H
#define _AVL_H #define _AVL_H extern __attribute__((visibility("default")))
/* /*
* This is a private header file. Applications should not directly include * This is a private header file. Applications should not directly include
@ -160,7 +160,7 @@ typedef uintptr_t avl_index_t;
* size - the value of sizeof(struct my_type) * size - the value of sizeof(struct my_type)
* offset - the value of OFFSETOF(struct my_type, my_link) * offset - the value of OFFSETOF(struct my_type, my_link)
*/ */
extern void avl_create(avl_tree_t *tree, _AVL_H void avl_create(avl_tree_t *tree,
int (*compar) (const void *, const void *), size_t size, size_t offset); int (*compar) (const void *, const void *), size_t size, size_t offset);
@ -172,7 +172,7 @@ extern void avl_create(avl_tree_t *tree,
* node - node that has the value being looked for * node - node that has the value being looked for
* where - position for use with avl_nearest() or avl_insert(), may be NULL * where - position for use with avl_nearest() or avl_insert(), may be NULL
*/ */
extern void *avl_find(avl_tree_t *tree, const void *node, avl_index_t *where); _AVL_H void *avl_find(avl_tree_t *tree, const void *node, avl_index_t *where);
/* /*
* Insert a node into the tree. * Insert a node into the tree.
@ -180,7 +180,7 @@ extern void *avl_find(avl_tree_t *tree, const void *node, avl_index_t *where);
* node - the node to insert * node - the node to insert
* where - position as returned from avl_find() * where - position as returned from avl_find()
*/ */
extern void avl_insert(avl_tree_t *tree, void *node, avl_index_t where); _AVL_H void avl_insert(avl_tree_t *tree, void *node, avl_index_t where);
/* /*
* Insert "new_data" in "tree" in the given "direction" either after * Insert "new_data" in "tree" in the given "direction" either after
@ -193,7 +193,7 @@ extern void avl_insert(avl_tree_t *tree, void *node, avl_index_t where);
* here - existing node in "tree" * here - existing node in "tree"
* direction - either AVL_AFTER or AVL_BEFORE the data "here". * direction - either AVL_AFTER or AVL_BEFORE the data "here".
*/ */
extern void avl_insert_here(avl_tree_t *tree, void *new_data, void *here, _AVL_H void avl_insert_here(avl_tree_t *tree, void *new_data, void *here,
int direction); int direction);
@ -202,8 +202,8 @@ extern void avl_insert_here(avl_tree_t *tree, void *new_data, void *here,
* if the tree is empty. * if the tree is empty.
* *
*/ */
extern void *avl_first(avl_tree_t *tree); _AVL_H void *avl_first(avl_tree_t *tree);
extern void *avl_last(avl_tree_t *tree); _AVL_H void *avl_last(avl_tree_t *tree);
/* /*
@ -239,7 +239,7 @@ extern void *avl_last(avl_tree_t *tree);
* else * else
* less = avl_nearest(tree, where, AVL_BEFORE); * less = avl_nearest(tree, where, AVL_BEFORE);
*/ */
extern void *avl_nearest(avl_tree_t *tree, avl_index_t where, int direction); _AVL_H void *avl_nearest(avl_tree_t *tree, avl_index_t where, int direction);
/* /*
@ -249,7 +249,7 @@ extern void *avl_nearest(avl_tree_t *tree, avl_index_t where, int direction);
* *
* node - the node to add * node - the node to add
*/ */
extern void avl_add(avl_tree_t *tree, void *node); _AVL_H void avl_add(avl_tree_t *tree, void *node);
/* /*
@ -257,7 +257,7 @@ extern void avl_add(avl_tree_t *tree, void *node);
* *
* node - the node to remove * node - the node to remove
*/ */
extern void avl_remove(avl_tree_t *tree, void *node); _AVL_H void avl_remove(avl_tree_t *tree, void *node);
/* /*
* Reinsert a node only if its order has changed relative to its nearest * Reinsert a node only if its order has changed relative to its nearest
@ -266,24 +266,24 @@ extern void avl_remove(avl_tree_t *tree, void *node);
* avl_update_gt() only if you know the direction in which the order of the * avl_update_gt() only if you know the direction in which the order of the
* node may change. * node may change.
*/ */
extern boolean_t avl_update(avl_tree_t *, void *); _AVL_H boolean_t avl_update(avl_tree_t *, void *);
extern boolean_t avl_update_lt(avl_tree_t *, void *); _AVL_H boolean_t avl_update_lt(avl_tree_t *, void *);
extern boolean_t avl_update_gt(avl_tree_t *, void *); _AVL_H boolean_t avl_update_gt(avl_tree_t *, void *);
/* /*
* Swaps the contents of the two trees. * Swaps the contents of the two trees.
*/ */
extern void avl_swap(avl_tree_t *tree1, avl_tree_t *tree2); _AVL_H void avl_swap(avl_tree_t *tree1, avl_tree_t *tree2);
/* /*
* Return the number of nodes in the tree * Return the number of nodes in the tree
*/ */
extern ulong_t avl_numnodes(avl_tree_t *tree); _AVL_H ulong_t avl_numnodes(avl_tree_t *tree);
/* /*
* Return B_TRUE if there are zero nodes in the tree, B_FALSE otherwise. * Return B_TRUE if there are zero nodes in the tree, B_FALSE otherwise.
*/ */
extern boolean_t avl_is_empty(avl_tree_t *tree); _AVL_H boolean_t avl_is_empty(avl_tree_t *tree);
/* /*
* Used to destroy any remaining nodes in a tree. The cookie argument should * Used to destroy any remaining nodes in a tree. The cookie argument should
@ -306,7 +306,7 @@ extern boolean_t avl_is_empty(avl_tree_t *tree);
* free(node); * free(node);
* avl_destroy(tree); * avl_destroy(tree);
*/ */
extern void *avl_destroy_nodes(avl_tree_t *tree, void **cookie); _AVL_H void *avl_destroy_nodes(avl_tree_t *tree, void **cookie);
/* /*
@ -314,7 +314,7 @@ extern void *avl_destroy_nodes(avl_tree_t *tree, void **cookie);
* *
* tree - the empty tree to destroy * tree - the empty tree to destroy
*/ */
extern void avl_destroy(avl_tree_t *tree); _AVL_H void avl_destroy(avl_tree_t *tree);

View file

@ -25,8 +25,7 @@
*/ */
#ifndef _AVL_IMPL_H #ifndef _AVL_IMPL_H
#define _AVL_IMPL_H #define _AVL_IMPL_H extern __attribute__((visibility("default")))
/* /*
@ -155,7 +154,7 @@ struct avl_tree {
/* /*
* This will only by used via AVL_NEXT() or AVL_PREV() * This will only by used via AVL_NEXT() or AVL_PREV()
*/ */
extern void *avl_walk(struct avl_tree *, void *, int); _AVL_IMPL_H void *avl_walk(struct avl_tree *, void *, int);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -153,7 +153,7 @@ struct objset {
/* no lock needed: */ /* no lock needed: */
struct dmu_tx *os_synctx; /* XXX sketchy */ struct dmu_tx *os_synctx; /* XXX sketchy */
zil_header_t os_zil_header; zil_header_t os_zil_header;
multilist_t *os_synced_dnodes; multilist_t os_synced_dnodes;
uint64_t os_flags; uint64_t os_flags;
uint64_t os_freed_dnodes; uint64_t os_freed_dnodes;
boolean_t os_rescan_dnodes; boolean_t os_rescan_dnodes;
@ -172,7 +172,7 @@ struct objset {
/* Protected by os_lock */ /* Protected by os_lock */
kmutex_t os_lock; kmutex_t os_lock;
multilist_t *os_dirty_dnodes[TXG_SIZE]; multilist_t os_dirty_dnodes[TXG_SIZE];
list_t os_dnodes; list_t os_dnodes;
list_t os_downgraded_dbufs; list_t os_downgraded_dbufs;

View file

@ -24,7 +24,7 @@
*/ */
#ifndef _SYS_EFI_PARTITION_H #ifndef _SYS_EFI_PARTITION_H
#define _SYS_EFI_PARTITION_H #define _SYS_EFI_PARTITION_H extern __attribute__((visibility("default")))
#include <sys/uuid.h> #include <sys/uuid.h>
@ -363,15 +363,15 @@ struct partition64 {
#endif #endif
#ifndef _KERNEL #ifndef _KERNEL
extern int efi_alloc_and_init(int, uint32_t, struct dk_gpt **); _SYS_EFI_PARTITION_H int efi_debug;
extern int efi_alloc_and_read(int, struct dk_gpt **); _SYS_EFI_PARTITION_H int efi_alloc_and_init(int, uint32_t, struct dk_gpt **);
extern int efi_write(int, struct dk_gpt *); _SYS_EFI_PARTITION_H int efi_alloc_and_read(int, struct dk_gpt **);
extern int efi_rescan(int); _SYS_EFI_PARTITION_H int efi_write(int, struct dk_gpt *);
extern void efi_free(struct dk_gpt *); _SYS_EFI_PARTITION_H int efi_rescan(int);
extern int efi_type(int); _SYS_EFI_PARTITION_H void efi_free(struct dk_gpt *);
extern void efi_err_check(struct dk_gpt *); _SYS_EFI_PARTITION_H int efi_type(int);
extern int efi_auto_sense(int fd, struct dk_gpt **); _SYS_EFI_PARTITION_H void efi_err_check(struct dk_gpt *);
extern int efi_use_whole_disk(int fd); _SYS_EFI_PARTITION_H int efi_use_whole_disk(int fd);
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -206,7 +206,7 @@ struct metaslab_class {
* List of all loaded metaslabs in the class, sorted in order of most * List of all loaded metaslabs in the class, sorted in order of most
* recent use. * recent use.
*/ */
multilist_t *mc_metaslab_txg_list; multilist_t mc_metaslab_txg_list;
metaslab_class_allocator_t mc_allocator[]; metaslab_class_allocator_t mc_allocator[];
}; };

View file

@ -71,8 +71,9 @@ struct multilist {
multilist_sublist_index_func_t *ml_index_func; multilist_sublist_index_func_t *ml_index_func;
}; };
void multilist_create(multilist_t *, size_t, size_t,
multilist_sublist_index_func_t *);
void multilist_destroy(multilist_t *); void multilist_destroy(multilist_t *);
multilist_t *multilist_create(size_t, size_t, multilist_sublist_index_func_t *);
void multilist_insert(multilist_t *, void *); void multilist_insert(multilist_t *, void *);
void multilist_remove(multilist_t *, void *); void multilist_remove(multilist_t *, void *);

View file

@ -24,7 +24,7 @@
*/ */
#ifndef _SYS_NVPAIR_H #ifndef _SYS_NVPAIR_H
#define _SYS_NVPAIR_H #define _SYS_NVPAIR_H extern __attribute__((visibility("default")))
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>
@ -135,221 +135,270 @@ struct nv_alloc_ops {
void (*nv_ao_reset)(nv_alloc_t *); void (*nv_ao_reset)(nv_alloc_t *);
}; };
extern const nv_alloc_ops_t *nv_fixed_ops; _SYS_NVPAIR_H const nv_alloc_ops_t *nv_fixed_ops;
extern nv_alloc_t *nv_alloc_nosleep; _SYS_NVPAIR_H nv_alloc_t *nv_alloc_nosleep;
#if defined(_KERNEL) #if defined(_KERNEL)
extern nv_alloc_t *nv_alloc_sleep; _SYS_NVPAIR_H nv_alloc_t *nv_alloc_sleep;
extern nv_alloc_t *nv_alloc_pushpage; _SYS_NVPAIR_H nv_alloc_t *nv_alloc_pushpage;
#endif #endif
int nv_alloc_init(nv_alloc_t *, const nv_alloc_ops_t *, /* args */ ...); _SYS_NVPAIR_H int nv_alloc_init(nv_alloc_t *, const nv_alloc_ops_t *,
void nv_alloc_reset(nv_alloc_t *); /* args */ ...);
void nv_alloc_fini(nv_alloc_t *); _SYS_NVPAIR_H void nv_alloc_reset(nv_alloc_t *);
_SYS_NVPAIR_H void nv_alloc_fini(nv_alloc_t *);
/* list management */ /* list management */
int nvlist_alloc(nvlist_t **, uint_t, int); _SYS_NVPAIR_H int nvlist_alloc(nvlist_t **, uint_t, int);
void nvlist_free(nvlist_t *); _SYS_NVPAIR_H void nvlist_free(nvlist_t *);
int nvlist_size(nvlist_t *, size_t *, int); _SYS_NVPAIR_H int nvlist_size(nvlist_t *, size_t *, int);
int nvlist_pack(nvlist_t *, char **, size_t *, int, int); _SYS_NVPAIR_H int nvlist_pack(nvlist_t *, char **, size_t *, int, int);
int nvlist_unpack(char *, size_t, nvlist_t **, int); _SYS_NVPAIR_H int nvlist_unpack(char *, size_t, nvlist_t **, int);
int nvlist_dup(nvlist_t *, nvlist_t **, int); _SYS_NVPAIR_H int nvlist_dup(nvlist_t *, nvlist_t **, int);
int nvlist_merge(nvlist_t *, nvlist_t *, int); _SYS_NVPAIR_H int nvlist_merge(nvlist_t *, nvlist_t *, int);
uint_t nvlist_nvflag(nvlist_t *); _SYS_NVPAIR_H uint_t nvlist_nvflag(nvlist_t *);
int nvlist_xalloc(nvlist_t **, uint_t, nv_alloc_t *); _SYS_NVPAIR_H int nvlist_xalloc(nvlist_t **, uint_t, nv_alloc_t *);
int nvlist_xpack(nvlist_t *, char **, size_t *, int, nv_alloc_t *); _SYS_NVPAIR_H int nvlist_xpack(nvlist_t *, char **, size_t *, int,
int nvlist_xunpack(char *, size_t, nvlist_t **, nv_alloc_t *); nv_alloc_t *);
int nvlist_xdup(nvlist_t *, nvlist_t **, nv_alloc_t *); _SYS_NVPAIR_H int nvlist_xunpack(char *, size_t, nvlist_t **, nv_alloc_t *);
nv_alloc_t *nvlist_lookup_nv_alloc(nvlist_t *); _SYS_NVPAIR_H int nvlist_xdup(nvlist_t *, nvlist_t **, nv_alloc_t *);
_SYS_NVPAIR_H nv_alloc_t *nvlist_lookup_nv_alloc(nvlist_t *);
int nvlist_add_nvpair(nvlist_t *, nvpair_t *); _SYS_NVPAIR_H int nvlist_add_nvpair(nvlist_t *, nvpair_t *);
int nvlist_add_boolean(nvlist_t *, const char *); _SYS_NVPAIR_H int nvlist_add_boolean(nvlist_t *, const char *);
int nvlist_add_boolean_value(nvlist_t *, const char *, boolean_t); _SYS_NVPAIR_H int nvlist_add_boolean_value(nvlist_t *, const char *, boolean_t);
int nvlist_add_byte(nvlist_t *, const char *, uchar_t); _SYS_NVPAIR_H int nvlist_add_byte(nvlist_t *, const char *, uchar_t);
int nvlist_add_int8(nvlist_t *, const char *, int8_t); _SYS_NVPAIR_H int nvlist_add_int8(nvlist_t *, const char *, int8_t);
int nvlist_add_uint8(nvlist_t *, const char *, uint8_t); _SYS_NVPAIR_H int nvlist_add_uint8(nvlist_t *, const char *, uint8_t);
int nvlist_add_int16(nvlist_t *, const char *, int16_t); _SYS_NVPAIR_H int nvlist_add_int16(nvlist_t *, const char *, int16_t);
int nvlist_add_uint16(nvlist_t *, const char *, uint16_t); _SYS_NVPAIR_H int nvlist_add_uint16(nvlist_t *, const char *, uint16_t);
int nvlist_add_int32(nvlist_t *, const char *, int32_t); _SYS_NVPAIR_H int nvlist_add_int32(nvlist_t *, const char *, int32_t);
int nvlist_add_uint32(nvlist_t *, const char *, uint32_t); _SYS_NVPAIR_H int nvlist_add_uint32(nvlist_t *, const char *, uint32_t);
int nvlist_add_int64(nvlist_t *, const char *, int64_t); _SYS_NVPAIR_H int nvlist_add_int64(nvlist_t *, const char *, int64_t);
int nvlist_add_uint64(nvlist_t *, const char *, uint64_t); _SYS_NVPAIR_H int nvlist_add_uint64(nvlist_t *, const char *, uint64_t);
int nvlist_add_string(nvlist_t *, const char *, const char *); _SYS_NVPAIR_H int nvlist_add_string(nvlist_t *, const char *, const char *);
int nvlist_add_nvlist(nvlist_t *, const char *, nvlist_t *); _SYS_NVPAIR_H int nvlist_add_nvlist(nvlist_t *, const char *, nvlist_t *);
int nvlist_add_boolean_array(nvlist_t *, const char *, boolean_t *, uint_t); _SYS_NVPAIR_H int nvlist_add_boolean_array(nvlist_t *, const char *,
int nvlist_add_byte_array(nvlist_t *, const char *, uchar_t *, uint_t); boolean_t *, uint_t);
int nvlist_add_int8_array(nvlist_t *, const char *, int8_t *, uint_t); _SYS_NVPAIR_H int nvlist_add_byte_array(nvlist_t *, const char *, uchar_t *,
int nvlist_add_uint8_array(nvlist_t *, const char *, uint8_t *, uint_t); uint_t);
int nvlist_add_int16_array(nvlist_t *, const char *, int16_t *, uint_t); _SYS_NVPAIR_H int nvlist_add_int8_array(nvlist_t *, const char *, int8_t *,
int nvlist_add_uint16_array(nvlist_t *, const char *, uint16_t *, uint_t); uint_t);
int nvlist_add_int32_array(nvlist_t *, const char *, int32_t *, uint_t); _SYS_NVPAIR_H int nvlist_add_uint8_array(nvlist_t *, const char *, uint8_t *,
int nvlist_add_uint32_array(nvlist_t *, const char *, uint32_t *, uint_t); uint_t);
int nvlist_add_int64_array(nvlist_t *, const char *, int64_t *, uint_t); _SYS_NVPAIR_H int nvlist_add_int16_array(nvlist_t *, const char *, int16_t *,
int nvlist_add_uint64_array(nvlist_t *, const char *, uint64_t *, uint_t); uint_t);
int nvlist_add_string_array(nvlist_t *, const char *, char *const *, uint_t); _SYS_NVPAIR_H int nvlist_add_uint16_array(nvlist_t *, const char *, uint16_t *,
int nvlist_add_nvlist_array(nvlist_t *, const char *, nvlist_t **, uint_t); uint_t);
int nvlist_add_hrtime(nvlist_t *, const char *, hrtime_t); _SYS_NVPAIR_H int nvlist_add_int32_array(nvlist_t *, const char *, int32_t *,
uint_t);
_SYS_NVPAIR_H int nvlist_add_uint32_array(nvlist_t *, const char *, uint32_t *,
uint_t);
_SYS_NVPAIR_H int nvlist_add_int64_array(nvlist_t *, const char *, int64_t *,
uint_t);
_SYS_NVPAIR_H int nvlist_add_uint64_array(nvlist_t *, const char *, uint64_t *,
uint_t);
_SYS_NVPAIR_H int nvlist_add_string_array(nvlist_t *, const char *,
char * const *, uint_t);
_SYS_NVPAIR_H int nvlist_add_nvlist_array(nvlist_t *, const char *,
nvlist_t **, uint_t);
_SYS_NVPAIR_H int nvlist_add_hrtime(nvlist_t *, const char *, hrtime_t);
#if !defined(_KERNEL) && !defined(_STANDALONE) #if !defined(_KERNEL) && !defined(_STANDALONE)
int nvlist_add_double(nvlist_t *, const char *, double); _SYS_NVPAIR_H int nvlist_add_double(nvlist_t *, const char *, double);
#endif #endif
int nvlist_remove(nvlist_t *, const char *, data_type_t); _SYS_NVPAIR_H int nvlist_remove(nvlist_t *, const char *, data_type_t);
int nvlist_remove_all(nvlist_t *, const char *); _SYS_NVPAIR_H int nvlist_remove_all(nvlist_t *, const char *);
int nvlist_remove_nvpair(nvlist_t *, nvpair_t *); _SYS_NVPAIR_H int nvlist_remove_nvpair(nvlist_t *, nvpair_t *);
int nvlist_lookup_boolean(nvlist_t *, const char *); _SYS_NVPAIR_H int nvlist_lookup_boolean(nvlist_t *, const char *);
int nvlist_lookup_boolean_value(nvlist_t *, const char *, boolean_t *); _SYS_NVPAIR_H int nvlist_lookup_boolean_value(nvlist_t *, const char *,
int nvlist_lookup_byte(nvlist_t *, const char *, uchar_t *); boolean_t *);
int nvlist_lookup_int8(nvlist_t *, const char *, int8_t *); _SYS_NVPAIR_H int nvlist_lookup_byte(nvlist_t *, const char *, uchar_t *);
int nvlist_lookup_uint8(nvlist_t *, const char *, uint8_t *); _SYS_NVPAIR_H int nvlist_lookup_int8(nvlist_t *, const char *, int8_t *);
int nvlist_lookup_int16(nvlist_t *, const char *, int16_t *); _SYS_NVPAIR_H int nvlist_lookup_uint8(nvlist_t *, const char *, uint8_t *);
int nvlist_lookup_uint16(nvlist_t *, const char *, uint16_t *); _SYS_NVPAIR_H int nvlist_lookup_int16(nvlist_t *, const char *, int16_t *);
int nvlist_lookup_int32(nvlist_t *, const char *, int32_t *); _SYS_NVPAIR_H int nvlist_lookup_uint16(nvlist_t *, const char *, uint16_t *);
int nvlist_lookup_uint32(nvlist_t *, const char *, uint32_t *); _SYS_NVPAIR_H int nvlist_lookup_int32(nvlist_t *, const char *, int32_t *);
int nvlist_lookup_int64(nvlist_t *, const char *, int64_t *); _SYS_NVPAIR_H int nvlist_lookup_uint32(nvlist_t *, const char *, uint32_t *);
int nvlist_lookup_uint64(nvlist_t *, const char *, uint64_t *); _SYS_NVPAIR_H int nvlist_lookup_int64(nvlist_t *, const char *, int64_t *);
int nvlist_lookup_string(nvlist_t *, const char *, char **); _SYS_NVPAIR_H int nvlist_lookup_uint64(nvlist_t *, const char *, uint64_t *);
int nvlist_lookup_nvlist(nvlist_t *, const char *, nvlist_t **); _SYS_NVPAIR_H int nvlist_lookup_string(nvlist_t *, const char *, char **);
int nvlist_lookup_boolean_array(nvlist_t *, const char *, _SYS_NVPAIR_H int nvlist_lookup_nvlist(nvlist_t *, const char *, nvlist_t **);
_SYS_NVPAIR_H int nvlist_lookup_boolean_array(nvlist_t *, const char *,
boolean_t **, uint_t *); boolean_t **, uint_t *);
int nvlist_lookup_byte_array(nvlist_t *, const char *, uchar_t **, uint_t *); _SYS_NVPAIR_H int nvlist_lookup_byte_array(nvlist_t *, const char *, uchar_t **,
int nvlist_lookup_int8_array(nvlist_t *, const char *, int8_t **, uint_t *); uint_t *);
int nvlist_lookup_uint8_array(nvlist_t *, const char *, uint8_t **, uint_t *); _SYS_NVPAIR_H int nvlist_lookup_int8_array(nvlist_t *, const char *, int8_t **,
int nvlist_lookup_int16_array(nvlist_t *, const char *, int16_t **, uint_t *); uint_t *);
int nvlist_lookup_uint16_array(nvlist_t *, const char *, uint16_t **, uint_t *); _SYS_NVPAIR_H int nvlist_lookup_uint8_array(nvlist_t *, const char *,
int nvlist_lookup_int32_array(nvlist_t *, const char *, int32_t **, uint_t *); uint8_t **, uint_t *);
int nvlist_lookup_uint32_array(nvlist_t *, const char *, uint32_t **, uint_t *); _SYS_NVPAIR_H int nvlist_lookup_int16_array(nvlist_t *, const char *,
int nvlist_lookup_int64_array(nvlist_t *, const char *, int64_t **, uint_t *); int16_t **, uint_t *);
int nvlist_lookup_uint64_array(nvlist_t *, const char *, uint64_t **, uint_t *); _SYS_NVPAIR_H int nvlist_lookup_uint16_array(nvlist_t *, const char *,
int nvlist_lookup_string_array(nvlist_t *, const char *, char ***, uint_t *); uint16_t **, uint_t *);
int nvlist_lookup_nvlist_array(nvlist_t *, const char *, _SYS_NVPAIR_H int nvlist_lookup_int32_array(nvlist_t *, const char *,
int32_t **, uint_t *);
_SYS_NVPAIR_H int nvlist_lookup_uint32_array(nvlist_t *, const char *,
uint32_t **, uint_t *);
_SYS_NVPAIR_H int nvlist_lookup_int64_array(nvlist_t *, const char *,
int64_t **, uint_t *);
_SYS_NVPAIR_H int nvlist_lookup_uint64_array(nvlist_t *, const char *,
uint64_t **, uint_t *);
_SYS_NVPAIR_H int nvlist_lookup_string_array(nvlist_t *, const char *,
char ***, uint_t *);
_SYS_NVPAIR_H int nvlist_lookup_nvlist_array(nvlist_t *, const char *,
nvlist_t ***, uint_t *); nvlist_t ***, uint_t *);
int nvlist_lookup_hrtime(nvlist_t *, const char *, hrtime_t *); _SYS_NVPAIR_H int nvlist_lookup_hrtime(nvlist_t *, const char *, hrtime_t *);
int nvlist_lookup_pairs(nvlist_t *, int, ...); _SYS_NVPAIR_H int nvlist_lookup_pairs(nvlist_t *, int, ...);
#if !defined(_KERNEL) && !defined(_STANDALONE) #if !defined(_KERNEL) && !defined(_STANDALONE)
int nvlist_lookup_double(nvlist_t *, const char *, double *); _SYS_NVPAIR_H int nvlist_lookup_double(nvlist_t *, const char *, double *);
#endif #endif
int nvlist_lookup_nvpair(nvlist_t *, const char *, nvpair_t **); _SYS_NVPAIR_H int nvlist_lookup_nvpair(nvlist_t *, const char *, nvpair_t **);
int nvlist_lookup_nvpair_embedded_index(nvlist_t *, const char *, nvpair_t **, _SYS_NVPAIR_H int nvlist_lookup_nvpair_embedded_index(nvlist_t *, const char *,
int *, char **); nvpair_t **, int *, char **);
boolean_t nvlist_exists(nvlist_t *, const char *); _SYS_NVPAIR_H boolean_t nvlist_exists(nvlist_t *, const char *);
boolean_t nvlist_empty(nvlist_t *); _SYS_NVPAIR_H boolean_t nvlist_empty(nvlist_t *);
/* processing nvpair */ /* processing nvpair */
nvpair_t *nvlist_next_nvpair(nvlist_t *, nvpair_t *); _SYS_NVPAIR_H nvpair_t *nvlist_next_nvpair(nvlist_t *, nvpair_t *);
nvpair_t *nvlist_prev_nvpair(nvlist_t *, nvpair_t *); _SYS_NVPAIR_H nvpair_t *nvlist_prev_nvpair(nvlist_t *, nvpair_t *);
char *nvpair_name(nvpair_t *); _SYS_NVPAIR_H char *nvpair_name(nvpair_t *);
data_type_t nvpair_type(nvpair_t *); _SYS_NVPAIR_H data_type_t nvpair_type(nvpair_t *);
int nvpair_type_is_array(nvpair_t *); _SYS_NVPAIR_H int nvpair_type_is_array(nvpair_t *);
int nvpair_value_boolean_value(nvpair_t *, boolean_t *); _SYS_NVPAIR_H int nvpair_value_boolean_value(nvpair_t *, boolean_t *);
int nvpair_value_byte(nvpair_t *, uchar_t *); _SYS_NVPAIR_H int nvpair_value_byte(nvpair_t *, uchar_t *);
int nvpair_value_int8(nvpair_t *, int8_t *); _SYS_NVPAIR_H int nvpair_value_int8(nvpair_t *, int8_t *);
int nvpair_value_uint8(nvpair_t *, uint8_t *); _SYS_NVPAIR_H int nvpair_value_uint8(nvpair_t *, uint8_t *);
int nvpair_value_int16(nvpair_t *, int16_t *); _SYS_NVPAIR_H int nvpair_value_int16(nvpair_t *, int16_t *);
int nvpair_value_uint16(nvpair_t *, uint16_t *); _SYS_NVPAIR_H int nvpair_value_uint16(nvpair_t *, uint16_t *);
int nvpair_value_int32(nvpair_t *, int32_t *); _SYS_NVPAIR_H int nvpair_value_int32(nvpair_t *, int32_t *);
int nvpair_value_uint32(nvpair_t *, uint32_t *); _SYS_NVPAIR_H int nvpair_value_uint32(nvpair_t *, uint32_t *);
int nvpair_value_int64(nvpair_t *, int64_t *); _SYS_NVPAIR_H int nvpair_value_int64(nvpair_t *, int64_t *);
int nvpair_value_uint64(nvpair_t *, uint64_t *); _SYS_NVPAIR_H int nvpair_value_uint64(nvpair_t *, uint64_t *);
int nvpair_value_string(nvpair_t *, char **); _SYS_NVPAIR_H int nvpair_value_string(nvpair_t *, char **);
int nvpair_value_nvlist(nvpair_t *, nvlist_t **); _SYS_NVPAIR_H int nvpair_value_nvlist(nvpair_t *, nvlist_t **);
int nvpair_value_boolean_array(nvpair_t *, boolean_t **, uint_t *); _SYS_NVPAIR_H int nvpair_value_boolean_array(nvpair_t *, boolean_t **,
int nvpair_value_byte_array(nvpair_t *, uchar_t **, uint_t *); uint_t *);
int nvpair_value_int8_array(nvpair_t *, int8_t **, uint_t *); _SYS_NVPAIR_H int nvpair_value_byte_array(nvpair_t *, uchar_t **, uint_t *);
int nvpair_value_uint8_array(nvpair_t *, uint8_t **, uint_t *); _SYS_NVPAIR_H int nvpair_value_int8_array(nvpair_t *, int8_t **, uint_t *);
int nvpair_value_int16_array(nvpair_t *, int16_t **, uint_t *); _SYS_NVPAIR_H int nvpair_value_uint8_array(nvpair_t *, uint8_t **, uint_t *);
int nvpair_value_uint16_array(nvpair_t *, uint16_t **, uint_t *); _SYS_NVPAIR_H int nvpair_value_int16_array(nvpair_t *, int16_t **, uint_t *);
int nvpair_value_int32_array(nvpair_t *, int32_t **, uint_t *); _SYS_NVPAIR_H int nvpair_value_uint16_array(nvpair_t *, uint16_t **, uint_t *);
int nvpair_value_uint32_array(nvpair_t *, uint32_t **, uint_t *); _SYS_NVPAIR_H int nvpair_value_int32_array(nvpair_t *, int32_t **, uint_t *);
int nvpair_value_int64_array(nvpair_t *, int64_t **, uint_t *); _SYS_NVPAIR_H int nvpair_value_uint32_array(nvpair_t *, uint32_t **, uint_t *);
int nvpair_value_uint64_array(nvpair_t *, uint64_t **, uint_t *); _SYS_NVPAIR_H int nvpair_value_int64_array(nvpair_t *, int64_t **, uint_t *);
int nvpair_value_string_array(nvpair_t *, char ***, uint_t *); _SYS_NVPAIR_H int nvpair_value_uint64_array(nvpair_t *, uint64_t **, uint_t *);
int nvpair_value_nvlist_array(nvpair_t *, nvlist_t ***, uint_t *); _SYS_NVPAIR_H int nvpair_value_string_array(nvpair_t *, char ***, uint_t *);
int nvpair_value_hrtime(nvpair_t *, hrtime_t *); _SYS_NVPAIR_H int nvpair_value_nvlist_array(nvpair_t *, nvlist_t ***, uint_t *);
_SYS_NVPAIR_H int nvpair_value_hrtime(nvpair_t *, hrtime_t *);
#if !defined(_KERNEL) && !defined(_STANDALONE) #if !defined(_KERNEL) && !defined(_STANDALONE)
int nvpair_value_double(nvpair_t *, double *); _SYS_NVPAIR_H int nvpair_value_double(nvpair_t *, double *);
#endif #endif
nvlist_t *fnvlist_alloc(void); _SYS_NVPAIR_H nvlist_t *fnvlist_alloc(void);
void fnvlist_free(nvlist_t *); _SYS_NVPAIR_H void fnvlist_free(nvlist_t *);
size_t fnvlist_size(nvlist_t *); _SYS_NVPAIR_H size_t fnvlist_size(nvlist_t *);
char *fnvlist_pack(nvlist_t *, size_t *); _SYS_NVPAIR_H char *fnvlist_pack(nvlist_t *, size_t *);
void fnvlist_pack_free(char *, size_t); _SYS_NVPAIR_H void fnvlist_pack_free(char *, size_t);
nvlist_t *fnvlist_unpack(char *, size_t); _SYS_NVPAIR_H nvlist_t *fnvlist_unpack(char *, size_t);
nvlist_t *fnvlist_dup(nvlist_t *); _SYS_NVPAIR_H nvlist_t *fnvlist_dup(nvlist_t *);
void fnvlist_merge(nvlist_t *, nvlist_t *); _SYS_NVPAIR_H void fnvlist_merge(nvlist_t *, nvlist_t *);
size_t fnvlist_num_pairs(nvlist_t *); _SYS_NVPAIR_H size_t fnvlist_num_pairs(nvlist_t *);
void fnvlist_add_boolean(nvlist_t *, const char *); _SYS_NVPAIR_H void fnvlist_add_boolean(nvlist_t *, const char *);
void fnvlist_add_boolean_value(nvlist_t *, const char *, boolean_t); _SYS_NVPAIR_H void fnvlist_add_boolean_value(nvlist_t *, const char *,
void fnvlist_add_byte(nvlist_t *, const char *, uchar_t); boolean_t);
void fnvlist_add_int8(nvlist_t *, const char *, int8_t); _SYS_NVPAIR_H void fnvlist_add_byte(nvlist_t *, const char *, uchar_t);
void fnvlist_add_uint8(nvlist_t *, const char *, uint8_t); _SYS_NVPAIR_H void fnvlist_add_int8(nvlist_t *, const char *, int8_t);
void fnvlist_add_int16(nvlist_t *, const char *, int16_t); _SYS_NVPAIR_H void fnvlist_add_uint8(nvlist_t *, const char *, uint8_t);
void fnvlist_add_uint16(nvlist_t *, const char *, uint16_t); _SYS_NVPAIR_H void fnvlist_add_int16(nvlist_t *, const char *, int16_t);
void fnvlist_add_int32(nvlist_t *, const char *, int32_t); _SYS_NVPAIR_H void fnvlist_add_uint16(nvlist_t *, const char *, uint16_t);
void fnvlist_add_uint32(nvlist_t *, const char *, uint32_t); _SYS_NVPAIR_H void fnvlist_add_int32(nvlist_t *, const char *, int32_t);
void fnvlist_add_int64(nvlist_t *, const char *, int64_t); _SYS_NVPAIR_H void fnvlist_add_uint32(nvlist_t *, const char *, uint32_t);
void fnvlist_add_uint64(nvlist_t *, const char *, uint64_t); _SYS_NVPAIR_H void fnvlist_add_int64(nvlist_t *, const char *, int64_t);
void fnvlist_add_string(nvlist_t *, const char *, const char *); _SYS_NVPAIR_H void fnvlist_add_uint64(nvlist_t *, const char *, uint64_t);
void fnvlist_add_nvlist(nvlist_t *, const char *, nvlist_t *); _SYS_NVPAIR_H void fnvlist_add_string(nvlist_t *, const char *, const char *);
void fnvlist_add_nvpair(nvlist_t *, nvpair_t *); _SYS_NVPAIR_H void fnvlist_add_nvlist(nvlist_t *, const char *, nvlist_t *);
void fnvlist_add_boolean_array(nvlist_t *, const char *, boolean_t *, uint_t); _SYS_NVPAIR_H void fnvlist_add_nvpair(nvlist_t *, nvpair_t *);
void fnvlist_add_byte_array(nvlist_t *, const char *, uchar_t *, uint_t); _SYS_NVPAIR_H void fnvlist_add_boolean_array(nvlist_t *, const char *,
void fnvlist_add_int8_array(nvlist_t *, const char *, int8_t *, uint_t); boolean_t *, uint_t);
void fnvlist_add_uint8_array(nvlist_t *, const char *, uint8_t *, uint_t); _SYS_NVPAIR_H void fnvlist_add_byte_array(nvlist_t *, const char *, uchar_t *,
void fnvlist_add_int16_array(nvlist_t *, const char *, int16_t *, uint_t); uint_t);
void fnvlist_add_uint16_array(nvlist_t *, const char *, uint16_t *, uint_t); _SYS_NVPAIR_H void fnvlist_add_int8_array(nvlist_t *, const char *, int8_t *,
void fnvlist_add_int32_array(nvlist_t *, const char *, int32_t *, uint_t); uint_t);
void fnvlist_add_uint32_array(nvlist_t *, const char *, uint32_t *, uint_t); _SYS_NVPAIR_H void fnvlist_add_uint8_array(nvlist_t *, const char *, uint8_t *,
void fnvlist_add_int64_array(nvlist_t *, const char *, int64_t *, uint_t); uint_t);
void fnvlist_add_uint64_array(nvlist_t *, const char *, uint64_t *, uint_t); _SYS_NVPAIR_H void fnvlist_add_int16_array(nvlist_t *, const char *, int16_t *,
void fnvlist_add_string_array(nvlist_t *, const char *, char * const *, uint_t); uint_t);
void fnvlist_add_nvlist_array(nvlist_t *, const char *, nvlist_t **, uint_t); _SYS_NVPAIR_H void fnvlist_add_uint16_array(nvlist_t *, const char *,
uint16_t *, uint_t);
_SYS_NVPAIR_H void fnvlist_add_int32_array(nvlist_t *, const char *, int32_t *,
uint_t);
_SYS_NVPAIR_H void fnvlist_add_uint32_array(nvlist_t *, const char *,
uint32_t *, uint_t);
_SYS_NVPAIR_H void fnvlist_add_int64_array(nvlist_t *, const char *, int64_t *,
uint_t);
_SYS_NVPAIR_H void fnvlist_add_uint64_array(nvlist_t *, const char *,
uint64_t *, uint_t);
_SYS_NVPAIR_H void fnvlist_add_string_array(nvlist_t *, const char *,
char * const *, uint_t);
_SYS_NVPAIR_H void fnvlist_add_nvlist_array(nvlist_t *, const char *,
nvlist_t **, uint_t);
void fnvlist_remove(nvlist_t *, const char *); _SYS_NVPAIR_H void fnvlist_remove(nvlist_t *, const char *);
void fnvlist_remove_nvpair(nvlist_t *, nvpair_t *); _SYS_NVPAIR_H void fnvlist_remove_nvpair(nvlist_t *, nvpair_t *);
nvpair_t *fnvlist_lookup_nvpair(nvlist_t *, const char *); _SYS_NVPAIR_H nvpair_t *fnvlist_lookup_nvpair(nvlist_t *, const char *);
boolean_t fnvlist_lookup_boolean(nvlist_t *, const char *); _SYS_NVPAIR_H boolean_t fnvlist_lookup_boolean(nvlist_t *, const char *);
boolean_t fnvlist_lookup_boolean_value(nvlist_t *, const char *); _SYS_NVPAIR_H boolean_t fnvlist_lookup_boolean_value(nvlist_t *, const char *);
uchar_t fnvlist_lookup_byte(nvlist_t *, const char *); _SYS_NVPAIR_H uchar_t fnvlist_lookup_byte(nvlist_t *, const char *);
int8_t fnvlist_lookup_int8(nvlist_t *, const char *); _SYS_NVPAIR_H int8_t fnvlist_lookup_int8(nvlist_t *, const char *);
int16_t fnvlist_lookup_int16(nvlist_t *, const char *); _SYS_NVPAIR_H int16_t fnvlist_lookup_int16(nvlist_t *, const char *);
int32_t fnvlist_lookup_int32(nvlist_t *, const char *); _SYS_NVPAIR_H int32_t fnvlist_lookup_int32(nvlist_t *, const char *);
int64_t fnvlist_lookup_int64(nvlist_t *, const char *); _SYS_NVPAIR_H int64_t fnvlist_lookup_int64(nvlist_t *, const char *);
uint8_t fnvlist_lookup_uint8(nvlist_t *, const char *); _SYS_NVPAIR_H uint8_t fnvlist_lookup_uint8(nvlist_t *, const char *);
uint16_t fnvlist_lookup_uint16(nvlist_t *, const char *); _SYS_NVPAIR_H uint16_t fnvlist_lookup_uint16(nvlist_t *, const char *);
uint32_t fnvlist_lookup_uint32(nvlist_t *, const char *); _SYS_NVPAIR_H uint32_t fnvlist_lookup_uint32(nvlist_t *, const char *);
uint64_t fnvlist_lookup_uint64(nvlist_t *, const char *); _SYS_NVPAIR_H uint64_t fnvlist_lookup_uint64(nvlist_t *, const char *);
char *fnvlist_lookup_string(nvlist_t *, const char *); _SYS_NVPAIR_H char *fnvlist_lookup_string(nvlist_t *, const char *);
nvlist_t *fnvlist_lookup_nvlist(nvlist_t *, const char *); _SYS_NVPAIR_H nvlist_t *fnvlist_lookup_nvlist(nvlist_t *, const char *);
boolean_t *fnvlist_lookup_boolean_array(nvlist_t *, const char *, uint_t *); _SYS_NVPAIR_H boolean_t *fnvlist_lookup_boolean_array(nvlist_t *, const char *,
uchar_t *fnvlist_lookup_byte_array(nvlist_t *, const char *, uint_t *); uint_t *);
int8_t *fnvlist_lookup_int8_array(nvlist_t *, const char *, uint_t *); _SYS_NVPAIR_H uchar_t *fnvlist_lookup_byte_array(nvlist_t *, const char *,
uint8_t *fnvlist_lookup_uint8_array(nvlist_t *, const char *, uint_t *); uint_t *);
int16_t *fnvlist_lookup_int16_array(nvlist_t *, const char *, uint_t *); _SYS_NVPAIR_H int8_t *fnvlist_lookup_int8_array(nvlist_t *, const char *,
uint16_t *fnvlist_lookup_uint16_array(nvlist_t *, const char *, uint_t *); uint_t *);
int32_t *fnvlist_lookup_int32_array(nvlist_t *, const char *, uint_t *); _SYS_NVPAIR_H uint8_t *fnvlist_lookup_uint8_array(nvlist_t *, const char *,
uint32_t *fnvlist_lookup_uint32_array(nvlist_t *, const char *, uint_t *); uint_t *);
int64_t *fnvlist_lookup_int64_array(nvlist_t *, const char *, uint_t *); _SYS_NVPAIR_H int16_t *fnvlist_lookup_int16_array(nvlist_t *, const char *,
uint64_t *fnvlist_lookup_uint64_array(nvlist_t *, const char *, uint_t *); uint_t *);
_SYS_NVPAIR_H uint16_t *fnvlist_lookup_uint16_array(nvlist_t *, const char *,
uint_t *);
_SYS_NVPAIR_H int32_t *fnvlist_lookup_int32_array(nvlist_t *, const char *,
uint_t *);
_SYS_NVPAIR_H uint32_t *fnvlist_lookup_uint32_array(nvlist_t *, const char *,
uint_t *);
_SYS_NVPAIR_H int64_t *fnvlist_lookup_int64_array(nvlist_t *, const char *,
uint_t *);
_SYS_NVPAIR_H uint64_t *fnvlist_lookup_uint64_array(nvlist_t *, const char *,
uint_t *);
boolean_t fnvpair_value_boolean_value(nvpair_t *nvp); _SYS_NVPAIR_H boolean_t fnvpair_value_boolean_value(nvpair_t *nvp);
uchar_t fnvpair_value_byte(nvpair_t *nvp); _SYS_NVPAIR_H uchar_t fnvpair_value_byte(nvpair_t *nvp);
int8_t fnvpair_value_int8(nvpair_t *nvp); _SYS_NVPAIR_H int8_t fnvpair_value_int8(nvpair_t *nvp);
int16_t fnvpair_value_int16(nvpair_t *nvp); _SYS_NVPAIR_H int16_t fnvpair_value_int16(nvpair_t *nvp);
int32_t fnvpair_value_int32(nvpair_t *nvp); _SYS_NVPAIR_H int32_t fnvpair_value_int32(nvpair_t *nvp);
int64_t fnvpair_value_int64(nvpair_t *nvp); _SYS_NVPAIR_H int64_t fnvpair_value_int64(nvpair_t *nvp);
uint8_t fnvpair_value_uint8(nvpair_t *nvp); _SYS_NVPAIR_H uint8_t fnvpair_value_uint8(nvpair_t *nvp);
uint16_t fnvpair_value_uint16(nvpair_t *nvp); _SYS_NVPAIR_H uint16_t fnvpair_value_uint16(nvpair_t *nvp);
uint32_t fnvpair_value_uint32(nvpair_t *nvp); _SYS_NVPAIR_H uint32_t fnvpair_value_uint32(nvpair_t *nvp);
uint64_t fnvpair_value_uint64(nvpair_t *nvp); _SYS_NVPAIR_H uint64_t fnvpair_value_uint64(nvpair_t *nvp);
char *fnvpair_value_string(nvpair_t *nvp); _SYS_NVPAIR_H char *fnvpair_value_string(nvpair_t *nvp);
nvlist_t *fnvpair_value_nvlist(nvpair_t *nvp); _SYS_NVPAIR_H nvlist_t *fnvpair_value_nvlist(nvpair_t *nvp);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -895,7 +895,6 @@ typedef struct spa_stats {
spa_history_list_t read_history; spa_history_list_t read_history;
spa_history_list_t txg_history; spa_history_list_t txg_history;
spa_history_kstat_t tx_assign_histogram; spa_history_kstat_t tx_assign_histogram;
spa_history_kstat_t io_history;
spa_history_list_t mmp_history; spa_history_list_t mmp_history;
spa_history_kstat_t state; /* pool state */ spa_history_kstat_t state; /* pool state */
spa_history_kstat_t iostats; spa_history_kstat_t iostats;

View file

@ -360,12 +360,6 @@ extern kstat_t *kstat_create(const char *, int,
const char *, const char *, uchar_t, ulong_t, uchar_t); const char *, const char *, uchar_t, ulong_t, uchar_t);
extern void kstat_install(kstat_t *); extern void kstat_install(kstat_t *);
extern void kstat_delete(kstat_t *); extern void kstat_delete(kstat_t *);
extern void kstat_waitq_enter(kstat_io_t *);
extern void kstat_waitq_exit(kstat_io_t *);
extern void kstat_runq_enter(kstat_io_t *);
extern void kstat_runq_exit(kstat_io_t *);
extern void kstat_waitq_to_runq(kstat_io_t *);
extern void kstat_runq_back_to_waitq(kstat_io_t *);
extern void kstat_set_raw_ops(kstat_t *ksp, extern void kstat_set_raw_ops(kstat_t *ksp,
int (*headers)(char *buf, size_t size), int (*headers)(char *buf, size_t size),
int (*data)(char *buf, size_t size, void *data), int (*data)(char *buf, size_t size, void *data),

View file

@ -25,7 +25,7 @@
*/ */
#ifndef _THREAD_POOL_H_ #ifndef _THREAD_POOL_H_
#define _THREAD_POOL_H_ #define _THREAD_POOL_H_ extern __attribute__((visibility("default")))
#include <sys/types.h> #include <sys/types.h>
#include <thread.h> #include <thread.h>
@ -37,33 +37,17 @@ extern "C" {
typedef struct tpool tpool_t; /* opaque thread pool descriptor */ typedef struct tpool tpool_t; /* opaque thread pool descriptor */
#if defined(__STDC__) _THREAD_POOL_H_ tpool_t *tpool_create(uint_t min_threads, uint_t max_threads,
extern tpool_t *tpool_create(uint_t min_threads, uint_t max_threads,
uint_t linger, pthread_attr_t *attr); uint_t linger, pthread_attr_t *attr);
extern int tpool_dispatch(tpool_t *tpool, _THREAD_POOL_H_ int tpool_dispatch(tpool_t *tpool,
void (*func)(void *), void *arg); void (*func)(void *), void *arg);
extern void tpool_destroy(tpool_t *tpool); _THREAD_POOL_H_ void tpool_destroy(tpool_t *tpool);
extern void tpool_abandon(tpool_t *tpool); _THREAD_POOL_H_ void tpool_abandon(tpool_t *tpool);
extern void tpool_wait(tpool_t *tpool); _THREAD_POOL_H_ void tpool_wait(tpool_t *tpool);
extern void tpool_suspend(tpool_t *tpool); _THREAD_POOL_H_ void tpool_suspend(tpool_t *tpool);
extern int tpool_suspended(tpool_t *tpool); _THREAD_POOL_H_ int tpool_suspended(tpool_t *tpool);
extern void tpool_resume(tpool_t *tpool); _THREAD_POOL_H_ void tpool_resume(tpool_t *tpool);
extern int tpool_member(tpool_t *tpool); _THREAD_POOL_H_ int tpool_member(tpool_t *tpool);
#else /* Non ANSI */
extern tpool_t *tpool_create();
extern int tpool_dispatch();
extern void tpool_destroy();
extern void tpool_abandon();
extern void tpool_wait();
extern void tpool_suspend();
extern int tpool_suspended();
extern void tpool_resume();
extern int tpool_member();
#endif /* __STDC__ */
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -4,6 +4,7 @@ VPATH = $(top_srcdir)/module/avl/
# Includes kernel code, generate warnings for large stack frames # Includes kernel code, generate warnings for large stack frames
AM_CFLAGS += $(FRAME_LARGER_THAN) AM_CFLAGS += $(FRAME_LARGER_THAN)
AM_CFLAGS += -fvisibility=hidden
noinst_LTLIBRARIES = libavl.la noinst_LTLIBRARIES = libavl.la

View file

@ -1,6 +1,7 @@
include $(top_srcdir)/config/Rules.am include $(top_srcdir)/config/Rules.am
AM_CFLAGS += $(LIBUUID_CFLAGS) $(ZLIB_CFLAGS) AM_CFLAGS += $(LIBUUID_CFLAGS) $(ZLIB_CFLAGS)
AM_CFLAGS += -fvisibility=hidden
noinst_LTLIBRARIES = libefi.la noinst_LTLIBRARIES = libefi.la

View file

@ -140,40 +140,6 @@ static struct uuid_to_ptag {
{ EFI_FREEDESKTOP_BOOT } { EFI_FREEDESKTOP_BOOT }
}; };
/*
* Default vtoc information for non-SVr4 partitions
*/
struct dk_map2 default_vtoc_map[NDKMAP] = {
{ V_ROOT, 0 }, /* a - 0 */
{ V_SWAP, V_UNMNT }, /* b - 1 */
{ V_BACKUP, V_UNMNT }, /* c - 2 */
{ V_UNASSIGNED, 0 }, /* d - 3 */
{ V_UNASSIGNED, 0 }, /* e - 4 */
{ V_UNASSIGNED, 0 }, /* f - 5 */
{ V_USR, 0 }, /* g - 6 */
{ V_UNASSIGNED, 0 }, /* h - 7 */
#if defined(_SUNOS_VTOC_16)
#if defined(i386) || defined(__amd64) || defined(__arm) || \
defined(__powerpc) || defined(__sparc) || defined(__s390__) || \
defined(__mips__) || defined(__rv64g__)
{ V_BOOT, V_UNMNT }, /* i - 8 */
{ V_ALTSCTR, 0 }, /* j - 9 */
#else
#error No VTOC format defined.
#endif /* defined(i386) */
{ V_UNASSIGNED, 0 }, /* k - 10 */
{ V_UNASSIGNED, 0 }, /* l - 11 */
{ V_UNASSIGNED, 0 }, /* m - 12 */
{ V_UNASSIGNED, 0 }, /* n - 13 */
{ V_UNASSIGNED, 0 }, /* o - 14 */
{ V_UNASSIGNED, 0 }, /* p - 15 */
#endif /* defined(_SUNOS_VTOC_16) */
};
int efi_debug = 0; int efi_debug = 0;
static int efi_read(int, struct dk_gpt *); static int efi_read(int, struct dk_gpt *);
@ -1692,57 +1658,3 @@ efi_err_check(struct dk_gpt *vtoc)
"no reserved partition found\n"); "no reserved partition found\n");
} }
} }
/*
* We need to get information necessary to construct a *new* efi
* label type
*/
int
efi_auto_sense(int fd, struct dk_gpt **vtoc)
{
int i;
/*
* Now build the default partition table
*/
if (efi_alloc_and_init(fd, EFI_NUMPAR, vtoc) != 0) {
if (efi_debug) {
(void) fprintf(stderr, "efi_alloc_and_init failed.\n");
}
return (-1);
}
for (i = 0; i < MIN((*vtoc)->efi_nparts, V_NUMPAR); i++) {
(*vtoc)->efi_parts[i].p_tag = default_vtoc_map[i].p_tag;
(*vtoc)->efi_parts[i].p_flag = default_vtoc_map[i].p_flag;
(*vtoc)->efi_parts[i].p_start = 0;
(*vtoc)->efi_parts[i].p_size = 0;
}
/*
* Make constants first
* and variable partitions later
*/
/* root partition - s0 128 MB */
(*vtoc)->efi_parts[0].p_start = 34;
(*vtoc)->efi_parts[0].p_size = 262144;
/* partition - s1 128 MB */
(*vtoc)->efi_parts[1].p_start = 262178;
(*vtoc)->efi_parts[1].p_size = 262144;
/* partition -s2 is NOT the Backup disk */
(*vtoc)->efi_parts[2].p_tag = V_UNASSIGNED;
/* partition -s6 /usr partition - HOG */
(*vtoc)->efi_parts[6].p_start = 524322;
(*vtoc)->efi_parts[6].p_size = (*vtoc)->efi_last_u_lba - 524322
- (1024 * 16);
/* efi reserved partition - s9 16K */
(*vtoc)->efi_parts[8].p_start = (*vtoc)->efi_last_u_lba - (1024 * 16);
(*vtoc)->efi_parts[8].p_size = (1024 * 16);
(*vtoc)->efi_parts[8].p_tag = V_RESERVED;
return (0);
}

View file

@ -7,6 +7,7 @@ VPATH = \
# Includes kernel code, generate warnings for large stack frames # Includes kernel code, generate warnings for large stack frames
# and required CFLAGS for libtirpc # and required CFLAGS for libtirpc
AM_CFLAGS += $(FRAME_LARGER_THAN) $(LIBTIRPC_CFLAGS) AM_CFLAGS += $(FRAME_LARGER_THAN) $(LIBTIRPC_CFLAGS)
AM_CFLAGS += -fvisibility=hidden
lib_LTLIBRARIES = libnvpair.la lib_LTLIBRARIES = libnvpair.la

File diff suppressed because it is too large Load diff

View file

@ -2,6 +2,8 @@ include $(top_srcdir)/config/Rules.am
DEFAULT_INCLUDES += -I$(srcdir) DEFAULT_INCLUDES += -I$(srcdir)
AM_CFLAGS += -fvisibility=hidden
noinst_LTLIBRARIES = libshare.la noinst_LTLIBRARIES = libshare.la
USER_C = \ USER_C = \

View file

@ -119,7 +119,7 @@ nfs_fini_tmpfile(const char *exports, char *tmpfile)
return (SA_OK); return (SA_OK);
} }
__attribute__((visibility("hidden"))) int int
nfs_toggle_share(const char *lockfile, const char *exports, nfs_toggle_share(const char *lockfile, const char *exports,
const char *expdir, sa_share_impl_t impl_share, const char *expdir, sa_share_impl_t impl_share,
int(*cbk)(sa_share_impl_t impl_share, char *filename)) int(*cbk)(sa_share_impl_t impl_share, char *filename))

View file

@ -147,7 +147,7 @@ translate_opts(const char *shareopts)
* This function copies all entries from the exports file to "filename", * This function copies all entries from the exports file to "filename",
* omitting any entries for the specified mountpoint. * omitting any entries for the specified mountpoint.
*/ */
__attribute__((visibility("hidden"))) int int
nfs_copy_entries(char *filename, const char *mountpoint) nfs_copy_entries(char *filename, const char *mountpoint)
{ {
int error = SA_OK; int error = SA_OK;

View file

@ -400,7 +400,7 @@ nfs_add_entry(const char *filename, const char *sharepath,
* This function copies all entries from the exports file to "filename", * This function copies all entries from the exports file to "filename",
* omitting any entries for the specified mountpoint. * omitting any entries for the specified mountpoint.
*/ */
__attribute__((visibility("hidden"))) int int
nfs_copy_entries(char *filename, const char *mountpoint) nfs_copy_entries(char *filename, const char *mountpoint)
{ {
char *buf = NULL; char *buf = NULL;

View file

@ -25,7 +25,7 @@
* Copyright (c) 2019, 2020 by Delphix. All rights reserved. * Copyright (c) 2019, 2020 by Delphix. All rights reserved.
*/ */
#ifndef _LIBSPL_LIBSHARE_H #ifndef _LIBSPL_LIBSHARE_H
#define _LIBSPL_LIBSHARE_H #define _LIBSPL_LIBSHARE_H extern __attribute__((visibility("default")))
/* API Initialization */ /* API Initialization */
#define SA_INIT_SHARE_API 0x0001 /* init share specific interface */ #define SA_INIT_SHARE_API 0x0001 /* init share specific interface */
@ -71,16 +71,16 @@
#define SA_SHARE_EXISTS 33 /* path or file is already shared */ #define SA_SHARE_EXISTS 33 /* path or file is already shared */
/* initialization */ /* initialization */
extern char *sa_errorstr(int); _LIBSPL_LIBSHARE_H char *sa_errorstr(int);
/* share control */ /* share control */
extern int sa_enable_share(const char *, const char *, const char *, _LIBSPL_LIBSHARE_H int sa_enable_share(const char *, const char *, const char *,
char *); char *);
extern int sa_disable_share(const char *, char *); _LIBSPL_LIBSHARE_H int sa_disable_share(const char *, char *);
extern boolean_t sa_is_shared(const char *, char *); _LIBSPL_LIBSHARE_H boolean_t sa_is_shared(const char *, char *);
extern void sa_commit_shares(const char *); _LIBSPL_LIBSHARE_H void sa_commit_shares(const char *);
/* protocol specific interfaces */ /* protocol specific interfaces */
extern int sa_validate_shareopts(char *, char *); _LIBSPL_LIBSHARE_H int sa_validate_shareopts(char *, char *);
#endif /* _LIBSPL_LIBSHARE_H */ #endif /* _LIBSPL_LIBSHARE_H */

View file

@ -796,12 +796,6 @@ extern void kstat_delete_byname(const char *, int, const char *);
extern void kstat_delete_byname_zone(const char *, int, const char *, zoneid_t); extern void kstat_delete_byname_zone(const char *, int, const char *, zoneid_t);
extern void kstat_named_init(kstat_named_t *, const char *, uchar_t); extern void kstat_named_init(kstat_named_t *, const char *, uchar_t);
extern void kstat_timer_init(kstat_timer_t *, const char *); extern void kstat_timer_init(kstat_timer_t *, const char *);
extern void kstat_waitq_enter(kstat_io_t *);
extern void kstat_waitq_exit(kstat_io_t *);
extern void kstat_runq_enter(kstat_io_t *);
extern void kstat_runq_exit(kstat_io_t *);
extern void kstat_waitq_to_runq(kstat_io_t *);
extern void kstat_runq_back_to_waitq(kstat_io_t *);
extern void kstat_timer_start(kstat_timer_t *); extern void kstat_timer_start(kstat_timer_t *);
extern void kstat_timer_stop(kstat_timer_t *); extern void kstat_timer_stop(kstat_timer_t *);

View file

@ -1,5 +1,7 @@
include $(top_srcdir)/config/Rules.am include $(top_srcdir)/config/Rules.am
AM_CFLAGS += -fvisibility=hidden
noinst_LTLIBRARIES = libtpool.la noinst_LTLIBRARIES = libtpool.la
USER_C = \ USER_C = \

View file

@ -34,8 +34,6 @@
<elf-symbol name='get_dataset_depth' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='get_dataset_depth' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='getprop_uint64' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='getprop_uint64' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='is_mounted' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='is_mounted' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='libshare_nfs_init' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='libshare_smb_init' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='libzfs_add_handle' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='libzfs_add_handle' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='libzfs_envvar_is_set' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='libzfs_envvar_is_set' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='libzfs_errno' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='libzfs_errno' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
@ -59,7 +57,6 @@
<elf-symbol name='permset_namecheck' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='permset_namecheck' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='pool_namecheck' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='pool_namecheck' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='printf_color' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='printf_color' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='register_fstype' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='sa_commit_shares' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='sa_commit_shares' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='sa_disable_share' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='sa_disable_share' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='sa_enable_share' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='sa_enable_share' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
@ -350,7 +347,6 @@
<elf-symbol name='fletcher_4_superscalar4_ops' size='64' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='fletcher_4_superscalar4_ops' size='64' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='fletcher_4_superscalar_ops' size='64' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='fletcher_4_superscalar_ops' size='64' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='libzfs_config_ops' size='16' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='libzfs_config_ops' size='16' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='smb_shares' size='8' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='spa_feature_table' size='1904' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='spa_feature_table' size='1904' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='zfeature_checks_disable' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='zfeature_checks_disable' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='zfs_deleg_perm_tab' size='512' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='zfs_deleg_perm_tab' size='512' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
@ -2686,13 +2682,6 @@
<parameter type-id='type-id-104'/> <parameter type-id='type-id-104'/>
<return type-id='type-id-8'/> <return type-id='type-id-8'/>
</function-decl> </function-decl>
<function-decl name='zfs_setprop_error' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-91'/>
<parameter type-id='type-id-85'/>
<parameter type-id='type-id-8'/>
<parameter type-id='type-id-17'/>
<return type-id='type-id-6'/>
</function-decl>
<function-decl name='changelist_free' visibility='default' binding='global' size-in-bits='64'> <function-decl name='changelist_free' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-231'/> <parameter type-id='type-id-231'/>
<return type-id='type-id-6'/> <return type-id='type-id-6'/>
@ -2701,6 +2690,13 @@
<parameter type-id='type-id-231'/> <parameter type-id='type-id-231'/>
<return type-id='type-id-8'/> <return type-id='type-id-8'/>
</function-decl> </function-decl>
<function-decl name='zfs_setprop_error' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-91'/>
<parameter type-id='type-id-85'/>
<parameter type-id='type-id-8'/>
<parameter type-id='type-id-17'/>
<return type-id='type-id-6'/>
</function-decl>
<function-decl name='nvlist_remove_all' visibility='default' binding='global' size-in-bits='64'> <function-decl name='nvlist_remove_all' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-104'/> <parameter type-id='type-id-104'/>
<parameter type-id='type-id-84'/> <parameter type-id='type-id-84'/>
@ -7576,6 +7572,51 @@
</function-decl> </function-decl>
</abi-instr> </abi-instr>
<abi-instr version='1.0' address-size='64' path='libshare.c' comp-dir-path='/home/nabijaczleweli/store/code/zfs/lib/libshare' language='LANG_C99'> <abi-instr version='1.0' address-size='64' path='libshare.c' comp-dir-path='/home/nabijaczleweli/store/code/zfs/lib/libshare' language='LANG_C99'>
<function-decl name='libshare_nfs_init' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-6'/>
</function-decl>
<function-decl name='libshare_smb_init' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-6'/>
</function-decl>
<function-decl name='sa_is_shared' mangled-name='sa_is_shared' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='sa_is_shared'>
<parameter type-id='type-id-84' name='mountpoint'/>
<parameter type-id='type-id-17' name='protocol'/>
<return type-id='type-id-16'/>
</function-decl>
</abi-instr>
<abi-instr version='1.0' address-size='64' path='nfs.c' comp-dir-path='/home/nabijaczleweli/store/code/zfs/lib/libshare' language='LANG_C99'>
<function-decl name='mkdir' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-84'/>
<parameter type-id='type-id-5'/>
<return type-id='type-id-8'/>
</function-decl>
<function-decl name='mkostemp' mangled-name='mkostemp64' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-17'/>
<parameter type-id='type-id-8'/>
<return type-id='type-id-8'/>
</function-decl>
<function-decl name='flock' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-8'/>
<parameter type-id='type-id-8'/>
<return type-id='type-id-8'/>
</function-decl>
<function-decl name='nfs_copy_entries' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-17'/>
<parameter type-id='type-id-84'/>
<return type-id='type-id-8'/>
</function-decl>
<function-decl name='rename' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-84'/>
<parameter type-id='type-id-84'/>
<return type-id='type-id-8'/>
</function-decl>
</abi-instr>
<abi-instr version='1.0' address-size='64' path='os/linux/nfs.c' comp-dir-path='/home/nabijaczleweli/store/code/zfs/lib/libshare' language='LANG_C99'>
<function-decl name='fputs' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-84'/>
<parameter type-id='type-id-150'/>
<return type-id='type-id-8'/>
</function-decl>
<class-decl name='sa_fstype' size-in-bits='256' is-struct='yes' visibility='default' id='type-id-533'> <class-decl name='sa_fstype' size-in-bits='256' is-struct='yes' visibility='default' id='type-id-533'>
<data-member access='public' layout-offset-in-bits='0'> <data-member access='public' layout-offset-in-bits='0'>
<var-decl name='next' type-id='type-id-534' visibility='default'/> <var-decl name='next' type-id='type-id-534' visibility='default'/>
@ -7643,23 +7684,21 @@
<typedef-decl name='sa_share_ops_t' type-id='type-id-536' id='type-id-555'/> <typedef-decl name='sa_share_ops_t' type-id='type-id-536' id='type-id-555'/>
<qualified-type-def type-id='type-id-555' const='yes' id='type-id-556'/> <qualified-type-def type-id='type-id-555' const='yes' id='type-id-556'/>
<pointer-type-def type-id='type-id-556' size-in-bits='64' id='type-id-535'/> <pointer-type-def type-id='type-id-556' size-in-bits='64' id='type-id-535'/>
<typedef-decl name='sa_fstype_t' type-id='type-id-533' id='type-id-557'/> <qualified-type-def type-id='type-id-536' const='yes' id='type-id-557'/>
<pointer-type-def type-id='type-id-557' size-in-bits='64' id='type-id-558'/> <pointer-type-def type-id='type-id-557' size-in-bits='64' id='type-id-558'/>
<function-decl name='register_fstype' mangled-name='register_fstype' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='register_fstype'> <function-decl name='register_fstype' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-84' name='name'/> <parameter type-id='type-id-84'/>
<parameter type-id='type-id-535' name='ops'/> <parameter type-id='type-id-558'/>
<return type-id='type-id-558'/> <return type-id='type-id-534'/>
</function-decl> </function-decl>
<function-decl name='libshare_nfs_init' visibility='default' binding='global' size-in-bits='64'> <pointer-type-def type-id='type-id-559' size-in-bits='64' id='type-id-560'/>
<return type-id='type-id-6'/> <function-decl name='nfs_toggle_share' visibility='default' binding='global' size-in-bits='64'>
</function-decl> <parameter type-id='type-id-84'/>
<function-decl name='libshare_smb_init' visibility='default' binding='global' size-in-bits='64'> <parameter type-id='type-id-84'/>
<return type-id='type-id-6'/> <parameter type-id='type-id-84'/>
</function-decl> <parameter type-id='type-id-547'/>
<function-decl name='sa_is_shared' mangled-name='sa_is_shared' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='sa_is_shared'> <parameter type-id='type-id-560'/>
<parameter type-id='type-id-84' name='mountpoint'/> <return type-id='type-id-8'/>
<parameter type-id='type-id-17' name='protocol'/>
<return type-id='type-id-16'/>
</function-decl> </function-decl>
<function-type size-in-bits='64' id='type-id-554'> <function-type size-in-bits='64' id='type-id-554'>
<return type-id='type-id-8'/> <return type-id='type-id-8'/>
@ -7668,6 +7707,11 @@
<parameter type-id='type-id-84'/> <parameter type-id='type-id-84'/>
<return type-id='type-id-8'/> <return type-id='type-id-8'/>
</function-type> </function-type>
<function-type size-in-bits='64' id='type-id-559'>
<parameter type-id='type-id-547'/>
<parameter type-id='type-id-17'/>
<return type-id='type-id-8'/>
</function-type>
<function-type size-in-bits='64' id='type-id-549'> <function-type size-in-bits='64' id='type-id-549'>
<parameter type-id='type-id-548'/> <parameter type-id='type-id-548'/>
<return type-id='type-id-8'/> <return type-id='type-id-8'/>
@ -7686,93 +7730,12 @@
<return type-id='type-id-6'/> <return type-id='type-id-6'/>
</function-type> </function-type>
</abi-instr> </abi-instr>
<abi-instr version='1.0' address-size='64' path='nfs.c' comp-dir-path='/home/nabijaczleweli/store/code/zfs/lib/libshare' language='LANG_C99'>
<function-decl name='mkdir' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-84'/>
<parameter type-id='type-id-5'/>
<return type-id='type-id-8'/>
</function-decl>
<function-decl name='mkostemp' mangled-name='mkostemp64' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-17'/>
<parameter type-id='type-id-8'/>
<return type-id='type-id-8'/>
</function-decl>
<function-decl name='flock' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-8'/>
<parameter type-id='type-id-8'/>
<return type-id='type-id-8'/>
</function-decl>
<function-decl name='nfs_copy_entries' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-17'/>
<parameter type-id='type-id-84'/>
<return type-id='type-id-8'/>
</function-decl>
<function-decl name='rename' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-84'/>
<parameter type-id='type-id-84'/>
<return type-id='type-id-8'/>
</function-decl>
</abi-instr>
<abi-instr version='1.0' address-size='64' path='os/linux/nfs.c' comp-dir-path='/home/nabijaczleweli/store/code/zfs/lib/libshare' language='LANG_C99'>
<function-decl name='fputs' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-84'/>
<parameter type-id='type-id-150'/>
<return type-id='type-id-8'/>
</function-decl>
<qualified-type-def type-id='type-id-536' const='yes' id='type-id-559'/>
<pointer-type-def type-id='type-id-559' size-in-bits='64' id='type-id-560'/>
<function-decl name='register_fstype' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-84'/>
<parameter type-id='type-id-560'/>
<return type-id='type-id-534'/>
</function-decl>
<pointer-type-def type-id='type-id-561' size-in-bits='64' id='type-id-562'/>
<function-decl name='nfs_toggle_share' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-84'/>
<parameter type-id='type-id-84'/>
<parameter type-id='type-id-84'/>
<parameter type-id='type-id-547'/>
<parameter type-id='type-id-562'/>
<return type-id='type-id-8'/>
</function-decl>
<function-type size-in-bits='64' id='type-id-561'>
<parameter type-id='type-id-547'/>
<parameter type-id='type-id-17'/>
<return type-id='type-id-8'/>
</function-type>
</abi-instr>
<abi-instr version='1.0' address-size='64' path='os/linux/smb.c' comp-dir-path='/home/nabijaczleweli/store/code/zfs/lib/libshare' language='LANG_C99'> <abi-instr version='1.0' address-size='64' path='os/linux/smb.c' comp-dir-path='/home/nabijaczleweli/store/code/zfs/lib/libshare' language='LANG_C99'>
<class-decl name='smb_share_s' size-in-bits='36992' is-struct='yes' visibility='default' id='type-id-563'>
<data-member access='public' layout-offset-in-bits='0'>
<var-decl name='name' type-id='type-id-564' visibility='default'/>
</data-member>
<data-member access='public' layout-offset-in-bits='2040'>
<var-decl name='path' type-id='type-id-109' visibility='default'/>
</data-member>
<data-member access='public' layout-offset-in-bits='34808'>
<var-decl name='comment' type-id='type-id-564' visibility='default'/>
</data-member>
<data-member access='public' layout-offset-in-bits='36864'>
<var-decl name='guest_ok' type-id='type-id-16' visibility='default'/>
</data-member>
<data-member access='public' layout-offset-in-bits='36928'>
<var-decl name='next' type-id='type-id-565' visibility='default'/>
</data-member>
</class-decl>
<array-type-def dimensions='1' type-id='type-id-32' size-in-bits='2040' id='type-id-564'>
<subrange length='255' type-id='type-id-33' id='type-id-566'/>
</array-type-def>
<pointer-type-def type-id='type-id-563' size-in-bits='64' id='type-id-565'/>
<typedef-decl name='smb_share_t' type-id='type-id-563' id='type-id-567'/>
<pointer-type-def type-id='type-id-567' size-in-bits='64' id='type-id-568'/>
<var-decl name='smb_shares' type-id='type-id-568' mangled-name='smb_shares' visibility='default' elf-symbol-id='smb_shares'/>
<function-decl name='opendir' visibility='default' binding='global' size-in-bits='64'> <function-decl name='opendir' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-84'/> <parameter type-id='type-id-84'/>
<return type-id='type-id-305'/> <return type-id='type-id-305'/>
</function-decl> </function-decl>
<class-decl name='dirent' size-in-bits='2240' is-struct='yes' visibility='default' id='type-id-569'> <class-decl name='dirent' size-in-bits='2240' is-struct='yes' visibility='default' id='type-id-561'>
<data-member access='public' layout-offset-in-bits='0'> <data-member access='public' layout-offset-in-bits='0'>
<var-decl name='d_ino' type-id='type-id-307' visibility='default'/> <var-decl name='d_ino' type-id='type-id-307' visibility='default'/>
</data-member> </data-member>
@ -7789,10 +7752,10 @@
<var-decl name='d_name' type-id='type-id-12' visibility='default'/> <var-decl name='d_name' type-id='type-id-12' visibility='default'/>
</data-member> </data-member>
</class-decl> </class-decl>
<pointer-type-def type-id='type-id-569' size-in-bits='64' id='type-id-570'/> <pointer-type-def type-id='type-id-561' size-in-bits='64' id='type-id-562'/>
<function-decl name='readdir' mangled-name='readdir64' visibility='default' binding='global' size-in-bits='64'> <function-decl name='readdir' mangled-name='readdir64' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-305'/> <parameter type-id='type-id-305'/>
<return type-id='type-id-570'/> <return type-id='type-id-562'/>
</function-decl> </function-decl>
<function-decl name='fgets' visibility='default' binding='global' size-in-bits='64'> <function-decl name='fgets' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-17'/> <parameter type-id='type-id-17'/>

View file

@ -4309,7 +4309,7 @@ zfs_save_arguments(int argc, char **argv, char *string, int len)
{ {
int i; int i;
(void) strlcpy(string, basename(argv[0]), len); (void) strlcpy(string, zfs_basename(argv[0]), len);
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
(void) strlcat(string, " ", len); (void) strlcat(string, " ", len);
(void) strlcat(string, argv[i], len); (void) strlcat(string, argv[i], len);

View file

@ -849,6 +849,7 @@ dump_ioctl(zfs_handle_t *zhp, const char *fromsnap, uint64_t fromsnap_obj,
case ERANGE: case ERANGE:
case EFAULT: case EFAULT:
case EROFS: case EROFS:
case EINVAL:
zfs_error_aux(hdl, "%s", strerror(errno)); zfs_error_aux(hdl, "%s", strerror(errno));
return (zfs_error(hdl, EZFS_BADBACKUP, errbuf)); return (zfs_error(hdl, EZFS_BADBACKUP, errbuf));

View file

@ -2,6 +2,8 @@ include $(top_srcdir)/config/Rules.am
pkgconfig_DATA = libzfs_core.pc pkgconfig_DATA = libzfs_core.pc
AM_CFLAGS += -fvisibility=hidden
lib_LTLIBRARIES = libzfs_core.la lib_LTLIBRARIES = libzfs_core.la
include $(top_srcdir)/config/Abigail.am include $(top_srcdir)/config/Abigail.am

File diff suppressed because it is too large Load diff

View file

@ -2,6 +2,8 @@ include $(top_srcdir)/config/Rules.am
pkgconfig_DATA = libzfsbootenv.pc pkgconfig_DATA = libzfsbootenv.pc
AM_CFLAGS += -fvisibility=hidden
lib_LTLIBRARIES = libzfsbootenv.la lib_LTLIBRARIES = libzfsbootenv.la
include $(top_srcdir)/config/Abigail.am include $(top_srcdir)/config/Abigail.am

View file

@ -31,6 +31,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <libzutil.h>
#include <sys/crypto/icp.h> #include <sys/crypto/icp.h>
#include <sys/processor.h> #include <sys/processor.h>
#include <sys/rrwlock.h> #include <sys/rrwlock.h>
@ -146,36 +147,6 @@ void
kstat_delete(kstat_t *ksp) kstat_delete(kstat_t *ksp)
{} {}
/*ARGSUSED*/
void
kstat_waitq_enter(kstat_io_t *kiop)
{}
/*ARGSUSED*/
void
kstat_waitq_exit(kstat_io_t *kiop)
{}
/*ARGSUSED*/
void
kstat_runq_enter(kstat_io_t *kiop)
{}
/*ARGSUSED*/
void
kstat_runq_exit(kstat_io_t *kiop)
{}
/*ARGSUSED*/
void
kstat_waitq_to_runq(kstat_io_t *kiop)
{}
/*ARGSUSED*/
void
kstat_runq_back_to_waitq(kstat_io_t *kiop)
{}
void void
kstat_set_raw_ops(kstat_t *ksp, kstat_set_raw_ops(kstat_t *ksp,
int (*headers)(char *buf, size_t size), int (*headers)(char *buf, size_t size),
@ -571,19 +542,10 @@ void
__dprintf(boolean_t dprint, const char *file, const char *func, __dprintf(boolean_t dprint, const char *file, const char *func,
int line, const char *fmt, ...) int line, const char *fmt, ...)
{ {
const char *newfile; /* Get rid of annoying "../common/" prefix to filename. */
const char *newfile = zfs_basename(file);
va_list adx; va_list adx;
/*
* Get rid of annoying "../common/" prefix to filename.
*/
newfile = strrchr(file, '/');
if (newfile != NULL) {
newfile = newfile + 1; /* Get rid of leading / */
} else {
newfile = file;
}
if (dprint) { if (dprint) {
/* dprintf messages are printed immediately */ /* dprintf messages are printed immediately */
@ -1070,7 +1032,7 @@ zfs_file_open(const char *path, int flags, int mode, zfs_file_t **fpp)
if (vn_dumpdir != NULL) { if (vn_dumpdir != NULL) {
char *dumppath = umem_zalloc(MAXPATHLEN, UMEM_NOFAIL); char *dumppath = umem_zalloc(MAXPATHLEN, UMEM_NOFAIL);
char *inpath = basename((char *)(uintptr_t)path); const char *inpath = zfs_basename(path);
(void) snprintf(dumppath, MAXPATHLEN, (void) snprintf(dumppath, MAXPATHLEN,
"%s/%s", vn_dumpdir, inpath); "%s/%s", vn_dumpdir, inpath);

View file

@ -3,6 +3,7 @@ include $(top_srcdir)/config/Rules.am
# Suppress unused but set variable warnings often due to ASSERTs # Suppress unused but set variable warnings often due to ASSERTs
AM_CFLAGS += $(NO_UNUSED_BUT_SET_VARIABLE) AM_CFLAGS += $(NO_UNUSED_BUT_SET_VARIABLE)
AM_CFLAGS += $(LIBBLKID_CFLAGS) $(LIBUDEV_CFLAGS) AM_CFLAGS += $(LIBBLKID_CFLAGS) $(LIBUDEV_CFLAGS)
AM_CFLAGS += -fvisibility=hidden
DEFAULT_INCLUDES += -I$(srcdir) DEFAULT_INCLUDES += -I$(srcdir)

View file

@ -168,7 +168,7 @@ out:
(void) close(fd); (void) close(fd);
} }
static const char * static const char * const
zpool_default_import_path[] = { zpool_default_import_path[] = {
"/dev" "/dev"
}; };

View file

@ -74,21 +74,21 @@
#endif #endif
#include <blkid/blkid.h> #include <blkid/blkid.h>
#define DEFAULT_IMPORT_PATH_SIZE 9
#define DEV_BYID_PATH "/dev/disk/by-id/" #define DEV_BYID_PATH "/dev/disk/by-id/"
/*
* Skip devices with well known prefixes:
* there can be side effects when opening devices which need to be avoided.
*
* hpet - High Precision Event Timer
* watchdog[N] - Watchdog must be closed in a special way.
*/
static boolean_t static boolean_t
is_watchdog_dev(char *dev) should_skip_dev(const char *dev)
{ {
/* For 'watchdog' dev */ return ((strcmp(dev, "watchdog") == 0) ||
if (strcmp(dev, "watchdog") == 0) (strncmp(dev, "watchdog", 8) == 0 && isdigit(dev[8])) ||
return (B_TRUE); (strcmp(dev, "hpet") == 0));
/* For 'watchdog<digit><whatever> */
if (strstr(dev, "watchdog") == dev && isdigit(dev[8]))
return (B_TRUE);
return (B_FALSE);
} }
int int
@ -104,31 +104,21 @@ zpool_open_func(void *arg)
libpc_handle_t *hdl = rn->rn_hdl; libpc_handle_t *hdl = rn->rn_hdl;
struct stat64 statbuf; struct stat64 statbuf;
nvlist_t *config; nvlist_t *config;
char *bname, *dupname;
uint64_t vdev_guid = 0; uint64_t vdev_guid = 0;
int error; int error;
int num_labels = 0; int num_labels = 0;
int fd; int fd;
/* if (should_skip_dev(zfs_basename(rn->rn_name)))
* Skip devices with well known prefixes there can be side effects
* when opening devices which need to be avoided.
*
* hpet - High Precision Event Timer
* watchdog - Watchdog must be closed in a special way.
*/
dupname = zutil_strdup(hdl, rn->rn_name);
bname = basename(dupname);
error = ((strcmp(bname, "hpet") == 0) || is_watchdog_dev(bname));
free(dupname);
if (error)
return; return;
/* /*
* Ignore failed stats. We only want regular files and block devices. * Ignore failed stats. We only want regular files and block devices.
* Ignore files that are too small to hold a zpool.
*/ */
if (stat64(rn->rn_name, &statbuf) != 0 || if (stat64(rn->rn_name, &statbuf) != 0 ||
(!S_ISREG(statbuf.st_mode) && !S_ISBLK(statbuf.st_mode))) (!S_ISREG(statbuf.st_mode) && !S_ISBLK(statbuf.st_mode)) ||
(S_ISREG(statbuf.st_mode) && statbuf.st_size < SPA_MINDEVSIZE))
return; return;
/* /*
@ -144,14 +134,6 @@ zpool_open_func(void *arg)
if (fd < 0) if (fd < 0)
return; return;
/*
* This file is too small to hold a zpool
*/
if (S_ISREG(statbuf.st_mode) && statbuf.st_size < SPA_MINDEVSIZE) {
(void) close(fd);
return;
}
error = zpool_read_label(fd, &config, &num_labels); error = zpool_read_label(fd, &config, &num_labels);
if (error != 0) { if (error != 0) {
(void) close(fd); (void) close(fd);
@ -255,8 +237,8 @@ zpool_open_func(void *arg)
} }
} }
static char * static const char * const
zpool_default_import_path[DEFAULT_IMPORT_PATH_SIZE] = { zpool_default_import_path[] = {
"/dev/disk/by-vdev", /* Custom rules, use first if they exist */ "/dev/disk/by-vdev", /* Custom rules, use first if they exist */
"/dev/mapper", /* Use multipath devices before components */ "/dev/mapper", /* Use multipath devices before components */
"/dev/disk/by-partlabel", /* Single unique entry set by user */ "/dev/disk/by-partlabel", /* Single unique entry set by user */
@ -271,8 +253,8 @@ zpool_default_import_path[DEFAULT_IMPORT_PATH_SIZE] = {
const char * const * const char * const *
zpool_default_search_paths(size_t *count) zpool_default_search_paths(size_t *count)
{ {
*count = DEFAULT_IMPORT_PATH_SIZE; *count = ARRAY_SIZE(zpool_default_import_path);
return ((const char * const *)zpool_default_import_path); return (zpool_default_import_path);
} }
/* /*
@ -300,7 +282,7 @@ zfs_path_order(char *name, int *order)
} }
free(envdup); free(envdup);
} else { } else {
for (i = 0; i < DEFAULT_IMPORT_PATH_SIZE; i++) { for (i = 0; i < ARRAY_SIZE(zpool_default_import_path); i++) {
if (strncmp(name, zpool_default_import_path[i], if (strncmp(name, zpool_default_import_path[i],
strlen(zpool_default_import_path[i])) == 0) { strlen(zpool_default_import_path[i])) == 0) {
*order = i; *order = i;

View file

@ -31,6 +31,22 @@
#include <libzutil.h> #include <libzutil.h>
/* Substring from after the last slash, or the string itself if none */
const char *
zfs_basename(const char *path)
{
const char *bn = strrchr(path, '/');
return (bn ? bn + 1 : path);
}
/* Return index of last slash or -1 if none */
ssize_t
zfs_dirnamelen(const char *path)
{
const char *end = strrchr(path, '/');
return (end ? end - path : -1);
}
/* /*
* Given a shorthand device name check if a file by that name exists in any * Given a shorthand device name check if a file by that name exists in any
* of the 'zpool_default_import_path' or ZPOOL_IMPORT_PATH directories. If * of the 'zpool_default_import_path' or ZPOOL_IMPORT_PATH directories. If

View file

@ -154,6 +154,17 @@ zutil_strdup(libpc_handle_t *hdl, const char *str)
return (ret); return (ret);
} }
static char *
zutil_strndup(libpc_handle_t *hdl, const char *str, size_t n)
{
char *ret;
if ((ret = strndup(str, n)) == NULL)
(void) zutil_no_memory(hdl);
return (ret);
}
/* /*
* Intermediate structures used to gather configuration information. * Intermediate structures used to gather configuration information.
*/ */
@ -1243,10 +1254,21 @@ zpool_find_import_scan_dir(libpc_handle_t *hdl, pthread_mutex_t *lock,
while ((dp = readdir64(dirp)) != NULL) { while ((dp = readdir64(dirp)) != NULL) {
const char *name = dp->d_name; const char *name = dp->d_name;
if (name[0] == '.' && if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0)
(name[1] == 0 || (name[1] == '.' && name[2] == 0)))
continue; continue;
switch (dp->d_type) {
case DT_UNKNOWN:
case DT_BLK:
#ifdef __FreeBSD__
case DT_CHR:
#endif
case DT_REG:
break;
default:
continue;
}
zpool_find_import_scan_add_slice(hdl, lock, cache, path, name, zpool_find_import_scan_add_slice(hdl, lock, cache, path, name,
order); order);
} }
@ -1261,20 +1283,22 @@ zpool_find_import_scan_path(libpc_handle_t *hdl, pthread_mutex_t *lock,
{ {
int error = 0; int error = 0;
char path[MAXPATHLEN]; char path[MAXPATHLEN];
char *d, *b; char *d = NULL;
char *dpath, *name; ssize_t dl;
const char *dpath, *name;
/* /*
* Separate the directory part and last part of the * Separate the directory and the basename.
* path. We do this so that we can get the realpath of * We do this so that we can get the realpath of
* the directory. We don't get the realpath on the * the directory. We don't get the realpath on the
* whole path because if it's a symlink, we want the * whole path because if it's a symlink, we want the
* path of the symlink not where it points to. * path of the symlink not where it points to.
*/ */
d = zutil_strdup(hdl, dir); name = zfs_basename(dir);
b = zutil_strdup(hdl, dir); if ((dl = zfs_dirnamelen(dir)) == -1)
dpath = dirname(d); dpath = ".";
name = basename(b); else
dpath = d = zutil_strndup(hdl, dir, dl);
if (realpath(dpath, path) == NULL) { if (realpath(dpath, path) == NULL) {
error = errno; error = errno;
@ -1292,7 +1316,6 @@ zpool_find_import_scan_path(libpc_handle_t *hdl, pthread_mutex_t *lock,
zpool_find_import_scan_add_slice(hdl, lock, cache, path, name, order); zpool_find_import_scan_add_slice(hdl, lock, cache, path, name, order);
out: out:
free(b);
free(d); free(d);
return (error); return (error);
} }
@ -1495,6 +1518,7 @@ discover_cached_paths(libpc_handle_t *hdl, nvlist_t *nv,
avl_tree_t *cache, pthread_mutex_t *lock) avl_tree_t *cache, pthread_mutex_t *lock)
{ {
char *path = NULL; char *path = NULL;
ssize_t dl;
uint_t children; uint_t children;
nvlist_t **child; nvlist_t **child;
@ -1510,8 +1534,12 @@ discover_cached_paths(libpc_handle_t *hdl, nvlist_t *nv,
* our directory cache. * our directory cache.
*/ */
if (nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path) == 0) { if (nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path) == 0) {
if ((dl = zfs_dirnamelen(path)) == -1)
path = ".";
else
path[dl] = '\0';
return (zpool_find_import_scan_dir(hdl, lock, cache, return (zpool_find_import_scan_dir(hdl, lock, cache,
dirname(path), 0)); path, 0));
} }
return (0); return (0);
} }

View file

@ -1 +1,117 @@
SUBDIRS = man1 man5 man8 include $(top_srcdir)/config/Substfiles.am
EXTRA_DIST += \
man1/cstyle.1
dist_man_MANS = \
man1/zhack.1 \
man1/ztest.1 \
man1/raidz_test.1 \
man1/zvol_wait.1 \
man1/arcstat.1 \
\
man5/vdev_id.conf.5 \
\
man4/spl.4 \
man4/zfs.4 \
\
man7/zpool-features.7 \
man7/zfsconcepts.7 \
man7/zfsprops.7 \
man7/zpoolconcepts.7 \
man7/zpoolprops.7 \
\
man8/fsck.zfs.8 \
man8/mount.zfs.8 \
man8/vdev_id.8 \
man8/zdb.8 \
man8/zfs.8 \
man8/zfs-allow.8 \
man8/zfs-bookmark.8 \
man8/zfs-change-key.8 \
man8/zfs-clone.8 \
man8/zfs-create.8 \
man8/zfs-destroy.8 \
man8/zfs-diff.8 \
man8/zfs-get.8 \
man8/zfs-groupspace.8 \
man8/zfs-hold.8 \
man8/zfs-inherit.8 \
man8/zfs-jail.8 \
man8/zfs-list.8 \
man8/zfs-load-key.8 \
man8/zfs-mount.8 \
man8/zfs-program.8 \
man8/zfs-project.8 \
man8/zfs-projectspace.8 \
man8/zfs-promote.8 \
man8/zfs-receive.8 \
man8/zfs-recv.8 \
man8/zfs-redact.8 \
man8/zfs-release.8 \
man8/zfs-rename.8 \
man8/zfs-rollback.8 \
man8/zfs-send.8 \
man8/zfs-set.8 \
man8/zfs-share.8 \
man8/zfs-snapshot.8 \
man8/zfs-unallow.8 \
man8/zfs-unjail.8 \
man8/zfs-unload-key.8 \
man8/zfs-unmount.8 \
man8/zfs-upgrade.8 \
man8/zfs-userspace.8 \
man8/zfs-wait.8 \
man8/zfs_ids_to_path.8 \
man8/zgenhostid.8 \
man8/zinject.8 \
man8/zpool.8 \
man8/zpool-add.8 \
man8/zpool-attach.8 \
man8/zpool-checkpoint.8 \
man8/zpool-clear.8 \
man8/zpool-create.8 \
man8/zpool-destroy.8 \
man8/zpool-detach.8 \
man8/zpool-events.8 \
man8/zpool-export.8 \
man8/zpool-get.8 \
man8/zpool-history.8 \
man8/zpool-import.8 \
man8/zpool-initialize.8 \
man8/zpool-iostat.8 \
man8/zpool-labelclear.8 \
man8/zpool-list.8 \
man8/zpool-offline.8 \
man8/zpool-online.8 \
man8/zpool-reguid.8 \
man8/zpool-remove.8 \
man8/zpool-reopen.8 \
man8/zpool-replace.8 \
man8/zpool-resilver.8 \
man8/zpool-scrub.8 \
man8/zpool-set.8 \
man8/zpool-split.8 \
man8/zpool-status.8 \
man8/zpool-sync.8 \
man8/zpool-trim.8 \
man8/zpool-upgrade.8 \
man8/zpool-wait.8 \
man8/zstream.8 \
man8/zstreamdump.8 \
man8/zpool_influxdb.8
nodist_man_MANS = \
man8/zed.8 \
man8/zfs-mount-generator.8
SUBSTFILES += $(nodist_man_MANS)
if BUILD_LINUX
# The manual pager in most Linux distros defaults to "BSD" when .Os is blank,
# but leaving it blank makes things a lot easier on
# FreeBSD when OpenZFS is vendored in the base system.
install-data-hook:
cd $(DESTDIR)$(mandir) && $(SED) ${ac_inplace} -e 's/^\.Os$$/.Os OpenZFS/' $(dist_man_MANS) $(nodist_man_MANS)
endif

View file

@ -1,12 +0,0 @@
dist_man_MANS = zhack.1 ztest.1 raidz_test.1 zvol_wait.1 arcstat.1
EXTRA_DIST = cstyle.1
if BUILD_LINUX
# The man pager in most Linux distros defaults to BSD instead of Linux
# when .Os is blank, but leaving it blank makes things a lot easier on
# FreeBSD when OpenZFS is vendored in the base system.
install-data-hook:
cd $(DESTDIR)$(mandir)/man1; \
$(SED) ${ac_inplace} -e 's/^\.Os$$/.Os Linux/' \
$(dist_man_MANS)
endif

View file

@ -22,7 +22,7 @@
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm .Nm
.Op Fl havxp .Op Fl havxp
.Op Fl f Ar field Ns Op , Ns Ar field Ns ... .Op Fl f Ar field Ns Op , Ns Ar field Ns
.Op Fl o Ar file .Op Fl o Ar file
.Op Fl s Ar string .Op Fl s Ar string
.Op Ar interval .Op Ar interval
@ -31,7 +31,7 @@
.Sh DESCRIPTION .Sh DESCRIPTION
.Nm .Nm
prints various ZFS ARC and L2ARC statistics in vmstat-like fashion: prints various ZFS ARC and L2ARC statistics in vmstat-like fashion:
.Bl -tag -width "l2asize" .Bl -tag -compact -offset Ds -width "l2asize"
.It Sy c .It Sy c
ARC target size ARC target size
.It Sy dh% .It Sy dh%
@ -155,7 +155,7 @@ Print all possible stats.
.It Fl f .It Fl f
Display only specific fields. Display only specific fields.
See See
.Sy DESCRIPTION .Sx DESCRIPTION
for supported statistics. for supported statistics.
.It Fl h .It Fl h
Display help message. Display help message.
@ -166,17 +166,19 @@ Disable auto-scaling of numerical fields (for raw, machine-parsable values).
.It Fl s .It Fl s
Display data with a specified separator (default: 2 spaces). Display data with a specified separator (default: 2 spaces).
.It Fl x .It Fl x
Print extended stats (same as Print extended stats
.Fl f Ar time,mfu,mru,mfug,mrug,eskip,mtxmis,dread,pread,read Ns No ). .Pq same as Fl f Sy time , Ns Sy mfu , Ns Sy mru , Ns Sy mfug , Ns Sy mrug , Ns Sy eskip , Ns Sy mtxmis , Ns Sy dread , Ns Sy pread , Ns Sy read .
.It Fl v .It Fl v
Show field headers and definitions Show field headers and definitions
.El .El
. .
.Sh OPERANDS .Sh OPERANDS
The following operands are supported: The following operands are supported:
.Bl -tag -width "interval" .Bl -tag -compact -offset Ds -width "interval"
.It Ar interval .It Ar interval
Specify the sampling interval in seconds. Specify the sampling interval in seconds.
.It Ar count .It Ar count
Display only \fIcount\fR reports. Display only
.Ar count
reports.
.El .El

View file

@ -31,7 +31,7 @@
.Nm .Nm
.Op Fl chpvCP .Op Fl chpvCP
.Op Fl o Ar construct Ns Op , Ns Ar construct Ns .Op Fl o Ar construct Ns Op , Ns Ar construct Ns
.Op Ar file .Oo Ar file Oc Ns
.Sh DESCRIPTION .Sh DESCRIPTION
.Nm .Nm
inspects C source files (*.c and *.h) for common stylistic errors. inspects C source files (*.c and *.h) for common stylistic errors.
@ -99,7 +99,7 @@ Allow doxygen-style block comments
.Pq Sy /** No and Sy /*!\& . .Pq Sy /** No and Sy /*!\& .
.It Sy splint .It Sy splint
Allow splint-style lint comments Allow splint-style lint comments
.Pq Sy /*@...@*/ . .Pq Sy /*@ Ns ... Ns Sy @*/ .
.El .El
.El .El
. .
@ -118,29 +118,28 @@ statement has balanced parenthesis.
.It .It
Some Some
.Xr cpp 1 .Xr cpp 1
macros do not require \fB;\fPs after them. macros do not require
.Sy ;\& Ns s after them.
Any such macros Any such macros
.Em must .Em must
be ALL_CAPS; any lower case letters will cause bad output. be ALL_CAPS; any lower case letters will cause bad output.
.Pp .Pp
The bad output will generally be corrected after the next \fB;\fP, The bad output will generally be corrected after the next
.Sy { , .Sy ;\& , { , No or Sy } .
or
.Sy } .
.El .El
Some continuation error messages deserve some additional explanation: Some continuation error messages deserve some additional explanation:
.Bl -tag -width Ds .Bl -tag -width Ds
.It Sy multiple statements continued over multiple lines .It Sy multiple statements continued over multiple lines
A multi-line statement which is not broken at statement boundaries. A multi-line statement which is not broken at statement boundaries.
For example: For example:
.Bd -literal .Bd -literal -compact -offset Ds
if (this_is_a_long_variable == another_variable) a = if (this_is_a_long_variable == another_variable) a =
b + c; b + c;
.Ed .Ed
.Pp .Pp
Will trigger this error. Will trigger this error.
Instead, do: Instead, do:
.Bd -literal .Bd -literal -compact -offset Ds
if (this_is_a_long_variable == another_variable) if (this_is_a_long_variable == another_variable)
a = b + c; a = b + c;
.Ed .Ed
@ -148,13 +147,13 @@ if (this_is_a_long_variable == another_variable)
For visibility, empty bodies for if, for, and while statements should be For visibility, empty bodies for if, for, and while statements should be
on their own line. on their own line.
For example: For example:
.Bd -literal .Bd -literal -compact -offset Ds
while (do_something(&x) == 0); while (do_something(&x) == 0);
.Ed .Ed
.Pp .Pp
Will trigger this error. Will trigger this error.
Instead, do: Instead, do:
.Bd -literal .Bd -literal -compact -offset Ds
while (do_something(&x) == 0) while (do_something(&x) == 0)
; ;
.Ed .Ed

View file

@ -50,44 +50,44 @@ option.
.Bl -tag -width "-B(enchmark)" .Bl -tag -width "-B(enchmark)"
.It Fl h .It Fl h
Print a help summary. Print a help summary.
.It Fl a Ar ashift No (default: Sy 9 ) .It Fl a Ar ashift Pq default: Sy 9
Ashift value. Ashift value.
.It Fl o Ar zio_off_shift No (default: Sy 0 ) .It Fl o Ar zio_off_shift Pq default: Sy 0
ZIO offset for each raidz block. ZIO offset for each raidz block.
The offset's value is The offset's value is
.Sy 1 << zio_off_shift . .Em 2^zio_off_shift .
.It Fl d Ar raidz_data_disks No (default: Sy 8 ) .It Fl d Ar raidz_data_disks Pq default: Sy 8
Number of raidz data disks to use. Number of raidz data disks to use.
Additional disks will be used for parity. Additional disks will be used for parity.
.It Fl s Ar zio_size_shift No (default: Sy 19 ) .It Fl s Ar zio_size_shift Pq default: Sy 19
Size of data for raidz block. Size of data for raidz block.
The real size is The real size is
.Sy 1 << zio_size_shift . .Em 2^zio_size_shift .
.It Fl r Ar reflow_offset No (default: Sy uint max ) .It Fl r Ar reflow_offset Pq default: Sy uint max
Set raidz expansion offset. Set raidz expansion offset.
The expanded raidz map allocation function will The expanded raidz map allocation function will
produce different map configurations depending on this value. produce different map configurations depending on this value.
.It Fl S Ns No (weep) .It Fl S Ns Pq weep
Sweep parameter space while verifying the raidz implementations. Sweep parameter space while verifying the raidz implementations.
This option This option
will exhaust all most of valid values for the will exhaust all most of valid values for the
.Fl aods .Fl aods
options. options.
Runtime using this option will be long. Runtime using this option will be long.
.It Fl t Ns No (imeout) .It Fl t Ns Pq imeout
Wall time for sweep test in seconds. Wall time for sweep test in seconds.
The actual runtime could be longer. The actual runtime could be longer.
.It Fl B Ns No (enchmark) .It Fl B Ns Pq enchmark
All implementations are benchmarked using increasing per disk data size. All implementations are benchmarked using increasing per disk data size.
Results are given as throughput per disk, measured in MiB/s. Results are given as throughput per disk, measured in MiB/s.
.It Fl e Ns No (xpansion) .It Fl e Ns Pq xpansion
Use expanded raidz map allocation function. Use expanded raidz map allocation function.
.It Fl v Ns No (erbose) .It Fl v Ns Pq erbose
Increase verbosity. Increase verbosity.
.It Fl T Ns No (est the test) .It Fl T Ns Pq est the test
Debugging option: fail all tests. Debugging option: fail all tests.
This is to check if tests would properly verify bit-exactness. This is to check if tests would properly verify bit-exactness.
.It Fl D Ns No (ebug) .It Fl D Ns Pq ebug
Debugging option: attach Debugging option: attach
.Xr gdb 1 .Xr gdb 1
when when

View file

@ -119,7 +119,7 @@ Can be specified more than once.
. .
.Sh EXAMPLES .Sh EXAMPLES
.Bd -literal .Bd -literal
# zhack feature stat tank .No # Nm zhack Cm feature stat Ar tank
for_read_obj: for_read_obj:
org.illumos:lz4_compress = 0 org.illumos:lz4_compress = 0
for_write_obj: for_write_obj:
@ -130,13 +130,11 @@ descriptions_obj:
com.delphix:empty_bpobj = Snapshots use less space. com.delphix:empty_bpobj = Snapshots use less space.
org.illumos:lz4_compress = LZ4 compression algorithm support. org.illumos:lz4_compress = LZ4 compression algorithm support.
# zhack feature enable -d 'Predict future disk failures.' \\ .No # Nm zhack Cm feature enable Fl d No 'Predict future disk failures.' Ar tank com.example:clairvoyance
tank com.example:clairvoyance .No # Nm zhack Cm feature ref Ar tank com.example:clairvoyance
# zhack feature ref tank com.example:clairvoyance
.Ed .Ed
. .
.Sh SEE ALSO .Sh SEE ALSO
.Xr ztest 1 , .Xr ztest 1 ,
.Xr zpool-features 5 , .Xr zpool-features 7 ,
.Xr zfs 8 .Xr zfs 8

View file

@ -230,4 +230,4 @@ By default the stack size is limited to
.Xr zdb 1 , .Xr zdb 1 ,
.Xr zfs 1 , .Xr zfs 1 ,
.Xr zpool 1 , .Xr zpool 1 ,
.Xr spl-module-parameters 5 .Xr spl 4

View file

@ -15,11 +15,11 @@
.\" Copyright 2013 Turbo Fredriksson <turbo@bayour.com>. All rights reserved. .\" Copyright 2013 Turbo Fredriksson <turbo@bayour.com>. All rights reserved.
.\" .\"
.Dd August 24, 2020 .Dd August 24, 2020
.Dt SPL-MODULE-PARAMETERS 5 .Dt SPL 4
.Os .Os
. .
.Sh NAME .Sh NAME
.Nm spl-module-parameters .Nm spl
.Nd parameters of the SPL kernel module .Nd parameters of the SPL kernel module
. .
.Sh DESCRIPTION .Sh DESCRIPTION
@ -192,5 +192,4 @@ The proc file will walk the lists with lock held,
reading it could cause a lock-up if the list grow too large reading it could cause a lock-up if the list grow too large
without limiting the output. without limiting the output.
"(truncated)" will be shown if the list is larger than the limit. "(truncated)" will be shown if the list is larger than the limit.
.
.El .El

View file

@ -16,14 +16,15 @@
.\" Portions Copyright [yyyy] [name of copyright owner] .\" Portions Copyright [yyyy] [name of copyright owner]
.\" .\"
.Dd June 1, 2021 .Dd June 1, 2021
.Dt ZFS-MODULE-PARAMETERS 5 .Dt ZFS 4
.Os .Os
. .
.Sh NAME .Sh NAME
.Nm zfs-module-parameters .Nm zfs
.Nd parameters of the ZFS kernel module .Nd tuning of the ZFS kernel module
. .
.Sh DESCRIPTION .Sh DESCRIPTION
The ZFS module supports these parameters:
.Bl -tag -width Ds .Bl -tag -width Ds
.It Sy dbuf_cache_max_bytes Ns = Ns Sy ULONG_MAX Ns B Pq ulong .It Sy dbuf_cache_max_bytes Ns = Ns Sy ULONG_MAX Ns B Pq ulong
Maximum size in bytes of the dbuf cache. Maximum size in bytes of the dbuf cache.

View file

@ -1,16 +0,0 @@
dist_man_MANS = \
vdev_id.conf.5 \
zpool-features.5 \
spl-module-parameters.5 \
zfs-module-parameters.5 \
zfs-events.5
if BUILD_LINUX
# The man pager in most Linux distros defaults to BSD instead of Linux
# when .Os is blank, but leaving it blank makes things a lot easier on
# FreeBSD when OpenZFS is vendored in the base system.
install-data-hook:
cd $(DESTDIR)$(mandir)/man5; \
$(SED) ${ac_inplace} -e 's/^\.Os$$/.Os Linux/' \
$(dist_man_MANS)
endif

View file

@ -14,13 +14,13 @@
. .
.Sh NAME .Sh NAME
.Nm vdev_id.conf .Nm vdev_id.conf
.Nd Configuration file for vdev_id .Nd configuration file for vdev_id(8)
.Sh DESCRIPTION .Sh DESCRIPTION
.Nm .Nm
is the configuration file for is the configuration file for
.Nm vdev_id Ns Sy (8) . .Xr vdev_id 8 .
It controls the default behavior of It controls the default behavior of
.Nm vdev_id Ns Sy (8) .Xr vdev_id 8
while it is mapping a disk device name to an alias. while it is mapping a disk device name to an alias.
.Pp .Pp
The The
@ -37,7 +37,7 @@ Maps a device link in the
.Pa /dev .Pa /dev
directory hierarchy to a new device name. directory hierarchy to a new device name.
The udev rule defining the device link must have run prior to The udev rule defining the device link must have run prior to
.Nm vdev_id Ns Sy (8) . .Xr vdev_id 8 .
A defined alias takes precedence over a topology-derived name, but the A defined alias takes precedence over a topology-derived name, but the
two naming methods can otherwise coexist. two naming methods can otherwise coexist.
For example, one might name drives in a JBOD with the For example, one might name drives in a JBOD with the
@ -94,12 +94,12 @@ and a default mapping applied to the others.
. .
.It Sy multipath Sy yes Ns | Ns Sy no .It Sy multipath Sy yes Ns | Ns Sy no
Specifies whether Specifies whether
.Nm vdev_id Ns Sy (8) .Xr vdev_id 8
will handle only dm-multipath devices. will handle only dm-multipath devices.
If set to If set to
.Sy yes .Sy yes
then then
.Nm vdev_id Ns Sy (8) .Xr vdev_id 8
will examine the first running component disk of a dm-multipath will examine the first running component disk of a dm-multipath
device as provided by the driver command to determine the physical path. device as provided by the driver command to determine the physical path.
. .
@ -116,7 +116,7 @@ channels are uniquely identified by a SAS switch port number
.It Sy phys_per_port Ar num .It Sy phys_per_port Ar num
Specifies the number of PHY devices associated with a SAS HBA port or SAS Specifies the number of PHY devices associated with a SAS HBA port or SAS
switch port. switch port.
.Nm vdev_id Ns Sy (8) .Xr vdev_id 8
internally uses this value to determine which HBA or switch port a internally uses this value to determine which HBA or switch port a
device is connected to. device is connected to.
The default is The default is
@ -157,13 +157,13 @@ may be unstable across disk replacement.
.Bl -tag -width "-v v" .Bl -tag -width "-v v"
.It Pa /etc/zfs/vdev_id.conf .It Pa /etc/zfs/vdev_id.conf
The configuration file for The configuration file for
.Nm vdev_id Ns Sy (8) . .Xr vdev_id 8 .
.El .El
. .
.Sh EXAMPLES .Sh EXAMPLES
A non-multipath configuration with direct-attached SAS enclosures and an A non-multipath configuration with direct-attached SAS enclosures and an
arbitrary slot re-mapping: arbitrary slot re-mapping:
.Bd -literal -offset Ds .Bd -literal -compact -offset Ds
multipath no multipath no
topology sas_direct topology sas_direct
phys_per_port 4 phys_per_port 4
@ -195,8 +195,8 @@ slot 4 3
A SAS-switch topology. A SAS-switch topology.
Note, that the Note, that the
.Ar channel .Ar channel
keyword takes only two arguments in this example. keyword takes only two arguments in this example:
.Bd -literal -offset Ds .Bd -literal -compact -offset Ds
topology sas_switch topology sas_switch
# SWITCH PORT CHANNEL NAME # SWITCH PORT CHANNEL NAME
@ -207,9 +207,8 @@ channel 4 D
.Ed .Ed
.Pp .Pp
A multipath configuration. A multipath configuration.
Note that channel names have multiple Note that channel names have multiple definitions - one per physical path:
definitions - one per physical path. .Bd -literal -compact -offset Ds
.Bd -literal -offset Ds
multipath yes multipath yes
# PCI_SLOT HBA PORT CHANNEL NAME # PCI_SLOT HBA PORT CHANNEL NAME
@ -219,8 +218,8 @@ channel 86:00.0 1 A
channel 86:00.0 0 B channel 86:00.0 0 B
.Ed .Ed
.Pp .Pp
A configuration with enclosure_symlinks enabled. A configuration with enclosure_symlinks enabled:
.Bd -literal -offset Ds .Bd -literal -compact -offset Ds
multipath yes multipath yes
enclosure_symlinks yes enclosure_symlinks yes
@ -230,17 +229,16 @@ channel 05:00.0 0 L
channel 06:00.0 1 U channel 06:00.0 1 U
channel 06:00.0 0 L channel 06:00.0 0 L
.Ed .Ed
.Pp
In addition to the disks symlinks, this configuration will create: In addition to the disks symlinks, this configuration will create:
.Bd -literal -offset Ds .Bd -literal -compact -offset Ds
/dev/by-enclosure/enc-L0 /dev/by-enclosure/enc-L0
/dev/by-enclosure/enc-L1 /dev/by-enclosure/enc-L1
/dev/by-enclosure/enc-U0 /dev/by-enclosure/enc-U0
/dev/by-enclosure/enc-U1 /dev/by-enclosure/enc-U1
.Ed .Ed
.Pp .Pp
A configuration using device link aliases. A configuration using device link aliases:
.Bd -literal -offset Ds .Bd -literal -compact -offset Ds
# by-vdev # by-vdev
# name fully qualified or base name of device link # name fully qualified or base name of device link
alias d1 /dev/disk/by-id/wwn-0x5000c5002de3b9ca alias d1 /dev/disk/by-id/wwn-0x5000c5002de3b9ca

View file

@ -1,448 +0,0 @@
.\"
.\" Copyright (c) 2013 by Turbo Fredriksson <turbo@bayour.com>. All rights reserved.
.\" Portions Copyright 2018 by Richard Elling
.\" The contents of this file are subject to the terms of the Common Development
.\" and Distribution License (the "License"). You may not use this file except
.\" in compliance with the License. You can obtain a copy of the license at
.\" usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
.\"
.\" See the License for the specific language governing permissions and
.\" limitations under the License. When distributing Covered Code, include this
.\" CDDL HEADER in each file and include the License file at
.\" usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this
.\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your
.\" own identifying information:
.\" Portions Copyright [yyyy] [name of copyright owner]
.\"
.Dd May 26, 2021
.Dt ZFS-EVENTS 5
.Os
.
.Sh NAME
.Nm zfs-events
.Nd Events created by the ZFS filesystem
.Sh DESCRIPTION
Description of the different events generated by the ZFS stack.
.Pp
Most of these don't have any description.
The events generated by ZFS have never been publicly documented.
What is here is intended as a starting point to provide documentation
for all possible events.
.Pp
To view all events created since the loading of the ZFS infrastructure
(i.e, "the module"), run
.Dl Nm zpool Cm events
to get a short list, and
.Dl Nm zpool Cm events Fl v
to get a full detail of the events and what information
is available about it.
.Pp
This manual page lists the different subclasses that are issued
in the case of an event.
The full event name would be
.Sy ereport.fs.zfs.\& Ns Em SUBCLASS ,
but we only list the last part here.
.
.Sh EVENTS (SUBCLASS)
.Bl -tag -compact -width "vdev.bad_guid_sum"
.It Sy checksum
Issued when a checksum error has been detected.
.It Sy io
Issued when there is an I/O error in a vdev in the pool.
.It Sy data
Issued when there have been data errors in the pool.
.It Sy deadman
Issued when an I/O request is determined to be "hung", this can be caused
by lost completion events due to flaky hardware or drivers.
See
.Sy zfs_deadman_failmode
in
.Xr zfs-module-parameters 5
for additional information regarding "hung" I/O detection and configuration.
.It Sy delay
Issued when a completed I/O request exceeds the maximum allowed time
specified by the
.Sy zio_slow_io_ms
module parameter.
This can be an indicator of problems with the underlying storage device.
The number of delay events is ratelimited by the
.Sy zfs_slow_io_events_per_second
module parameter.
.It Sy config
Issued every time a vdev change have been done to the pool.
.It Sy zpool
Issued when a pool cannot be imported.
.It Sy zpool.destroy
Issued when a pool is destroyed.
.It Sy zpool.export
Issued when a pool is exported.
.It Sy zpool.import
Issued when a pool is imported.
.It Sy zpool.reguid
Issued when a REGUID (new unique identifier for the pool have been regenerated) have been detected.
.It Sy vdev.unknown
Issued when the vdev is unknown.
Such as trying to clear device errors on a vdev that have failed/been kicked
from the system/pool and is no longer available.
.It Sy vdev.open_failed
Issued when a vdev could not be opened (because it didn't exist for example).
.It Sy vdev.corrupt_data
Issued when corrupt data have been detected on a vdev.
.It Sy vdev.no_replicas
Issued when there are no more replicas to sustain the pool.
This would lead to the pool being
.Em DEGRADED .
.It Sy vdev.bad_guid_sum
Issued when a missing device in the pool have been detected.
.It Sy vdev.too_small
Issued when the system (kernel) have removed a device, and ZFS
notices that the device isn't there any more.
This is usually followed by a
.Sy probe_failure
event.
.It Sy vdev.bad_label
Issued when the label is OK but invalid.
.It Sy vdev.bad_ashift
Issued when the ashift alignment requirement has increased.
.It Sy vdev.remove
Issued when a vdev is detached from a mirror (or a spare detached from a
vdev where it have been used to replace a failed drive - only works if
the original drive have been readded).
.It Sy vdev.clear
Issued when clearing device errors in a pool.
Such as running
.Nm zpool Cm clear
on a device in the pool.
.It Sy vdev.check
Issued when a check to see if a given vdev could be opened is started.
.It Sy vdev.spare
Issued when a spare have kicked in to replace a failed device.
.It Sy vdev.autoexpand
Issued when a vdev can be automatically expanded.
.It Sy io_failure
Issued when there is an I/O failure in a vdev in the pool.
.It Sy probe_failure
Issued when a probe fails on a vdev.
This would occur if a vdev
have been kicked from the system outside of ZFS (such as the kernel
have removed the device).
.It Sy log_replay
Issued when the intent log cannot be replayed.
The can occur in the case of a missing or damaged log device.
.It Sy resilver.start
Issued when a resilver is started.
.It Sy resilver.finish
Issued when the running resilver have finished.
.It Sy scrub.start
Issued when a scrub is started on a pool.
.It Sy scrub.finish
Issued when a pool has finished scrubbing.
.It Sy scrub.abort
Issued when a scrub is aborted on a pool.
.It Sy scrub.resume
Issued when a scrub is resumed on a pool.
.It Sy scrub.paused
Issued when a scrub is paused on a pool.
.It Sy bootfs.vdev.attach
.El
.
.Sh PAYLOADS
This is the payload (data, information) that accompanies an
event.
.Pp
For
.Xr zed 8 ,
these are set to uppercase and prefixed with
.Sy ZEVENT_ .
.Bl -tag -compact -width "vdev_cksum_errors"
.It Sy pool
Pool name.
.It Sy pool_failmode
Failmode -
.Sy wait ,
.Sy continue ,
or
.Sy panic .
See the
.Sy failmode
property in
.Xr zpoolprops 8
for more information.
.It Sy pool_guid
The GUID of the pool.
.It Sy pool_context
The load state for the pool (0=none, 1=open, 2=import, 3=tryimport, 4=recover
5=error).
.It Sy vdev_guid
The GUID of the vdev in question (the vdev failing or operated upon with
.Nm zpool Cm clear ,
etc.).
.It Sy vdev_type
Type of vdev -
.Sy disk ,
.Sy file ,
.Sy mirror ,
etc.
See the
.Sy Virtual Devices
section of
.Xr zpoolconcepts 8
for more information on possible values.
.It Sy vdev_path
Full path of the vdev, including any
.Em -partX .
.It Sy vdev_devid
ID of vdev (if any).
.It Sy vdev_fru
Physical FRU location.
.It Sy vdev_state
State of vdev (0=uninitialized, 1=closed, 2=offline, 3=removed, 4=failed to open, 5=faulted, 6=degraded, 7=healthy).
.It Sy vdev_ashift
The ashift value of the vdev.
.It Sy vdev_complete_ts
The time the last I/O request completed for the specified vdev.
.It Sy vdev_delta_ts
The time since the last I/O request completed for the specified vdev.
.It Sy vdev_spare_paths
List of spares, including full path and any
.Em -partX .
.It Sy vdev_spare_guids
GUID(s) of spares.
.It Sy vdev_read_errors
How many read errors that have been detected on the vdev.
.It Sy vdev_write_errors
How many write errors that have been detected on the vdev.
.It Sy vdev_cksum_errors
How many checksum errors that have been detected on the vdev.
.It Sy parent_guid
GUID of the vdev parent.
.It Sy parent_type
Type of parent.
See
.Sy vdev_type .
.It Sy parent_path
Path of the vdev parent (if any).
.It Sy parent_devid
ID of the vdev parent (if any).
.It Sy zio_objset
The object set number for a given I/O request.
.It Sy zio_object
The object number for a given I/O request.
.It Sy zio_level
The indirect level for the block.
Level 0 is the lowest level and includes data blocks.
Values > 0 indicate metadata blocks at the appropriate level.
.It Sy zio_blkid
The block ID for a given I/O request.
.It Sy zio_err
The error number for a failure when handling a given I/O request,
compatible with
.Xr errno 3
with the value of
.Sy EBADE
used to indicate a ZFS checksum error.
.It Sy zio_offset
The offset in bytes of where to write the I/O request for the specified vdev.
.It Sy zio_size
The size in bytes of the I/O request.
.It Sy zio_flags
The current flags describing how the I/O request should be handled.
See the
.Sy I/O FLAGS
section for the full list of I/O flags.
.It Sy zio_stage
The current stage of the I/O in the pipeline.
See the
.Sy I/O STAGES
section for a full list of all the I/O stages.
.It Sy zio_pipeline
The valid pipeline stages for the I/O.
See the
.Sy I/O STAGES
section for a full list of all the I/O stages.
.It Sy zio_delay
The time elapsed (in nanoseconds) waiting for the block layer to complete the
I/O request.
Unlike
.Sy zio_delta ,
this does not include any vdev queuing time and is
therefore solely a measure of the block layer performance.
.It Sy zio_timestamp
The time when a given I/O request was submitted.
.It Sy zio_delta
The time required to service a given I/O request.
.It Sy prev_state
The previous state of the vdev.
.It Sy cksum_expected
The expected checksum value for the block.
.It Sy cksum_actual
The actual checksum value for an errant block.
.It Sy cksum_algorithm
Checksum algorithm used.
See
.Xr zfsprops 8
for more information on the available checksum algorithms.
.It Sy cksum_byteswap
Whether or not the data is byteswapped.
.It Sy bad_ranges
.No [\& Ns Ar start , end )
pairs of corruption offsets.
Offsets are always aligned on a 64-bit boundary,
and can include some gaps of non-corruption.
(See
.Sy bad_ranges_min_gap )
.It Sy bad_ranges_min_gap
In order to bound the size of the
.Sy bad_ranges
array, gaps of non-corruption
less than or equal to
.Sy bad_ranges_min_gap
bytes have been merged with
adjacent corruption.
Always at least 8 bytes, since corruption is detected on a 64-bit word basis.
.It Sy bad_range_sets
This array has one element per range in
.Sy bad_ranges .
Each element contains
the count of bits in that range which were clear in the good data and set
in the bad data.
.It Sy bad_range_clears
This array has one element per range in
.Sy bad_ranges .
Each element contains
the count of bits for that range which were set in the good data and clear in
the bad data.
.It Sy bad_set_bits
If this field exists, it is an array of
.Pq Ar bad data No & ~( Ns Ar good data ) ;
that is, the bits set in the bad data which are cleared in the good data.
Each element corresponds a byte whose offset is in a range in
.Sy bad_ranges ,
and the array is ordered by offset.
Thus, the first element is the first byte in the first
.Sy bad_ranges
range, and the last element is the last byte in the last
.Sy bad_ranges
range.
.It Sy bad_cleared_bits
Like
.Sy bad_set_bits ,
but contains
.Pq Ar good data No & ~( Ns Ar bad data ) ;
that is, the bits set in the good data which are cleared in the bad data.
.It Sy bad_set_histogram
If this field exists, it is an array of counters.
Each entry counts bits set in a particular bit of a big-endian uint64 type.
The first entry counts bits
set in the high-order bit of the first byte, the 9th byte, etc, and the last
entry counts bits set of the low-order bit of the 8th byte, the 16th byte, etc.
This information is useful for observing a stuck bit in a parallel data path,
such as IDE or parallel SCSI.
.It Sy bad_cleared_histogram
If this field exists, it is an array of counters.
Each entry counts bit clears in a particular bit of a big-endian uint64 type.
The first entry counts bits
clears of the high-order bit of the first byte, the 9th byte, etc, and the
last entry counts clears of the low-order bit of the 8th byte, the 16th byte, etc.
This information is useful for observing a stuck bit in a parallel data
path, such as IDE or parallel SCSI.
.El
.
.Sh I/O STAGES
The ZFS I/O pipeline is comprised of various stages which are defined below.
The individual stages are used to construct these basic I/O
operations: Read, Write, Free, Claim, and Ioctl.
These stages may be
set on an event to describe the life cycle of a given I/O request.
.Pp
.TS
tab(:);
l l l .
Stage:Bit Mask:Operations
_:_:_
ZIO_STAGE_OPEN:0x00000001:RWFCI
ZIO_STAGE_READ_BP_INIT:0x00000002:R----
ZIO_STAGE_WRITE_BP_INIT:0x00000004:-W---
ZIO_STAGE_FREE_BP_INIT:0x00000008:--F--
ZIO_STAGE_ISSUE_ASYNC:0x00000010:RWF--
ZIO_STAGE_WRITE_COMPRESS:0x00000020:-W---
ZIO_STAGE_ENCRYPT:0x00000040:-W---
ZIO_STAGE_CHECKSUM_GENERATE:0x00000080:-W---
ZIO_STAGE_NOP_WRITE:0x00000100:-W---
ZIO_STAGE_DDT_READ_START:0x00000200:R----
ZIO_STAGE_DDT_READ_DONE:0x00000400:R----
ZIO_STAGE_DDT_WRITE:0x00000800:-W---
ZIO_STAGE_DDT_FREE:0x00001000:--F--
ZIO_STAGE_GANG_ASSEMBLE:0x00002000:RWFC-
ZIO_STAGE_GANG_ISSUE:0x00004000:RWFC-
ZIO_STAGE_DVA_THROTTLE:0x00008000:-W---
ZIO_STAGE_DVA_ALLOCATE:0x00010000:-W---
ZIO_STAGE_DVA_FREE:0x00020000:--F--
ZIO_STAGE_DVA_CLAIM:0x00040000:---C-
ZIO_STAGE_READY:0x00080000:RWFCI
ZIO_STAGE_VDEV_IO_START:0x00100000:RW--I
ZIO_STAGE_VDEV_IO_DONE:0x00200000:RW--I
ZIO_STAGE_VDEV_IO_ASSESS:0x00400000:RW--I
ZIO_STAGE_CHECKSUM_VERIFY:0x00800000:R----
ZIO_STAGE_DONE:0x01000000:RWFCI
.TE
.
.Sh I/O FLAGS
Every I/O request in the pipeline contains a set of flags which describe its
function and are used to govern its behavior.
These flags will be set in an event as a
.Sy zio_flags
payload entry.
.Pp
.TS
tab(:);
l l .
Flag:Bit Mask
_:_
ZIO_FLAG_DONT_AGGREGATE:0x00000001
ZIO_FLAG_IO_REPAIR:0x00000002
ZIO_FLAG_SELF_HEAL:0x00000004
ZIO_FLAG_RESILVER:0x00000008
ZIO_FLAG_SCRUB:0x00000010
ZIO_FLAG_SCAN_THREAD:0x00000020
ZIO_FLAG_PHYSICAL:0x00000040
ZIO_FLAG_CANFAIL:0x00000080
ZIO_FLAG_SPECULATIVE:0x00000100
ZIO_FLAG_CONFIG_WRITER:0x00000200
ZIO_FLAG_DONT_RETRY:0x00000400
ZIO_FLAG_DONT_CACHE:0x00000800
ZIO_FLAG_NODATA:0x00001000
ZIO_FLAG_INDUCE_DAMAGE:0x00002000
ZIO_FLAG_IO_ALLOCATING:0x00004000
ZIO_FLAG_IO_RETRY:0x00008000
ZIO_FLAG_PROBE:0x00010000
ZIO_FLAG_TRYHARD:0x00020000
ZIO_FLAG_OPTIONAL:0x00040000
ZIO_FLAG_DONT_QUEUE:0x00080000
ZIO_FLAG_DONT_PROPAGATE:0x00100000
ZIO_FLAG_IO_BYPASS:0x00200000
ZIO_FLAG_IO_REWRITE:0x00400000
ZIO_FLAG_RAW_COMPRESS:0x00800000
ZIO_FLAG_RAW_ENCRYPT:0x01000000
ZIO_FLAG_GANG_CHILD:0x02000000
ZIO_FLAG_DDT_CHILD:0x04000000
ZIO_FLAG_GODFATHER:0x08000000
ZIO_FLAG_NOPWRITE:0x10000000
ZIO_FLAG_REEXECUTED:0x20000000
ZIO_FLAG_DELEGATED:0x40000000
ZIO_FLAG_FASTWRITE:0x80000000
.TE

View file

@ -30,7 +30,7 @@
.\" Copyright 2019 Joyent, Inc. .\" Copyright 2019 Joyent, Inc.
.\" .\"
.Dd June 30, 2019 .Dd June 30, 2019
.Dt ZFSCONCEPTS 8 .Dt ZFSCONCEPTS 7
.Os .Os
. .
.Sh NAME .Sh NAME

View file

@ -38,7 +38,7 @@
.\" Copyright (c) 2019, Kjeld Schouten-Lebbing .\" Copyright (c) 2019, Kjeld Schouten-Lebbing
.\" .\"
.Dd May 24, 2021 .Dd May 24, 2021
.Dt ZFSPROPS 8 .Dt ZFSPROPS 7
.Os .Os
. .
.Sh NAME .Sh NAME
@ -304,7 +304,7 @@ The used space of a snapshot
.Po see the .Po see the
.Sx Snapshots .Sx Snapshots
section of section of
.Xr zfsconcepts 8 .Xr zfsconcepts 7
.Pc .Pc
is space that is referenced exclusively by this snapshot. is space that is referenced exclusively by this snapshot.
If this snapshot is destroyed, the amount of If this snapshot is destroyed, the amount of
@ -777,7 +777,7 @@ does not support the
algorithm. algorithm.
.Pp .Pp
Please see Please see
.Xr zpool-features 5 .Xr zpool-features 7
for more information on these algorithms. for more information on these algorithms.
.Pp .Pp
Changing this property affects only newly-written data. Changing this property affects only newly-written data.
@ -818,7 +818,7 @@ but can only be used on pools with the
feature set to feature set to
.Sy enabled . .Sy enabled .
See See
.Xr zpool-features 5 .Xr zpool-features 7
for details on ZFS feature flags and the for details on ZFS feature flags and the
.Sy lz4_compress .Sy lz4_compress
feature. feature.
@ -1019,7 +1019,7 @@ be enabled on a system.
See the See the
.Sx Deduplication .Sx Deduplication
section of section of
.Xr zfsconcepts 8 . .Xr zfsconcepts 7 .
.It Xo .It Xo
.Sy dnodesize Ns = Ns Sy legacy Ns | Ns Sy auto Ns | Ns Sy 1k Ns | Ns .Sy dnodesize Ns = Ns Sy legacy Ns | Ns Sy auto Ns | Ns Sy 1k Ns | Ns
.Sy 2k Ns | Ns Sy 4k Ns | Ns Sy 8k Ns | Ns Sy 16k .Sy 2k Ns | Ns Sy 4k Ns | Ns Sy 8k Ns | Ns Sy 16k
@ -1192,7 +1192,7 @@ does not override the ancestor's
but rather imposes an additional limit. but rather imposes an additional limit.
This feature must be enabled to be used This feature must be enabled to be used
.Po see .Po see
.Xr zpool-features 5 .Xr zpool-features 7
.Pc . .Pc .
.It Sy special_small_blocks Ns = Ns Ar size .It Sy special_small_blocks Ns = Ns Ar size
This value represents the threshold block size for including small file This value represents the threshold block size for including small file
@ -1207,14 +1207,14 @@ will be allocated in the special class.
Before setting this property, a special class vdev must be added to the Before setting this property, a special class vdev must be added to the
pool. pool.
See See
.Xr zpoolconcepts 8 .Xr zpoolconcepts 7
for more details on the special allocation class. for more details on the special allocation class.
.It Sy mountpoint Ns = Ns Pa path Ns | Ns Sy none Ns | Ns Sy legacy .It Sy mountpoint Ns = Ns Pa path Ns | Ns Sy none Ns | Ns Sy legacy
Controls the mount point used for this file system. Controls the mount point used for this file system.
See the See the
.Sx Mount Points .Sx Mount Points
section of section of
.Xr zfsconcepts 8 .Xr zfsconcepts 7
for more information on how this property is used. for more information on how this property is used.
.Pp .Pp
When the When the
@ -1292,7 +1292,7 @@ For example, this means that recursive snapshots taken from the global zone are
counted against each delegated dataset within a zone. counted against each delegated dataset within a zone.
This feature must be enabled to be used This feature must be enabled to be used
.Po see .Po see
.Xr zpool-features 5 .Xr zpool-features 7
.Pc . .Pc .
.It Sy userquota@ Ns Ar user Ns = Ns Ar size Ns | Ns Sy none .It Sy userquota@ Ns Ar user Ns = Ns Ar size Ns | Ns Sy none
Limits the amount of space consumed by the specified user. Limits the amount of space consumed by the specified user.
@ -1435,7 +1435,7 @@ If the
feature is enabled on the pool, the size may be up to feature is enabled on the pool, the size may be up to
.Ar 1MB . .Ar 1MB .
See See
.Xr zpool-features 5 .Xr zpool-features 7
for details on ZFS feature flags. for details on ZFS feature flags.
.Pp .Pp
Changing the file system's Changing the file system's
@ -1686,7 +1686,7 @@ directory is hidden or visible in the root of the file system as discussed in
the the
.Sx Snapshots .Sx Snapshots
section of section of
.Xr zfsconcepts 8 . .Xr zfsconcepts 7 .
The default value is The default value is
.Sy hidden . .Sy hidden .
.It Sy sync Ns = Ns Sy standard Ns | Ns Sy always Ns | Ns Sy disabled .It Sy sync Ns = Ns Sy standard Ns | Ns Sy always Ns | Ns Sy disabled

View file

@ -19,7 +19,7 @@
.\" Copyright (c) 2021, Colm Buckley <colm@tuatha.org> .\" Copyright (c) 2021, Colm Buckley <colm@tuatha.org>
.\" .\"
.Dd May 31, 2021 .Dd May 31, 2021
.Dt ZPOOL-FEATURES 5 .Dt ZPOOL-FEATURES 7
.Os .Os
. .
.Sh NAME .Sh NAME
@ -521,7 +521,7 @@ will not match the source.
Its use by Its use by
.Nm zfs Cm send Fl i .Nm zfs Cm send Fl i
has been disabled by default has been disabled by default
.Pq see Sy send_holes_without_birth_time No in Xr zfs-module-parameters 5 . .Pq see Sy send_holes_without_birth_time No in Xr zfs 4 .
.Pp .Pp
This feature improves performance of incremental sends This feature improves performance of incremental sends
.Pq Nm zfs Cm send Fl i .Pq Nm zfs Cm send Fl i

View file

@ -27,7 +27,7 @@
.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved. .\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
.\" .\"
.Dd June 2, 2021 .Dd June 2, 2021
.Dt ZPOOLCONCEPTS 8 .Dt ZPOOLCONCEPTS 7
.Os .Os
. .
.Sh NAME .Sh NAME
@ -508,5 +508,5 @@ in the special class by setting the
.Sy special_small_blocks .Sy special_small_blocks
property to nonzero. property to nonzero.
See See
.Xr zfsprops 8 .Xr zfsprops 7
for more info on this property. for more info on this property.

View file

@ -28,7 +28,7 @@
.\" Copyright (c) 2021, Colm Buckley <colm@tuatha.org> .\" Copyright (c) 2021, Colm Buckley <colm@tuatha.org>
.\" .\"
.Dd May 27, 2021 .Dd May 27, 2021
.Dt ZPOOLPROPS 8 .Dt ZPOOLPROPS 7
.Os .Os
. .
.Sh NAME .Sh NAME
@ -89,7 +89,7 @@ This discrepancy is due to several factors, including raidz parity;
zfs reservation, quota, refreservation, and refquota properties; and space set aside by zfs reservation, quota, refreservation, and refquota properties; and space set aside by
.Sy spa_slop_shift .Sy spa_slop_shift
(see (see
.Xr zfs-module-parameters 5 .Xr zfs 4
for more information). for more information).
.It Sy freeing .It Sy freeing
After a file system or snapshot is destroyed, the space it was using is After a file system or snapshot is destroyed, the space it was using is
@ -121,7 +121,7 @@ Total size of the storage pool.
.It Sy unsupported@ Ns Em guid .It Sy unsupported@ Ns Em guid
Information about unsupported features that are enabled on the pool. Information about unsupported features that are enabled on the pool.
See See
.Xr zpool-features 5 .Xr zpool-features 7
for details. for details.
.El .El
.Pp .Pp
@ -316,7 +316,7 @@ whitespace and/or commas.
Only features present in all files may be enabled. Only features present in all files may be enabled.
.Pp .Pp
See See
.Xr zpool-features 5 , .Xr zpool-features 7 ,
.Xr zpool-create 8 .Xr zpool-create 8
and and
.Xr zpool-upgrade 8 .Xr zpool-upgrade 8
@ -357,7 +357,7 @@ which moves
.Ar feature_name .Ar feature_name
to the enabled state. to the enabled state.
See See
.Xr zpool-features 5 .Xr zpool-features 7
for details on feature states. for details on feature states.
.It Sy listsnapshots Ns = Ns Sy on Ns | Ns Sy off .It Sy listsnapshots Ns = Ns Sy on Ns | Ns Sy off
Controls whether information about snapshots associated with this pool is Controls whether information about snapshots associated with this pool is
@ -390,13 +390,13 @@ in use.
See See
.Sy zfs_multihost_interval .Sy zfs_multihost_interval
in the in the
.Xr zfs-module-parameters 5 .Xr zfs 4
manual page. manual page.
In order to enable this property each host must set a unique hostid. In order to enable this property each host must set a unique hostid.
See See
.Xr genhostid 1 .Xr genhostid 1
.Xr zgenhostid 8 .Xr zgenhostid 8
.Xr spl-module-parameters 5 .Xr spl 4
for additional details. for additional details.
The default value is The default value is
.Sy off . .Sy off .

View file

@ -1,102 +0,0 @@
include $(top_srcdir)/config/Substfiles.am
dist_man_MANS = \
fsck.zfs.8 \
mount.zfs.8 \
vdev_id.8 \
zdb.8 \
zfs.8 \
zfsconcepts.8 \
zfsprops.8 \
zfs-allow.8 \
zfs-bookmark.8 \
zfs-change-key.8 \
zfs-clone.8 \
zfs-create.8 \
zfs-destroy.8 \
zfs-diff.8 \
zfs-get.8 \
zfs-groupspace.8 \
zfs-hold.8 \
zfs-inherit.8 \
zfs-jail.8 \
zfs-list.8 \
zfs-load-key.8 \
zfs-mount.8 \
zfs-program.8 \
zfs-project.8 \
zfs-projectspace.8 \
zfs-promote.8 \
zfs-receive.8 \
zfs-recv.8 \
zfs-redact.8 \
zfs-release.8 \
zfs-rename.8 \
zfs-rollback.8 \
zfs-send.8 \
zfs-set.8 \
zfs-share.8 \
zfs-snapshot.8 \
zfs-unallow.8 \
zfs-unjail.8 \
zfs-unload-key.8 \
zfs-unmount.8 \
zfs-upgrade.8 \
zfs-userspace.8 \
zfs-wait.8 \
zfs_ids_to_path.8 \
zgenhostid.8 \
zinject.8 \
zpool.8 \
zpoolconcepts.8 \
zpoolprops.8 \
zpool-add.8 \
zpool-attach.8 \
zpool-checkpoint.8 \
zpool-clear.8 \
zpool-create.8 \
zpool-destroy.8 \
zpool-detach.8 \
zpool-events.8 \
zpool-export.8 \
zpool-get.8 \
zpool-history.8 \
zpool-import.8 \
zpool-initialize.8 \
zpool-iostat.8 \
zpool-labelclear.8 \
zpool-list.8 \
zpool-offline.8 \
zpool-online.8 \
zpool-reguid.8 \
zpool-remove.8 \
zpool-reopen.8 \
zpool-replace.8 \
zpool-resilver.8 \
zpool-scrub.8 \
zpool-set.8 \
zpool-split.8 \
zpool-status.8 \
zpool-sync.8 \
zpool-trim.8 \
zpool-upgrade.8 \
zpool-wait.8 \
zstream.8 \
zstreamdump.8 \
zpool_influxdb.8
nodist_man_MANS = \
zed.8 \
zfs-mount-generator.8
SUBSTFILES += $(nodist_man_MANS)
if BUILD_LINUX
# The man pager in most Linux distros defaults to BSD instead of Linux
# when .Os is blank, but leaving it blank makes things a lot easier on
# FreeBSD when OpenZFS is vendored in the base system.
install-data-hook:
cd $(DESTDIR)$(mandir)/man8; \
$(SED) ${ac_inplace} -e 's/^\.Os$$/.Os Linux/' \
$(dist_man_MANS) $(nodist_man_MANS)
endif

View file

@ -58,7 +58,9 @@ interface still allows it to communicate some errors: if the
.Ar dataset .Ar dataset
is in a degraded pool, then is in a degraded pool, then
.Nm .Nm
will return exit code 4 to indicate an uncorrected filesystem error. will return exit code
.Sy 4
to indicate an uncorrected filesystem error.
.Pp .Pp
Similarly, if the Similarly, if the
.Ar dataset .Ar dataset
@ -66,7 +68,9 @@ is in a faulted pool and has a legacy
.Pa /etc/fstab .Pa /etc/fstab
record, then record, then
.Nm .Nm
will return exit code 8 to indicate a fatal operational error. will return exit code
.Sy 8
to indicate a fatal operational error.
.Sh SEE ALSO .Sh SEE ALSO
.Xr fstab 5 , .Xr fstab 5 ,
.Xr fsck 8 , .Xr fsck 8 ,

View file

@ -56,7 +56,7 @@ in most cases.
are handled according to the are handled according to the
.Em Temporary Mount Point Properties .Em Temporary Mount Point Properties
section in section in
.Xr zfsprops 8 , .Xr zfsprops 7 ,
except for those described below. except for those described below.
.Pp .Pp
If If

View file

@ -147,7 +147,7 @@ is sourced by scripts; these variables should be prefixed with
The zevent nvpairs are passed to ZEDLETs as environment variables. The zevent nvpairs are passed to ZEDLETs as environment variables.
Each nvpair name is converted to an environment variable in the following Each nvpair name is converted to an environment variable in the following
manner: manner:
.Bl -enum .Bl -enum -compact
.It .It
it is prefixed with it is prefixed with
.Sy ZEVENT_ , .Sy ZEVENT_ ,
@ -160,7 +160,7 @@ each non-alphanumeric character is converted to an underscore.
Some additional environment variables have been defined to present certain Some additional environment variables have been defined to present certain
nvpair values in a more convenient form. nvpair values in a more convenient form.
An incomplete list of zevent environment variables is as follows: An incomplete list of zevent environment variables is as follows:
.Bl -tag -width "ZEVENT_TIME_STRING" .Bl -tag -compact -width "ZEVENT_TIME_STRING"
.It Sy ZEVENT_EID .It Sy ZEVENT_EID
The Event IDentifier. The Event IDentifier.
.It Sy ZEVENT_CLASS .It Sy ZEVENT_CLASS
@ -187,7 +187,7 @@ An almost-RFC3339-compliant string for
.El .El
.Pp .Pp
Additionally, the following ZED & ZFS variables are defined: Additionally, the following ZED & ZFS variables are defined:
.Bl -tag -width "ZEVENT_TIME_STRING" .Bl -tag -compact -width "ZEVENT_TIME_STRING"
.It Sy ZED_PID .It Sy ZED_PID
The daemon's process ID. The daemon's process ID.
.It Sy ZED_ZEDLET_DIR .It Sy ZED_ZEDLET_DIR
@ -237,7 +237,6 @@ Terminate the daemon.
.El .El
. .
.Sh SEE ALSO .Sh SEE ALSO
.Xr zfs-events 5 ,
.Xr zfs 8 , .Xr zfs 8 ,
.Xr zpool 8 , .Xr zpool 8 ,
.Xr zpool-events 8 .Xr zpool-events 8

View file

@ -56,7 +56,7 @@ a redaction bookmark.
.Pp .Pp
This feature must be enabled to be used. This feature must be enabled to be used.
See See
.Xr zpool-features 5 .Xr zpool-features 7
for details on ZFS feature flags and the for details on ZFS feature flags and the
.Sy bookmarks .Sy bookmarks
feature. feature.

View file

@ -47,7 +47,7 @@
See the See the
.Sx Clones .Sx Clones
section of section of
.Xr zfsconcepts 8 .Xr zfsconcepts 7
for details. for details.
The target dataset can be located anywhere in the ZFS hierarchy, The target dataset can be located anywhere in the ZFS hierarchy,
and is created as the same type as the original. and is created as the same type as the original.

View file

@ -184,7 +184,7 @@ See
in the in the
.Em Native Properties .Em Native Properties
section of section of
.Xr zfsprops 8 .Xr zfsprops 7
for more information about sparse volumes. for more information about sparse volumes.
.It Fl n .It Fl n
Do a dry-run Do a dry-run

View file

@ -119,5 +119,5 @@ or name
.Ar jailname . .Ar jailname .
.El .El
.Sh SEE ALSO .Sh SEE ALSO
.Xr jail 8 , .Xr zfsprops 7 ,
.Xr zfsprops 8 .Xr jail 8

View file

@ -90,7 +90,7 @@ The property must be:
One of the properties described in the One of the properties described in the
.Sx Native Properties .Sx Native Properties
section of section of
.Xr zfsprops 8 .Xr zfsprops 7
.It .It
A user property A user property
.It .It
@ -118,7 +118,7 @@ value of the property.
The property must be one of the properties described in the The property must be one of the properties described in the
.Sx Properties .Sx Properties
section of section of
.Xr zfsprops 8 .Xr zfsprops 7
or the value or the value
.Sy name .Sy name
to sort by the dataset name. to sort by the dataset name.
@ -158,5 +158,5 @@ displays only snapshots.
.El .El
. .
.Sh SEE ALSO .Sh SEE ALSO
.Xr zfs-get 8 , .Xr zfsprops 7 ,
.Xr zfsprops 8 .Xr zfs-get 8

View file

@ -296,6 +296,6 @@ Deduplication with encryption will leak information about which blocks
are equivalent in a dataset and will incur an extra CPU cost for each block written. are equivalent in a dataset and will incur an extra CPU cost for each block written.
. .
.Sh SEE ALSO .Sh SEE ALSO
.Xr zfsprops 7 ,
.Xr zfs-create 8 , .Xr zfs-create 8 ,
.Xr zfs-set 8 , .Xr zfs-set 8
.Xr zfsprops 8

View file

@ -186,7 +186,7 @@ to re-run all generators:
.Xr systemd.mount 5 , .Xr systemd.mount 5 ,
.Xr systemd.target 5 , .Xr systemd.target 5 ,
.Xr zfs 5 , .Xr zfs 5 ,
.Xr zfs-events 5 ,
.Xr systemd.generator 7 , .Xr systemd.generator 7 ,
.Xr systemd.special 7 , .Xr systemd.special 7 ,
.Xr zed 8 .Xr zed 8 ,
.Xr zpool-events 8

View file

@ -91,7 +91,7 @@ duration of the mount.
See the See the
.Em Temporary Mount Point Properties .Em Temporary Mount Point Properties
section of section of
.Xr zfsprops 8 .Xr zfsprops 7
for details. for details.
.It Fl l .It Fl l
Load keys for encrypted filesystems as they are being mounted. Load keys for encrypted filesystems as they are being mounted.

View file

@ -357,7 +357,7 @@ To use this flag, the storage pool must have the
.Sy extensible_dataset .Sy extensible_dataset
feature enabled. feature enabled.
See See
.Xr zpool-features 5 .Xr zpool-features 7
for details on ZFS feature flags. for details on ZFS feature flags.
.It Fl u .It Fl u
File system that is associated with the received stream is not mounted. File system that is associated with the received stream is not mounted.

View file

@ -110,7 +110,7 @@ The receiving system must have the
.Sy large_blocks .Sy large_blocks
pool feature enabled as well. pool feature enabled as well.
See See
.Xr zpool-features 5 .Xr zpool-features 7
for details on ZFS feature flags and the for details on ZFS feature flags and the
.Sy large_blocks .Sy large_blocks
feature. feature.
@ -161,7 +161,7 @@ received as an encrypted dataset, since encrypted datasets cannot use the
.Sy embedded_data .Sy embedded_data
feature. feature.
See See
.Xr zpool-features 5 .Xr zpool-features 7
for details on ZFS feature flags and the for details on ZFS feature flags and the
.Sy embedded_data .Sy embedded_data
feature. feature.
@ -308,7 +308,7 @@ The receiving system must have the
.Sy large_blocks .Sy large_blocks
pool feature enabled as well. pool feature enabled as well.
See See
.Xr zpool-features 5 .Xr zpool-features 7
for details on ZFS feature flags and the for details on ZFS feature flags and the
.Sy large_blocks .Sy large_blocks
feature. feature.
@ -372,7 +372,7 @@ since encrypted datasets cannot use the
.Sy embedded_data .Sy embedded_data
feature. feature.
See See
.Xr zpool-features 5 .Xr zpool-features 7
for details on ZFS feature flags and the for details on ZFS feature flags and the
.Sy embedded_data .Sy embedded_data
feature. feature.

View file

@ -65,7 +65,7 @@
.Xc .Xc
Only some properties can be edited. Only some properties can be edited.
See See
.Xr zfsprops 8 .Xr zfsprops 7
for more information on what properties can be set and acceptable for more information on what properties can be set and acceptable
values. values.
Numeric values can be specified as exact values, or in a human-readable form Numeric values can be specified as exact values, or in a human-readable form
@ -78,7 +78,7 @@ User properties can be set on snapshots.
For more information, see the For more information, see the
.Em User Properties .Em User Properties
section of section of
.Xr zfsprops 8 . .Xr zfsprops 7 .
.It Xo .It Xo
.Nm zfs .Nm zfs
.Cm get .Cm get
@ -114,7 +114,7 @@ This command takes a comma-separated list of properties as described in the
and and
.Sx User Properties .Sx User Properties
sections of sections of
.Xr zfsprops 8 . .Xr zfsprops 7 .
.Pp .Pp
The value The value
.Sy all .Sy all
@ -163,7 +163,7 @@ restored to default if no ancestor has the property set, or with the
.Fl S .Fl S
option reverted to the received value if one exists. option reverted to the received value if one exists.
See See
.Xr zfsprops 8 .Xr zfsprops 7
for a listing of default values, and details on which properties can be for a listing of default values, and details on which properties can be
inherited. inherited.
.Bl -tag -width "-r" .Bl -tag -width "-r"
@ -178,5 +178,5 @@ option was not specified.
.El .El
. .
.Sh SEE ALSO .Sh SEE ALSO
.Xr zfs-list 8 , .Xr zfsprops 7 ,
.Xr zfsprops 8 .Xr zfs-list 8

View file

@ -87,4 +87,4 @@ The command can also be given a path to a ZFS file system shared on the system.
.Sh SEE ALSO .Sh SEE ALSO
.Xr exports 5 , .Xr exports 5 ,
.Xr smb.conf 5 , .Xr smb.conf 5 ,
.Xr zfsprops 8 .Xr zfsprops 7

View file

@ -54,7 +54,7 @@ can be used as an alias for
See the See the
.Sx Snapshots .Sx Snapshots
section of section of
.Xr zfsconcepts 8 .Xr zfsconcepts 7
for details. for details.
.Bl -tag -width "-o" .Bl -tag -width "-o"
.It Fl o Ar property Ns = Ns Ar value .It Fl o Ar property Ns = Ns Ar value

Some files were not shown because too many files have changed in this diff Show more