zfs: merge openzfs/zfs@c0cf6ed67
Notable upstream pull request merges:
#10662 zvol_wait: Ignore locked zvols
#12789 Improve log spacemap load time
#12812 Improved zpool status output, list all affected datasets
#13277 FreeBSD: Use NDFREE_PNBUF if available
#13302 Make zfs_max_recordsize default to 16M
#13311 Fix error handling in FreeBSD's get/putpages VOPs
#13345 FreeBSD: Fix translation from ABD to physical pages
#13373 zfs: holds: dequadratify
#13375 Corrected edge case in uncompressed ARC->L2ARC handling
#13388 Improve mg_aliquot math
#13405 Reduce dbuf_find() lock contention
#13406 FreeBSD: use zero_region instead of allocating a dedicated page
Obtained from: OpenZFS
OpenZFS commit: c0cf6ed679
This commit is contained in:
commit
716fd348e0
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
ZFSTOP= ${SRCTOP}/sys/contrib/openzfs
|
ZFSTOP= ${SRCTOP}/sys/contrib/openzfs
|
||||||
|
|
||||||
.PATH: ${ZFSTOP}/cmd/ztest
|
.PATH: ${ZFSTOP}/cmd
|
||||||
.PATH: ${ZFSTOP}/man/man1
|
.PATH: ${ZFSTOP}/man/man1
|
||||||
|
|
||||||
PROG= ztest
|
PROG= ztest
|
||||||
@ -16,7 +16,6 @@ CFLAGS+= \
|
|||||||
-I${ZFSTOP}/include \
|
-I${ZFSTOP}/include \
|
||||||
-I${ZFSTOP}/lib/libspl/include \
|
-I${ZFSTOP}/lib/libspl/include \
|
||||||
-I${ZFSTOP}/lib/libspl/include/os/freebsd \
|
-I${ZFSTOP}/lib/libspl/include/os/freebsd \
|
||||||
-I${SRCTOP}/sys \
|
|
||||||
-I${SRCTOP}/cddl/compat/opensolaris/include \
|
-I${SRCTOP}/cddl/compat/opensolaris/include \
|
||||||
-I${ZFSTOP}/module/icp/include \
|
-I${ZFSTOP}/module/icp/include \
|
||||||
-include ${ZFSTOP}/include/os/freebsd/spl/sys/ccompile.h \
|
-include ${ZFSTOP}/include/os/freebsd/spl/sys/ccompile.h \
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
.PATH: ${SRCTOP}/sys/contrib/openzfs/cmd/zhack
|
.PATH: ${SRCTOP}/sys/contrib/openzfs/cmd
|
||||||
|
|
||||||
PROG= zhack
|
PROG= zhack
|
||||||
MAN=
|
MAN=
|
||||||
|
@ -40,11 +40,11 @@ jobs:
|
|||||||
- name: CheckABI
|
- name: CheckABI
|
||||||
id: CheckABI
|
id: CheckABI
|
||||||
run: |
|
run: |
|
||||||
docker run -v $(pwd):/source ghcr.io/openzfs/libabigail make -j$(nproc) --no-print-directory --silent checkabi
|
docker run -v $PWD:/source ghcr.io/openzfs/libabigail make -j$(nproc) --no-print-directory --silent checkabi
|
||||||
- name: StoreABI
|
- name: StoreABI
|
||||||
if: failure() && steps.CheckABI.outcome == 'failure'
|
if: failure() && steps.CheckABI.outcome == 'failure'
|
||||||
run: |
|
run: |
|
||||||
docker run -v $(pwd):/source ghcr.io/openzfs/libabigail make -j$(nproc) --no-print-directory --silent storeabi
|
docker run -v $PWD:/source ghcr.io/openzfs/libabigail make -j$(nproc) --no-print-directory --silent storeabi
|
||||||
- name: Prepare artifacts
|
- name: Prepare artifacts
|
||||||
if: failure() && steps.CheckABI.outcome == 'failure'
|
if: failure() && steps.CheckABI.outcome == 'failure'
|
||||||
run: |
|
run: |
|
||||||
|
@ -38,8 +38,9 @@ jobs:
|
|||||||
- name: Tests
|
- name: Tests
|
||||||
run: |
|
run: |
|
||||||
sudo mkdir -p $TEST_DIR
|
sudo mkdir -p $TEST_DIR
|
||||||
# run for 20 minutes to have a total runner time of 30 minutes
|
# run for 10 minutes or at most 2 iterations for a maximum runner
|
||||||
sudo /usr/share/zfs/zloop.sh -t 1200 -l -m1 -- -T 120 -P 60
|
# time of 20 minutes.
|
||||||
|
sudo /usr/share/zfs/zloop.sh -t 600 -I 2 -l -m1 -- -T 120 -P 60
|
||||||
- name: Prepare artifacts
|
- name: Prepare artifacts
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
|
90
sys/contrib/openzfs/.gitignore
vendored
90
sys/contrib/openzfs/.gitignore
vendored
@ -1,6 +1,7 @@
|
|||||||
#
|
#
|
||||||
# N.B.
|
# This is the top-level .gitignore file:
|
||||||
# This is the toplevel .gitignore file.
|
# ignore everything except a list of allowed files.
|
||||||
|
#
|
||||||
# This is not the place for entries that are specific to
|
# This is not the place for entries that are specific to
|
||||||
# a subdirectory. Instead add those files to the
|
# a subdirectory. Instead add those files to the
|
||||||
# .gitignore file in that subdirectory.
|
# .gitignore file in that subdirectory.
|
||||||
@ -10,6 +11,56 @@
|
|||||||
# command after changing this file, to see if there are
|
# command after changing this file, to see if there are
|
||||||
# any tracked files which get ignored after the change.
|
# any tracked files which get ignored after the change.
|
||||||
|
|
||||||
|
*
|
||||||
|
|
||||||
|
!.github
|
||||||
|
!cmd
|
||||||
|
!config
|
||||||
|
!contrib
|
||||||
|
!etc
|
||||||
|
!include
|
||||||
|
!lib
|
||||||
|
!man
|
||||||
|
!module
|
||||||
|
!rpm
|
||||||
|
!scripts
|
||||||
|
!tests
|
||||||
|
!udev
|
||||||
|
|
||||||
|
!.github/**
|
||||||
|
!cmd/**
|
||||||
|
!config/**
|
||||||
|
!contrib/**
|
||||||
|
!etc/**
|
||||||
|
!include/**
|
||||||
|
!lib/**
|
||||||
|
!man/**
|
||||||
|
!module/**
|
||||||
|
!rpm/**
|
||||||
|
!scripts/**
|
||||||
|
!tests/**
|
||||||
|
!udev/**
|
||||||
|
|
||||||
|
!.editorconfig
|
||||||
|
!.gitignore
|
||||||
|
!.gitmodules
|
||||||
|
!AUTHORS
|
||||||
|
!autogen.sh
|
||||||
|
!CODE_OF_CONDUCT.md
|
||||||
|
!configure.ac
|
||||||
|
!copy-builtin
|
||||||
|
!COPYRIGHT
|
||||||
|
!LICENSE
|
||||||
|
!Makefile.am
|
||||||
|
!META
|
||||||
|
!NEWS
|
||||||
|
!NOTICE
|
||||||
|
!README.md
|
||||||
|
!RELEASES.md
|
||||||
|
!TEST
|
||||||
|
!zfs.release.in
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Normal rules
|
# Normal rules
|
||||||
#
|
#
|
||||||
@ -31,40 +82,7 @@
|
|||||||
modules.order
|
modules.order
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
|
|
||||||
#
|
|
||||||
# Top level generated files specific to this top level dir
|
|
||||||
#
|
|
||||||
/bin
|
|
||||||
/build
|
|
||||||
/configure
|
|
||||||
/config.log
|
|
||||||
/config.status
|
|
||||||
/libtool
|
|
||||||
/zfs_config.h
|
|
||||||
/zfs_config.h.in
|
|
||||||
/zfs.release
|
|
||||||
/stamp-h1
|
|
||||||
/aclocal.m4
|
|
||||||
/autom4te.cache
|
|
||||||
|
|
||||||
#
|
|
||||||
# Top level generic files
|
|
||||||
#
|
|
||||||
!.gitignore
|
|
||||||
tags
|
|
||||||
TAGS
|
|
||||||
current
|
|
||||||
cscope.*
|
|
||||||
*.rpm
|
|
||||||
*.deb
|
|
||||||
*.tar.gz
|
|
||||||
*.patch
|
*.patch
|
||||||
*.orig
|
*.orig
|
||||||
*.log
|
|
||||||
*.tmp
|
*.tmp
|
||||||
venv
|
*.log
|
||||||
|
|
||||||
*.so
|
|
||||||
*.so.debug
|
|
||||||
*.so.full
|
|
||||||
|
@ -1,33 +1,43 @@
|
|||||||
|
CLEANFILES =
|
||||||
|
EXTRA_DIST =
|
||||||
|
INSTALL_DATA_HOOKS =
|
||||||
|
ALL_LOCAL =
|
||||||
|
CLEAN_LOCAL =
|
||||||
|
CHECKS = shellcheck checkbashisms
|
||||||
|
|
||||||
|
include $(top_srcdir)/config/Rules.am
|
||||||
|
include $(top_srcdir)/config/CppCheck.am
|
||||||
include $(top_srcdir)/config/Shellcheck.am
|
include $(top_srcdir)/config/Shellcheck.am
|
||||||
|
include $(top_srcdir)/config/Substfiles.am
|
||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I config
|
ACLOCAL_AMFLAGS = -I config
|
||||||
|
|
||||||
SUBDIRS = include
|
SUBDIRS = include
|
||||||
if BUILD_LINUX
|
if BUILD_LINUX
|
||||||
SUBDIRS += rpm
|
include $(srcdir)/%D%/rpm/Makefile.am
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if CONFIG_USER
|
if CONFIG_USER
|
||||||
SUBDIRS += man scripts lib tests cmd etc contrib
|
include $(srcdir)/%D%/cmd/Makefile.am
|
||||||
|
include $(srcdir)/%D%/contrib/Makefile.am
|
||||||
|
include $(srcdir)/%D%/etc/Makefile.am
|
||||||
|
include $(srcdir)/%D%/lib/Makefile.am
|
||||||
|
include $(srcdir)/%D%/man/Makefile.am
|
||||||
|
include $(srcdir)/%D%/scripts/Makefile.am
|
||||||
|
include $(srcdir)/%D%/tests/Makefile.am
|
||||||
if BUILD_LINUX
|
if BUILD_LINUX
|
||||||
SUBDIRS += udev
|
include $(srcdir)/%D%/udev/Makefile.am
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
CPPCHECKDIRS += module
|
||||||
if CONFIG_KERNEL
|
if CONFIG_KERNEL
|
||||||
SUBDIRS += module
|
SUBDIRS += module
|
||||||
|
|
||||||
extradir = $(prefix)/src/zfs-$(VERSION)
|
extradir = $(prefix)/src/zfs-$(VERSION)
|
||||||
extra_HEADERS = zfs.release.in zfs_config.h.in
|
extra_HEADERS = zfs.release.in zfs_config.h.in
|
||||||
|
|
||||||
if BUILD_LINUX
|
|
||||||
kerneldir = $(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION)
|
|
||||||
nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS)
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = foreign
|
EXTRA_DIST += autogen.sh copy-builtin
|
||||||
EXTRA_DIST = autogen.sh copy-builtin
|
|
||||||
EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am
|
|
||||||
EXTRA_DIST += AUTHORS CODE_OF_CONDUCT.md COPYRIGHT LICENSE META NEWS NOTICE
|
EXTRA_DIST += AUTHORS CODE_OF_CONDUCT.md COPYRIGHT LICENSE META NEWS NOTICE
|
||||||
EXTRA_DIST += README.md RELEASES.md
|
EXTRA_DIST += README.md RELEASES.md
|
||||||
EXTRA_DIST += module/lua/README.zfs module/os/linux/spl/README.md
|
EXTRA_DIST += module/lua/README.zfs module/os/linux/spl/README.md
|
||||||
@ -51,18 +61,22 @@ EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash.descrip
|
|||||||
@CODE_COVERAGE_RULES@
|
@CODE_COVERAGE_RULES@
|
||||||
|
|
||||||
GITREV = include/zfs_gitrev.h
|
GITREV = include/zfs_gitrev.h
|
||||||
|
CLEANFILES += $(GITREV)
|
||||||
PHONY = gitrev
|
PHONY += gitrev
|
||||||
gitrev:
|
gitrev:
|
||||||
$(AM_V_GEN)$(top_srcdir)/scripts/make_gitrev.sh $(GITREV)
|
$(AM_V_GEN)$(top_srcdir)/scripts/make_gitrev.sh $(GITREV)
|
||||||
|
|
||||||
all: gitrev
|
all: gitrev
|
||||||
|
|
||||||
# Double-colon rules are allowed; there are multiple independent definitions.
|
PHONY += install-data-hook $(INSTALL_DATA_HOOKS)
|
||||||
maintainer-clean-local::
|
install-data-hook: $(INSTALL_DATA_HOOKS)
|
||||||
|
|
||||||
|
PHONY += maintainer-clean-local
|
||||||
|
maintainer-clean-local:
|
||||||
-$(RM) $(GITREV)
|
-$(RM) $(GITREV)
|
||||||
|
|
||||||
distclean-local::
|
PHONY += distclean-local
|
||||||
|
distclean-local:
|
||||||
-$(RM) -R autom4te*.cache build
|
-$(RM) -R autom4te*.cache build
|
||||||
-find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
|
-find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
|
||||||
-o -name .pc -o -name .hg -o -name .git \) -prune -o \
|
-o -name .pc -o -name .hg -o -name .git \) -prune -o \
|
||||||
@ -74,43 +88,27 @@ distclean-local::
|
|||||||
-o -name '*.gcno' \) \
|
-o -name '*.gcno' \) \
|
||||||
-type f -delete
|
-type f -delete
|
||||||
|
|
||||||
all-local:
|
PHONY += $(CLEAN_LOCAL)
|
||||||
-[ -x ${top_builddir}/scripts/zfs-tests.sh ] && \
|
clean-local: $(CLEAN_LOCAL)
|
||||||
${top_builddir}/scripts/zfs-tests.sh -c
|
|
||||||
|
PHONY += $(ALL_LOCAL)
|
||||||
|
all-local: $(ALL_LOCAL)
|
||||||
|
|
||||||
dist-hook:
|
dist-hook:
|
||||||
$(AM_V_GEN)$(top_srcdir)/scripts/make_gitrev.sh -D $(distdir) $(GITREV)
|
$(top_srcdir)/scripts/make_gitrev.sh -D $(distdir) $(GITREV)
|
||||||
$(SED) ${ac_inplace} -e 's/Release:[[:print:]]*/Release: $(RELEASE)/' \
|
$(SED) $(ac_inplace) 's/\(Release:[[:space:]]*\).*/\1$(RELEASE)/' $(distdir)/META
|
||||||
$(distdir)/META
|
|
||||||
|
|
||||||
if BUILD_LINUX
|
PHONY += codecheck $(CHECKS)
|
||||||
# For compatibility, create a matching spl-x.y.z directly which contains
|
codecheck: $(CHECKS)
|
||||||
# symlinks to the updated header and object file locations. These
|
|
||||||
# compatibility links will be removed in the next major release.
|
|
||||||
if CONFIG_KERNEL
|
|
||||||
install-data-hook:
|
|
||||||
rm -rf $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
|
|
||||||
mkdir $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
|
|
||||||
cd $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
|
|
||||||
ln -s ../zfs-$(VERSION)/include/spl include && \
|
|
||||||
ln -s ../zfs-$(VERSION)/$(LINUX_VERSION) $(LINUX_VERSION) && \
|
|
||||||
ln -s ../zfs-$(VERSION)/zfs_config.h.in spl_config.h.in && \
|
|
||||||
ln -s ../zfs-$(VERSION)/zfs.release.in spl.release.in && \
|
|
||||||
cd $(DESTDIR)$(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) && \
|
|
||||||
ln -fs zfs_config.h spl_config.h && \
|
|
||||||
ln -fs zfs.release spl.release
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
PHONY += codecheck
|
SHELLCHECKSCRIPTS += autogen.sh
|
||||||
codecheck: cstyle shellcheck checkbashisms flake8 mancheck testscheck vcscheck zstdcheck
|
|
||||||
|
|
||||||
PHONY += checkstyle
|
PHONY += checkstyle
|
||||||
checkstyle: codecheck commitcheck
|
checkstyle: codecheck commitcheck
|
||||||
|
|
||||||
PHONY += commitcheck
|
PHONY += commitcheck
|
||||||
commitcheck:
|
commitcheck:
|
||||||
@if git rev-parse --git-dir > /dev/null 2>&1; then \
|
$(AM_V_at)if git rev-parse --git-dir > /dev/null 2>&1; then \
|
||||||
${top_srcdir}/scripts/commitcheck.sh; \
|
${top_srcdir}/scripts/commitcheck.sh; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -119,9 +117,9 @@ cstyle_line = -print0 | parallel -X0 ${top_srcdir}/scripts/cstyle.pl -cpP {}
|
|||||||
else
|
else
|
||||||
cstyle_line = -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} +
|
cstyle_line = -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} +
|
||||||
endif
|
endif
|
||||||
PHONY += cstyle
|
CHECKS += cstyle
|
||||||
cstyle:
|
cstyle:
|
||||||
@find ${top_srcdir} -name build -prune \
|
$(AM_V_at)find $(top_srcdir) -name build -prune \
|
||||||
-o -type f -name '*.[hc]' \
|
-o -type f -name '*.[hc]' \
|
||||||
! -name 'zfs_config.*' ! -name '*.mod.c' \
|
! -name 'zfs_config.*' ! -name '*.mod.c' \
|
||||||
! -name 'opt_global.h' ! -name '*_if*.h' \
|
! -name 'opt_global.h' ! -name '*_if*.h' \
|
||||||
@ -133,68 +131,41 @@ cstyle:
|
|||||||
$(cstyle_line)
|
$(cstyle_line)
|
||||||
|
|
||||||
filter_executable = -exec test -x '{}' \; -print
|
filter_executable = -exec test -x '{}' \; -print
|
||||||
|
CHECKS += testscheck
|
||||||
SHELLCHECKDIRS = cmd contrib etc scripts tests
|
|
||||||
SHELLCHECKSCRIPTS = autogen.sh
|
|
||||||
|
|
||||||
PHONY += checkabi storeabi
|
|
||||||
|
|
||||||
checkabi: lib
|
|
||||||
$(MAKE) -C lib checkabi
|
|
||||||
|
|
||||||
storeabi: lib
|
|
||||||
$(MAKE) -C lib storeabi
|
|
||||||
|
|
||||||
PHONY += mancheck
|
|
||||||
mancheck:
|
|
||||||
${top_srcdir}/scripts/mancheck.sh ${top_srcdir}/man ${top_srcdir}/tests/test-runner/man
|
|
||||||
|
|
||||||
PHONY += testscheck
|
|
||||||
testscheck:
|
testscheck:
|
||||||
@[ $$(find ${top_srcdir}/tests/zfs-tests -type f \
|
$(AM_V_at)[ $$(find $(top_srcdir)/tests/zfs-tests -type f \
|
||||||
\( -name '*.ksh' -not ${filter_executable} \) -o \
|
\( -name '*.ksh' -not $(filter_executable) \) -o \
|
||||||
\( -name '*.kshlib' ${filter_executable} \) -o \
|
\( -name '*.kshlib' $(filter_executable) \) -o \
|
||||||
\( -name '*.shlib' ${filter_executable} \) -o \
|
\( -name '*.shlib' $(filter_executable) \) -o \
|
||||||
\( -name '*.cfg' ${filter_executable} \) | \
|
\( -name '*.cfg' $(filter_executable) \) | \
|
||||||
tee /dev/stderr | wc -l) -eq 0 ]
|
tee /dev/stderr | wc -l) -eq 0 ]
|
||||||
|
|
||||||
PHONY += vcscheck
|
CHECKS += vcscheck
|
||||||
vcscheck:
|
vcscheck:
|
||||||
@if git rev-parse --git-dir > /dev/null 2>&1; then \
|
$(AM_V_at)if git rev-parse --git-dir > /dev/null 2>&1; then \
|
||||||
git ls-files . --exclude-standard --others | \
|
git ls-files . --exclude-standard --others | \
|
||||||
awk '{c++; print} END {if(c>0) exit 1}' ; \
|
awk '{c++; print} END {if(c>0) exit 1}' ; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PHONY += zstdcheck
|
CHECKS += zstdcheck
|
||||||
zstdcheck:
|
zstdcheck:
|
||||||
@$(MAKE) -C module/zstd checksymbols
|
@$(MAKE) -C module check-zstd-symbols
|
||||||
|
|
||||||
PHONY += lint
|
PHONY += lint
|
||||||
lint: cppcheck paxcheck
|
lint: cppcheck paxcheck
|
||||||
|
|
||||||
CPPCHECKDIRS = cmd lib module
|
|
||||||
PHONY += cppcheck
|
|
||||||
cppcheck: $(CPPCHECKDIRS)
|
|
||||||
@if test -n "$(CPPCHECK)"; then \
|
|
||||||
set -e ; for dir in $(CPPCHECKDIRS) ; do \
|
|
||||||
$(MAKE) -C $$dir cppcheck ; \
|
|
||||||
done \
|
|
||||||
else \
|
|
||||||
echo "skipping cppcheck because cppcheck is not installed"; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
PHONY += paxcheck
|
PHONY += paxcheck
|
||||||
paxcheck:
|
paxcheck:
|
||||||
@if type scanelf > /dev/null 2>&1; then \
|
$(AM_V_at)if type scanelf > /dev/null 2>&1; then \
|
||||||
${top_srcdir}/scripts/paxcheck.sh ${top_builddir}; \
|
$(top_srcdir)/scripts/paxcheck.sh $(top_builddir); \
|
||||||
else \
|
else \
|
||||||
echo "skipping paxcheck because scanelf is not installed"; \
|
echo "skipping paxcheck because scanelf is not installed"; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PHONY += flake8
|
CHECKS += flake8
|
||||||
flake8:
|
flake8:
|
||||||
@if type flake8 > /dev/null 2>&1; then \
|
$(AM_V_at)if type flake8 > /dev/null 2>&1; then \
|
||||||
flake8 ${top_srcdir}; \
|
flake8 $(top_srcdir); \
|
||||||
else \
|
else \
|
||||||
echo "skipping flake8 because flake8 is not installed"; \
|
echo "skipping flake8 because flake8 is not installed"; \
|
||||||
fi
|
fi
|
||||||
|
@ -1,4 +1,62 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
[ "${0%/*}" = "$0" ] || cd "${0%/*}" || exit
|
||||||
|
|
||||||
autoreconf -fiv || exit 1
|
# %reldir%/%canon_reldir% (%D%/%C%) only appeared in automake 1.14, but RHEL/CentOS 7 has 1.13.4
|
||||||
rm -Rf autom4te.cache
|
# This is an (overly) simplistic preprocessor that papers around this for the duration of the generation step,
|
||||||
|
# and can be removed once support for CentOS 7 is dropped
|
||||||
|
automake --version | awk '{print $NF; exit}' | (
|
||||||
|
IFS=. read -r AM_MAJ AM_MIN _
|
||||||
|
[ "$AM_MAJ" -gt 1 ] || [ "$AM_MIN" -ge 14 ]
|
||||||
|
) || {
|
||||||
|
process_root() {
|
||||||
|
root="$1"; shift
|
||||||
|
|
||||||
|
grep -q '%[CD]%' "$root/Makefile.am" || return
|
||||||
|
find "$root" -name Makefile.am "$@" | while read -r dir; do
|
||||||
|
dir="${dir%/Makefile.am}"
|
||||||
|
grep -q '%[CD]%' "$dir/Makefile.am" || continue
|
||||||
|
|
||||||
|
reldir="${dir#$root}"
|
||||||
|
reldir="${reldir#/}"
|
||||||
|
|
||||||
|
canon_reldir="$(printf '%s' "$reldir" | tr -C 'a-zA-Z0-9@_' '_')"
|
||||||
|
|
||||||
|
reldir_slash="$reldir/"
|
||||||
|
canon_reldir_slash="${canon_reldir}_"
|
||||||
|
[ -z "$reldir" ] && reldir_slash=
|
||||||
|
[ -z "$reldir" ] && canon_reldir_slash=
|
||||||
|
|
||||||
|
echo "$dir/Makefile.am" >&3
|
||||||
|
sed -i~ -e "s:%D%/:$reldir_slash:g" -e "s:%D%:$reldir:g" \
|
||||||
|
-e "s:%C%_:$canon_reldir_slash:g" -e "s:%C%:$canon_reldir:g" "$dir/Makefile.am"
|
||||||
|
done 3>>"$substituted_files"
|
||||||
|
}
|
||||||
|
|
||||||
|
rollback() {
|
||||||
|
while read -r f; do
|
||||||
|
mv "$f~" "$f"
|
||||||
|
done < "$substituted_files"
|
||||||
|
rm -f "$substituted_files"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
echo "Automake <1.14; papering over missing %reldir%/%canon_reldir% support" >&2
|
||||||
|
|
||||||
|
substituted_files="$(mktemp)"
|
||||||
|
trap rollback EXIT
|
||||||
|
|
||||||
|
roots="$(sed '/Makefile$/!d;/module/d;s:^\s*:./:;s:/Makefile::;/^\.$/d' configure.ac)"
|
||||||
|
|
||||||
|
IFS="
|
||||||
|
"
|
||||||
|
for root in $roots; do
|
||||||
|
root="${root#./}"
|
||||||
|
process_root "$root"
|
||||||
|
done
|
||||||
|
|
||||||
|
set -f
|
||||||
|
# shellcheck disable=SC2086,SC2046
|
||||||
|
process_root . $(printf '!\n-path\n%s/*\n' $roots)
|
||||||
|
}
|
||||||
|
|
||||||
|
autoreconf -fiv && rm -rf autom4te.cache
|
||||||
|
@ -1,27 +1,115 @@
|
|||||||
include $(top_srcdir)/config/Shellcheck.am
|
bin_SCRIPTS =
|
||||||
|
bin_PROGRAMS =
|
||||||
|
sbin_SCRIPTS =
|
||||||
|
sbin_PROGRAMS =
|
||||||
|
dist_bin_SCRIPTS =
|
||||||
|
zfsexec_PROGRAMS =
|
||||||
|
mounthelper_PROGRAMS =
|
||||||
|
|
||||||
SUBDIRS = zfs zpool zdb zhack zinject zstream ztest
|
|
||||||
SUBDIRS += fsck_zfs vdev_id raidz_test zfs_ids_to_path
|
|
||||||
SUBDIRS += zpool_influxdb
|
|
||||||
|
|
||||||
CPPCHECKDIRS = zfs zpool zdb zhack zinject zstream ztest
|
sbin_SCRIPTS += fsck.zfs
|
||||||
CPPCHECKDIRS += raidz_test zfs_ids_to_path zpool_influxdb
|
SHELLCHECKSCRIPTS += fsck.zfs
|
||||||
|
CLEANFILES += fsck.zfs
|
||||||
|
EXTRA_DIST += %D%/fsck.zfs.in
|
||||||
|
$(call SUBST,fsck.zfs,%D%/)
|
||||||
|
|
||||||
# TODO: #12084: SHELLCHECKDIRS += vdev_id
|
|
||||||
SHELLCHECKDIRS = fsck_zfs zed zpool zvol_wait
|
|
||||||
|
|
||||||
if USING_PYTHON
|
sbin_PROGRAMS += zfs_ids_to_path
|
||||||
SUBDIRS += arcstat arc_summary dbufstat
|
CPPCHECKTARGETS += zfs_ids_to_path
|
||||||
endif
|
|
||||||
|
zfs_ids_to_path_SOURCES = \
|
||||||
|
%D%/zfs_ids_to_path.c
|
||||||
|
|
||||||
|
zfs_ids_to_path_LDADD = \
|
||||||
|
libzfs.la
|
||||||
|
|
||||||
|
|
||||||
|
zhack_CPPFLAGS = $(AM_CPPFLAGS) $(FORCEDEBUG_CPPFLAGS)
|
||||||
|
|
||||||
|
sbin_PROGRAMS += zhack
|
||||||
|
CPPCHECKTARGETS += zhack
|
||||||
|
|
||||||
|
zhack_SOURCES = \
|
||||||
|
%D%/zhack.c
|
||||||
|
|
||||||
|
zhack_LDADD = \
|
||||||
|
libzpool.la \
|
||||||
|
libzfs_core.la \
|
||||||
|
libnvpair.la
|
||||||
|
|
||||||
|
|
||||||
|
ztest_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS)
|
||||||
|
# Get rid of compiler warning for unchecked truncating snprintfs on gcc 7.1.1
|
||||||
|
ztest_CFLAGS += $(NO_FORMAT_TRUNCATION)
|
||||||
|
ztest_CPPFLAGS = $(AM_CPPFLAGS) $(FORCEDEBUG_CPPFLAGS)
|
||||||
|
|
||||||
|
sbin_PROGRAMS += ztest
|
||||||
|
CPPCHECKTARGETS += ztest
|
||||||
|
|
||||||
|
ztest_SOURCES = \
|
||||||
|
%D%/ztest.c
|
||||||
|
|
||||||
|
ztest_LDADD = \
|
||||||
|
libzpool.la \
|
||||||
|
libzfs_core.la \
|
||||||
|
libnvpair.la
|
||||||
|
|
||||||
|
ztest_LDADD += -lm
|
||||||
|
ztest_LDFLAGS = -pthread
|
||||||
|
|
||||||
|
|
||||||
|
include $(srcdir)/%D%/raidz_test/Makefile.am
|
||||||
|
include $(srcdir)/%D%/zdb/Makefile.am
|
||||||
|
include $(srcdir)/%D%/zfs/Makefile.am
|
||||||
|
include $(srcdir)/%D%/zinject/Makefile.am
|
||||||
|
include $(srcdir)/%D%/zpool/Makefile.am
|
||||||
|
include $(srcdir)/%D%/zpool_influxdb/Makefile.am
|
||||||
|
include $(srcdir)/%D%/zstream/Makefile.am
|
||||||
|
|
||||||
|
|
||||||
if BUILD_LINUX
|
if BUILD_LINUX
|
||||||
SUBDIRS += mount_zfs zed zgenhostid zvol_id zvol_wait
|
mounthelper_PROGRAMS += mount.zfs
|
||||||
CPPCHECKDIRS += mount_zfs zed zgenhostid zvol_id
|
CPPCHECKTARGETS += mount.zfs
|
||||||
SHELLCHECKDIRS += zed
|
|
||||||
|
mount_zfs_SOURCES = \
|
||||||
|
%D%/mount_zfs.c
|
||||||
|
|
||||||
|
mount_zfs_LDADD = \
|
||||||
|
libzfs.la \
|
||||||
|
libzfs_core.la \
|
||||||
|
libnvpair.la
|
||||||
|
|
||||||
|
mount_zfs_LDADD += $(LTLIBINTL)
|
||||||
|
|
||||||
|
CPPCHECKTARGETS += raidz_test
|
||||||
|
|
||||||
|
|
||||||
|
sbin_PROGRAMS += zgenhostid
|
||||||
|
CPPCHECKTARGETS += zgenhostid
|
||||||
|
|
||||||
|
zgenhostid_SOURCES = \
|
||||||
|
%D%/zgenhostid.c
|
||||||
|
|
||||||
|
|
||||||
|
dist_bin_SCRIPTS += %D%/zvol_wait
|
||||||
|
SHELLCHECKSCRIPTS += %D%/zvol_wait
|
||||||
|
|
||||||
|
|
||||||
|
include $(srcdir)/%D%/zed/Makefile.am
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PHONY = cppcheck
|
|
||||||
cppcheck: $(CPPCHECKDIRS)
|
if USING_PYTHON
|
||||||
set -e ; for dir in $(CPPCHECKDIRS) ; do \
|
bin_SCRIPTS += arc_summary arcstat dbufstat
|
||||||
$(MAKE) -C $$dir cppcheck ; \
|
CLEANFILES += arc_summary arcstat dbufstat
|
||||||
done
|
EXTRA_DIST += %D%/arc_summary %D%/arcstat.in %D%/dbufstat.in
|
||||||
|
|
||||||
|
$(call SUBST,arcstat,%D%/)
|
||||||
|
$(call SUBST,dbufstat,%D%/)
|
||||||
|
arc_summary: %D%/arc_summary
|
||||||
|
$(AM_V_at)cp $< $@
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
PHONY += cmd
|
||||||
|
cmd: $(bin_SCRIPTS) $(bin_PROGRAMS) $(sbin_SCRIPTS) $(sbin_PROGRAMS) $(dist_bin_SCRIPTS) $(zfsexec_PROGRAMS) $(mounthelper_PROGRAMS)
|
||||||
|
@ -1 +0,0 @@
|
|||||||
arc_summary
|
|
@ -1,8 +0,0 @@
|
|||||||
bin_SCRIPTS = arc_summary
|
|
||||||
|
|
||||||
CLEANFILES = arc_summary
|
|
||||||
EXTRA_DIST = arc_summary3
|
|
||||||
SCRIPT = arc_summary3
|
|
||||||
|
|
||||||
arc_summary: $(SCRIPT)
|
|
||||||
cp $< $@
|
|
1
sys/contrib/openzfs/cmd/arcstat/.gitignore
vendored
1
sys/contrib/openzfs/cmd/arcstat/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
arcstat
|
|
@ -1,5 +0,0 @@
|
|||||||
include $(top_srcdir)/config/Substfiles.am
|
|
||||||
|
|
||||||
bin_SCRIPTS = arcstat
|
|
||||||
|
|
||||||
SUBSTFILES += $(bin_SCRIPTS)
|
|
1
sys/contrib/openzfs/cmd/dbufstat/.gitignore
vendored
1
sys/contrib/openzfs/cmd/dbufstat/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
dbufstat
|
|
@ -1,5 +0,0 @@
|
|||||||
include $(top_srcdir)/config/Substfiles.am
|
|
||||||
|
|
||||||
bin_SCRIPTS = dbufstat
|
|
||||||
|
|
||||||
SUBSTFILES += $(bin_SCRIPTS)
|
|
@ -7,13 +7,13 @@
|
|||||||
# see fsck.zfs(8)
|
# see fsck.zfs(8)
|
||||||
#
|
#
|
||||||
|
|
||||||
if [ "$#" = "0" ]; then
|
if [ $# -eq 0 ]; then
|
||||||
echo "Usage: $0 [options] dataset…" >&2
|
echo "Usage: $0 [options] dataset…" >&2
|
||||||
exit 16
|
exit 16
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ret=0
|
ret=0
|
||||||
for dataset in "$@"; do
|
for dataset; do
|
||||||
case "$dataset" in
|
case "$dataset" in
|
||||||
-*)
|
-*)
|
||||||
continue
|
continue
|
1
sys/contrib/openzfs/cmd/fsck_zfs/.gitignore
vendored
1
sys/contrib/openzfs/cmd/fsck_zfs/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/fsck.zfs
|
|
@ -1,7 +0,0 @@
|
|||||||
include $(top_srcdir)/config/Substfiles.am
|
|
||||||
include $(top_srcdir)/config/Shellcheck.am
|
|
||||||
|
|
||||||
dist_sbin_SCRIPTS = fsck.zfs
|
|
||||||
|
|
||||||
SUBSTFILES += $(dist_sbin_SCRIPTS)
|
|
||||||
|
|
1
sys/contrib/openzfs/cmd/mount_zfs/.gitignore
vendored
1
sys/contrib/openzfs/cmd/mount_zfs/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
mount.zfs
|
|
@ -1,22 +0,0 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
|
||||||
|
|
||||||
#
|
|
||||||
# Ignore the prefix for the mount helper. It must be installed in /sbin/
|
|
||||||
# because this path is hardcoded in the mount(8) for security reasons.
|
|
||||||
# However, if needed, the configure option --with-mounthelperdir= can be used
|
|
||||||
# to override the default install location.
|
|
||||||
#
|
|
||||||
sbindir=$(mounthelperdir)
|
|
||||||
sbin_PROGRAMS = mount.zfs
|
|
||||||
|
|
||||||
mount_zfs_SOURCES = \
|
|
||||||
mount_zfs.c
|
|
||||||
|
|
||||||
mount_zfs_LDADD = \
|
|
||||||
$(abs_top_builddir)/lib/libzfs/libzfs.la \
|
|
||||||
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
|
||||||
$(abs_top_builddir)/lib/libnvpair/libnvpair.la
|
|
||||||
|
|
||||||
mount_zfs_LDADD += $(LTLIBINTL)
|
|
||||||
|
|
||||||
include $(top_srcdir)/config/CppCheck.am
|
|
@ -1 +0,0 @@
|
|||||||
/raidz_test
|
|
@ -1,22 +1,16 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
raidz_test_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS)
|
||||||
|
raidz_test_CPPFLAGS = $(AM_CPPFLAGS) $(FORCEDEBUG_CPPFLAGS)
|
||||||
|
|
||||||
# Includes kernel code, generate warnings for large stack frames
|
bin_PROGRAMS += raidz_test
|
||||||
AM_CFLAGS += $(FRAME_LARGER_THAN)
|
CPPCHECKTARGETS += raidz_test
|
||||||
|
|
||||||
# Unconditionally enable ASSERTs
|
|
||||||
AM_CPPFLAGS += -DDEBUG -UNDEBUG -DZFS_DEBUG
|
|
||||||
|
|
||||||
bin_PROGRAMS = raidz_test
|
|
||||||
|
|
||||||
raidz_test_SOURCES = \
|
raidz_test_SOURCES = \
|
||||||
raidz_test.h \
|
%D%/raidz_bench.c \
|
||||||
raidz_test.c \
|
%D%/raidz_test.c \
|
||||||
raidz_bench.c
|
%D%/raidz_test.h
|
||||||
|
|
||||||
raidz_test_LDADD = \
|
raidz_test_LDADD = \
|
||||||
$(abs_top_builddir)/lib/libzpool/libzpool.la \
|
libzpool.la \
|
||||||
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la
|
libzfs_core.la
|
||||||
|
|
||||||
raidz_test_LDADD += -lm
|
raidz_test_LDADD += -lm
|
||||||
|
|
||||||
include $(top_srcdir)/config/CppCheck.am
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
include $(top_srcdir)/config/Shellcheck.am
|
|
||||||
|
|
||||||
dist_udev_SCRIPTS = vdev_id
|
|
1
sys/contrib/openzfs/cmd/zdb/.gitignore
vendored
1
sys/contrib/openzfs/cmd/zdb/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/zdb
|
|
@ -1,18 +1,14 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
zdb_CPPFLAGS = $(AM_CPPFLAGS) $(FORCEDEBUG_CPPFLAGS)
|
||||||
|
|
||||||
# Unconditionally enable debugging for zdb
|
sbin_PROGRAMS += zdb
|
||||||
AM_CPPFLAGS += -DDEBUG -UNDEBUG -DZFS_DEBUG
|
CPPCHECKTARGETS += zdb
|
||||||
|
|
||||||
sbin_PROGRAMS = zdb
|
|
||||||
|
|
||||||
zdb_SOURCES = \
|
zdb_SOURCES = \
|
||||||
zdb.c \
|
%D%/zdb.c \
|
||||||
zdb_il.c \
|
%D%/zdb.h \
|
||||||
zdb.h
|
%D%/zdb_il.c
|
||||||
|
|
||||||
zdb_LDADD = \
|
zdb_LDADD = \
|
||||||
$(abs_top_builddir)/lib/libzpool/libzpool.la \
|
libzpool.la \
|
||||||
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
libzfs_core.la \
|
||||||
$(abs_top_builddir)/lib/libnvpair/libnvpair.la
|
libnvpair.la
|
||||||
|
|
||||||
include $(top_srcdir)/config/CppCheck.am
|
|
||||||
|
@ -3926,7 +3926,7 @@ dump_uberblock(uberblock_t *ub, const char *header, const char *footer)
|
|||||||
(void) printf("\ttxg = %llu\n", (u_longlong_t)ub->ub_txg);
|
(void) printf("\ttxg = %llu\n", (u_longlong_t)ub->ub_txg);
|
||||||
(void) printf("\tguid_sum = %llu\n", (u_longlong_t)ub->ub_guid_sum);
|
(void) printf("\tguid_sum = %llu\n", (u_longlong_t)ub->ub_guid_sum);
|
||||||
(void) printf("\ttimestamp = %llu UTC = %s",
|
(void) printf("\ttimestamp = %llu UTC = %s",
|
||||||
(u_longlong_t)ub->ub_timestamp, asctime(localtime(×tamp)));
|
(u_longlong_t)ub->ub_timestamp, ctime(×tamp));
|
||||||
|
|
||||||
(void) printf("\tmmp_magic = %016llx\n",
|
(void) printf("\tmmp_magic = %016llx\n",
|
||||||
(u_longlong_t)ub->ub_mmp_magic);
|
(u_longlong_t)ub->ub_mmp_magic);
|
||||||
@ -8405,7 +8405,6 @@ int
|
|||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
struct rlimit rl = { 1024, 1024 };
|
|
||||||
spa_t *spa = NULL;
|
spa_t *spa = NULL;
|
||||||
objset_t *os = NULL;
|
objset_t *os = NULL;
|
||||||
int dump_all = 1;
|
int dump_all = 1;
|
||||||
@ -8424,9 +8423,6 @@ main(int argc, char **argv)
|
|||||||
boolean_t target_is_spa = B_TRUE, dataset_lookup = B_FALSE;
|
boolean_t target_is_spa = B_TRUE, dataset_lookup = B_FALSE;
|
||||||
nvlist_t *cfg = NULL;
|
nvlist_t *cfg = NULL;
|
||||||
|
|
||||||
(void) setrlimit(RLIMIT_NOFILE, &rl);
|
|
||||||
(void) enable_extended_FILE_stdio(-1, -1);
|
|
||||||
|
|
||||||
dprintf_setup(&argc, argv);
|
dprintf_setup(&argc, argv);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,53 +1,46 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
include $(srcdir)/%D%/zed.d/Makefile.am
|
||||||
include $(top_srcdir)/config/Shellcheck.am
|
|
||||||
|
|
||||||
AM_CFLAGS += $(LIBUDEV_CFLAGS) $(LIBUUID_CFLAGS)
|
zed_CFLAGS = $(AM_CFLAGS)
|
||||||
|
zed_CFLAGS += $(LIBUDEV_CFLAGS) $(LIBUUID_CFLAGS)
|
||||||
|
|
||||||
SUBDIRS = zed.d
|
sbin_PROGRAMS += zed
|
||||||
SHELLCHECKDIRS = $(SUBDIRS)
|
CPPCHECKTARGETS += zed
|
||||||
|
|
||||||
sbin_PROGRAMS = zed
|
zed_SOURCES = \
|
||||||
|
%D%/zed.c \
|
||||||
ZED_SRC = \
|
%D%/zed.h \
|
||||||
zed.c \
|
%D%/zed_conf.c \
|
||||||
zed.h \
|
%D%/zed_conf.h \
|
||||||
zed_conf.c \
|
%D%/zed_disk_event.c \
|
||||||
zed_conf.h \
|
%D%/zed_disk_event.h \
|
||||||
zed_disk_event.c \
|
%D%/zed_event.c \
|
||||||
zed_disk_event.h \
|
%D%/zed_event.h \
|
||||||
zed_event.c \
|
%D%/zed_exec.c \
|
||||||
zed_event.h \
|
%D%/zed_exec.h \
|
||||||
zed_exec.c \
|
%D%/zed_file.c \
|
||||||
zed_exec.h \
|
%D%/zed_file.h \
|
||||||
zed_file.c \
|
%D%/zed_log.c \
|
||||||
zed_file.h \
|
%D%/zed_log.h \
|
||||||
zed_log.c \
|
%D%/zed_strings.c \
|
||||||
zed_log.h \
|
%D%/zed_strings.h \
|
||||||
zed_strings.c \
|
\
|
||||||
zed_strings.h
|
%D%/agents/fmd_api.c \
|
||||||
|
%D%/agents/fmd_api.h \
|
||||||
FMA_SRC = \
|
%D%/agents/fmd_serd.c \
|
||||||
agents/zfs_agents.c \
|
%D%/agents/fmd_serd.h \
|
||||||
agents/zfs_agents.h \
|
%D%/agents/zfs_agents.c \
|
||||||
agents/zfs_diagnosis.c \
|
%D%/agents/zfs_agents.h \
|
||||||
agents/zfs_mod.c \
|
%D%/agents/zfs_diagnosis.c \
|
||||||
agents/zfs_retire.c \
|
%D%/agents/zfs_mod.c \
|
||||||
agents/fmd_api.c \
|
%D%/agents/zfs_retire.c
|
||||||
agents/fmd_api.h \
|
|
||||||
agents/fmd_serd.c \
|
|
||||||
agents/fmd_serd.h
|
|
||||||
|
|
||||||
zed_SOURCES = $(ZED_SRC) $(FMA_SRC)
|
|
||||||
|
|
||||||
zed_LDADD = \
|
zed_LDADD = \
|
||||||
$(abs_top_builddir)/lib/libzfs/libzfs.la \
|
libzfs.la \
|
||||||
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
libzfs_core.la \
|
||||||
$(abs_top_builddir)/lib/libnvpair/libnvpair.la \
|
libnvpair.la \
|
||||||
$(abs_top_builddir)/lib/libuutil/libuutil.la
|
libuutil.la
|
||||||
|
|
||||||
zed_LDADD += -lrt $(LIBATOMIC_LIBS) $(LIBUDEV_LIBS) $(LIBUUID_LIBS)
|
zed_LDADD += -lrt $(LIBATOMIC_LIBS) $(LIBUDEV_LIBS) $(LIBUUID_LIBS)
|
||||||
zed_LDFLAGS = -pthread
|
zed_LDFLAGS = -pthread
|
||||||
|
|
||||||
EXTRA_DIST = agents/README.md
|
EXTRA_DIST += $(addprefix %D%/,agents/README.md)
|
||||||
|
|
||||||
include $(top_srcdir)/config/CppCheck.am
|
|
||||||
|
@ -1,36 +1,27 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
|
||||||
include $(top_srcdir)/config/Substfiles.am
|
|
||||||
include $(top_srcdir)/config/Shellcheck.am
|
|
||||||
|
|
||||||
EXTRA_DIST += README
|
|
||||||
|
|
||||||
zedconfdir = $(sysconfdir)/zfs/zed.d
|
zedconfdir = $(sysconfdir)/zfs/zed.d
|
||||||
|
|
||||||
dist_zedconf_DATA = \
|
dist_zedconf_DATA = \
|
||||||
zed-functions.sh \
|
%D%/zed-functions.sh \
|
||||||
zed.rc
|
%D%/zed.rc
|
||||||
|
|
||||||
SHELLCHECKSCRIPTS = zed-functions.sh zed.rc
|
|
||||||
SHELLCHECK_SHELL = sh
|
|
||||||
|
|
||||||
zedexecdir = $(zfsexecdir)/zed.d
|
zedexecdir = $(zfsexecdir)/zed.d
|
||||||
|
|
||||||
dist_zedexec_SCRIPTS = \
|
dist_zedexec_SCRIPTS = \
|
||||||
all-debug.sh \
|
%D%/all-debug.sh \
|
||||||
all-syslog.sh \
|
%D%/all-syslog.sh \
|
||||||
data-notify.sh \
|
%D%/data-notify.sh \
|
||||||
generic-notify.sh \
|
%D%/generic-notify.sh \
|
||||||
resilver_finish-notify.sh \
|
%D%/pool_import-led.sh \
|
||||||
scrub_finish-notify.sh \
|
%D%/resilver_finish-notify.sh \
|
||||||
statechange-led.sh \
|
%D%/resilver_finish-start-scrub.sh \
|
||||||
statechange-notify.sh \
|
%D%/scrub_finish-notify.sh \
|
||||||
vdev_clear-led.sh \
|
%D%/statechange-led.sh \
|
||||||
vdev_attach-led.sh \
|
%D%/statechange-notify.sh \
|
||||||
pool_import-led.sh \
|
%D%/trim_finish-notify.sh \
|
||||||
resilver_finish-start-scrub.sh \
|
%D%/vdev_attach-led.sh \
|
||||||
trim_finish-notify.sh
|
%D%/vdev_clear-led.sh
|
||||||
|
|
||||||
nodist_zedexec_SCRIPTS = history_event-zfs-list-cacher.sh
|
nodist_zedexec_SCRIPTS = \
|
||||||
|
%D%/history_event-zfs-list-cacher.sh
|
||||||
|
|
||||||
SUBSTFILES += $(nodist_zedexec_SCRIPTS)
|
SUBSTFILES += $(nodist_zedexec_SCRIPTS)
|
||||||
|
|
||||||
@ -38,23 +29,27 @@ zedconfdefaults = \
|
|||||||
all-syslog.sh \
|
all-syslog.sh \
|
||||||
data-notify.sh \
|
data-notify.sh \
|
||||||
history_event-zfs-list-cacher.sh \
|
history_event-zfs-list-cacher.sh \
|
||||||
|
pool_import-led.sh \
|
||||||
resilver_finish-notify.sh \
|
resilver_finish-notify.sh \
|
||||||
|
resilver_finish-start-scrub.sh \
|
||||||
scrub_finish-notify.sh \
|
scrub_finish-notify.sh \
|
||||||
statechange-led.sh \
|
statechange-led.sh \
|
||||||
statechange-notify.sh \
|
statechange-notify.sh \
|
||||||
vdev_clear-led.sh \
|
|
||||||
vdev_attach-led.sh \
|
vdev_attach-led.sh \
|
||||||
pool_import-led.sh \
|
vdev_clear-led.sh
|
||||||
resilver_finish-start-scrub.sh
|
|
||||||
|
|
||||||
install-data-hook:
|
EXTRA_DIST += $(addprefix %D%/,README)
|
||||||
|
|
||||||
|
INSTALL_DATA_HOOKS += zed-install-data-hook
|
||||||
|
zed-install-data-hook:
|
||||||
$(MKDIR_P) "$(DESTDIR)$(zedconfdir)"
|
$(MKDIR_P) "$(DESTDIR)$(zedconfdir)"
|
||||||
for f in $(zedconfdefaults); do \
|
set -x; for f in $(zedconfdefaults); do \
|
||||||
test -f "$(DESTDIR)$(zedconfdir)/$${f}" -o \
|
[ -f "$(DESTDIR)$(zedconfdir)/$${f}" ] ||\
|
||||||
-L "$(DESTDIR)$(zedconfdir)/$${f}" || \
|
[ -L "$(DESTDIR)$(zedconfdir)/$${f}" ] || \
|
||||||
ln -s "$(zedexecdir)/$${f}" "$(DESTDIR)$(zedconfdir)"; \
|
$(LN_S) "$(zedexecdir)/$${f}" "$(DESTDIR)$(zedconfdir)"; \
|
||||||
done
|
done
|
||||||
chmod 0600 "$(DESTDIR)$(zedconfdir)/zed.rc"
|
|
||||||
|
|
||||||
|
SHELLCHECKSCRIPTS += $(dist_zedconf_DATA) $(dist_zedexec_SCRIPTS) $(nodist_zedexec_SCRIPTS)
|
||||||
|
$(call SHELLCHECK_OPTS,$(dist_zedconf_DATA) $(dist_zedexec_SCRIPTS) $(nodist_zedexec_SCRIPTS)): SHELLCHECK_SHELL = sh
|
||||||
# False positive: 1>&"${ZED_FLOCK_FD}" looks suspiciously similar to a >&filename bash extension
|
# 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}"'
|
$(call SHELLCHECK_OPTS,$(dist_zedconf_DATA) $(dist_zedexec_SCRIPTS) $(nodist_zedexec_SCRIPTS)): CHECKBASHISMS_IGNORE = -e 'should be >word 2>&1' -e '&"$${ZED_FLOCK_FD}"'
|
||||||
|
@ -15,7 +15,7 @@ zed_exit_if_ignoring_this_event
|
|||||||
|
|
||||||
zed_lock "${ZED_DEBUG_LOG}"
|
zed_lock "${ZED_DEBUG_LOG}"
|
||||||
{
|
{
|
||||||
printenv | sort
|
env | sort
|
||||||
echo
|
echo
|
||||||
} 1>&"${ZED_FLOCK_FD}"
|
} 1>&"${ZED_FLOCK_FD}"
|
||||||
zed_unlock "${ZED_DEBUG_LOG}"
|
zed_unlock "${ZED_DEBUG_LOG}"
|
||||||
|
@ -76,8 +76,7 @@ zed_log_msg()
|
|||||||
#
|
#
|
||||||
zed_log_err()
|
zed_log_err()
|
||||||
{
|
{
|
||||||
logger -p "${ZED_SYSLOG_PRIORITY}" -t "${ZED_SYSLOG_TAG}" -- "error:" \
|
zed_log_msg "error: ${0##*/}:""${ZEVENT_EID:+" eid=${ZEVENT_EID}:"}" "$@"
|
||||||
"${0##*/}:""${ZEVENT_EID:+" eid=${ZEVENT_EID}:"}" "$@"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
##
|
##
|
||||||
# zed.rc
|
# zed.rc – ZEDLET configuration.
|
||||||
#
|
|
||||||
# This file should be owned by root and permissioned 0600.
|
|
||||||
##
|
##
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
|
|
||||||
|
@ -884,21 +884,21 @@ _zed_event_get_subclass(const char *class)
|
|||||||
static void
|
static void
|
||||||
_zed_event_add_time_strings(uint64_t eid, zed_strings_t *zsp, int64_t etime[])
|
_zed_event_add_time_strings(uint64_t eid, zed_strings_t *zsp, int64_t etime[])
|
||||||
{
|
{
|
||||||
struct tm *stp;
|
struct tm stp;
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
|
||||||
assert(zsp != NULL);
|
assert(zsp != NULL);
|
||||||
assert(etime != NULL);
|
assert(etime != NULL);
|
||||||
|
|
||||||
_zed_event_add_var(eid, zsp, ZEVENT_VAR_PREFIX, "TIME_SECS",
|
_zed_event_add_var(eid, zsp, ZEVENT_VAR_PREFIX, "TIME_SECS",
|
||||||
"%lld", (long long int) etime[0]);
|
"%" PRId64, etime[0]);
|
||||||
_zed_event_add_var(eid, zsp, ZEVENT_VAR_PREFIX, "TIME_NSECS",
|
_zed_event_add_var(eid, zsp, ZEVENT_VAR_PREFIX, "TIME_NSECS",
|
||||||
"%lld", (long long int) etime[1]);
|
"%" PRId64, etime[1]);
|
||||||
|
|
||||||
if (!(stp = localtime((const time_t *) &etime[0]))) {
|
if (!localtime_r((const time_t *) &etime[0], &stp)) {
|
||||||
zed_log_msg(LOG_WARNING, "Failed to add %s%s for eid=%llu: %s",
|
zed_log_msg(LOG_WARNING, "Failed to add %s%s for eid=%llu: %s",
|
||||||
ZEVENT_VAR_PREFIX, "TIME_STRING", eid, "localtime error");
|
ZEVENT_VAR_PREFIX, "TIME_STRING", eid, "localtime error");
|
||||||
} else if (!strftime(buf, sizeof (buf), "%Y-%m-%d %H:%M:%S%z", stp)) {
|
} else if (!strftime(buf, sizeof (buf), "%Y-%m-%d %H:%M:%S%z", &stp)) {
|
||||||
zed_log_msg(LOG_WARNING, "Failed to add %s%s for eid=%llu: %s",
|
zed_log_msg(LOG_WARNING, "Failed to add %s%s for eid=%llu: %s",
|
||||||
ZEVENT_VAR_PREFIX, "TIME_STRING", eid, "strftime error");
|
ZEVENT_VAR_PREFIX, "TIME_STRING", eid, "strftime error");
|
||||||
} else {
|
} else {
|
||||||
|
1
sys/contrib/openzfs/cmd/zfs/.gitignore
vendored
1
sys/contrib/openzfs/cmd/zfs/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/zfs
|
|
@ -1,25 +1,22 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
sbin_PROGRAMS += zfs
|
||||||
|
CPPCHECKTARGETS += zfs
|
||||||
sbin_PROGRAMS = zfs
|
|
||||||
|
|
||||||
zfs_SOURCES = \
|
zfs_SOURCES = \
|
||||||
zfs_iter.c \
|
%D%/zfs_iter.c \
|
||||||
zfs_iter.h \
|
%D%/zfs_iter.h \
|
||||||
zfs_main.c \
|
%D%/zfs_main.c \
|
||||||
zfs_util.h \
|
%D%/zfs_project.c \
|
||||||
zfs_project.c \
|
%D%/zfs_projectutil.h \
|
||||||
zfs_projectutil.h
|
%D%/zfs_util.h
|
||||||
|
|
||||||
zfs_LDADD = \
|
zfs_LDADD = \
|
||||||
$(abs_top_builddir)/lib/libzfs/libzfs.la \
|
libzfs.la \
|
||||||
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
libzfs_core.la \
|
||||||
$(abs_top_builddir)/lib/libnvpair/libnvpair.la \
|
libnvpair.la \
|
||||||
$(abs_top_builddir)/lib/libuutil/libuutil.la
|
libuutil.la
|
||||||
|
|
||||||
zfs_LDADD += $(LTLIBINTL)
|
zfs_LDADD += $(LTLIBINTL)
|
||||||
|
|
||||||
if BUILD_FREEBSD
|
if BUILD_FREEBSD
|
||||||
zfs_LDADD += -lgeom -ljail
|
zfs_LDADD += -lgeom -ljail
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include $(top_srcdir)/config/CppCheck.am
|
|
||||||
|
@ -315,9 +315,9 @@ get_usage(zfs_help_t idx)
|
|||||||
case HELP_ROLLBACK:
|
case HELP_ROLLBACK:
|
||||||
return (gettext("\trollback [-rRf] <snapshot>\n"));
|
return (gettext("\trollback [-rRf] <snapshot>\n"));
|
||||||
case HELP_SEND:
|
case HELP_SEND:
|
||||||
return (gettext("\tsend [-DnPpRvLecwhb] "
|
return (gettext("\tsend [-DLPbcehnpsvw] "
|
||||||
"[-X dataset[,dataset]...] "
|
"[-i|-I snapshot]\n"
|
||||||
"[-[i|I] snapshot] <snapshot>\n"
|
"\t [-R [-X dataset[,dataset]...]] <snapshot>\n"
|
||||||
"\tsend [-DnvPLecw] [-i snapshot|bookmark] "
|
"\tsend [-DnvPLecw] [-i snapshot|bookmark] "
|
||||||
"<filesystem|volume|snapshot>\n"
|
"<filesystem|volume|snapshot>\n"
|
||||||
"\tsend [-DnPpvLec] [-i bookmark|snapshot] "
|
"\tsend [-DnPpvLec] [-i bookmark|snapshot] "
|
||||||
@ -486,10 +486,7 @@ usage_prop_cb(int prop, void *cb)
|
|||||||
else
|
else
|
||||||
(void) fprintf(fp, " NO ");
|
(void) fprintf(fp, " NO ");
|
||||||
|
|
||||||
if (zfs_prop_values(prop) == NULL)
|
(void) fprintf(fp, "%s\n", zfs_prop_values(prop) ?: "-");
|
||||||
(void) fprintf(fp, "-\n");
|
|
||||||
else
|
|
||||||
(void) fprintf(fp, "%s\n", zfs_prop_values(prop));
|
|
||||||
|
|
||||||
return (ZPROP_CONT);
|
return (ZPROP_CONT);
|
||||||
}
|
}
|
||||||
@ -767,12 +764,12 @@ zfs_mount_and_share(libzfs_handle_t *hdl, const char *dataset, zfs_type_t type)
|
|||||||
(void) fprintf(stderr, gettext("filesystem "
|
(void) fprintf(stderr, gettext("filesystem "
|
||||||
"successfully created, but not mounted\n"));
|
"successfully created, but not mounted\n"));
|
||||||
ret = 1;
|
ret = 1;
|
||||||
} else if (zfs_share(zhp) != 0) {
|
} else if (zfs_share(zhp, NULL) != 0) {
|
||||||
(void) fprintf(stderr, gettext("filesystem "
|
(void) fprintf(stderr, gettext("filesystem "
|
||||||
"successfully created, but not shared\n"));
|
"successfully created, but not shared\n"));
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
zfs_commit_all_shares();
|
zfs_commit_shares(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
zfs_close(zhp);
|
zfs_close(zhp);
|
||||||
@ -4318,74 +4315,28 @@ zfs_do_snapshot(int argc, char **argv)
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Array of prefixes to exclude –
|
||||||
|
* a linear search, even if executed for each dataset,
|
||||||
|
* is plenty good enough.
|
||||||
|
*/
|
||||||
typedef struct zfs_send_exclude_arg {
|
typedef struct zfs_send_exclude_arg {
|
||||||
size_t count;
|
size_t count;
|
||||||
char **list;
|
const char **list;
|
||||||
} zfs_send_exclude_arg_t;
|
} zfs_send_exclude_arg_t;
|
||||||
|
|
||||||
/*
|
|
||||||
* This function creates the zfs_send_exclude_arg_t
|
|
||||||
* object described above; it can be called multiple
|
|
||||||
* times, and the input can be comma-separated.
|
|
||||||
* This is NOT the most efficient data layout; however,
|
|
||||||
* I couldn't think of a non-pathological case where
|
|
||||||
* it should have more than a couple dozen instances
|
|
||||||
* of excludes. If that turns out to be used in
|
|
||||||
* practice, we might want to instead use a tree.
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
add_dataset_excludes(char *exclude, zfs_send_exclude_arg_t *context)
|
|
||||||
{
|
|
||||||
char *tok;
|
|
||||||
while ((tok = strsep(&exclude, ",")) != NULL) {
|
|
||||||
if (!zfs_name_valid(tok, ZFS_TYPE_DATASET) ||
|
|
||||||
strchr(tok, '/') == NULL) {
|
|
||||||
(void) fprintf(stderr, gettext("-X %s: "
|
|
||||||
"not a valid non-root dataset name.\n"), tok);
|
|
||||||
usage(B_FALSE);
|
|
||||||
}
|
|
||||||
context->list = safe_realloc(context->list,
|
|
||||||
(sizeof (char *)) * (context->count + 1));
|
|
||||||
context->list[context->count++] = tok;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
free_dataset_excludes(zfs_send_exclude_arg_t *exclude_list)
|
|
||||||
{
|
|
||||||
free(exclude_list->list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This is the call back used by zfs_send to
|
|
||||||
* determine if a dataset should be skipped.
|
|
||||||
* As stated above, this is not the most efficient
|
|
||||||
* data structure to use, but as long as the
|
|
||||||
* number of excluded datasets is relatively
|
|
||||||
* small (a couple of dozen or so), it won't
|
|
||||||
* have a big impact on performance on modern
|
|
||||||
* processors. Since it's excluding hierarchies,
|
|
||||||
* we'd probably want to move to a more complex
|
|
||||||
* tree structure in that case.
|
|
||||||
*/
|
|
||||||
static boolean_t
|
static boolean_t
|
||||||
zfs_do_send_exclude(zfs_handle_t *zhp, void *context)
|
zfs_do_send_exclude(zfs_handle_t *zhp, void *context)
|
||||||
{
|
{
|
||||||
zfs_send_exclude_arg_t *exclude = context;
|
zfs_send_exclude_arg_t *excludes = context;
|
||||||
const char *name = zfs_get_name(zhp);
|
const char *name = zfs_get_name(zhp);
|
||||||
|
|
||||||
for (size_t indx = 0; indx < exclude->count; indx++) {
|
for (size_t i = 0; i < excludes->count; ++i) {
|
||||||
char *exclude_name = exclude->list[indx];
|
size_t len = strlen(excludes->list[i]);
|
||||||
size_t len = strlen(exclude_name);
|
if (strncmp(name, excludes->list[i], len) == 0 &&
|
||||||
/* If it's shorter, it can't possibly match */
|
memchr("/@", name[len], sizeof ("/@")))
|
||||||
if (strlen(name) < len)
|
|
||||||
continue;
|
|
||||||
if (strncmp(name, exclude_name, len) == 0 &&
|
|
||||||
(name[len] == '/' || name[len] == '\0' ||
|
|
||||||
name[len] == '@')) {
|
|
||||||
return (B_FALSE);
|
return (B_FALSE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return (B_TRUE);
|
return (B_TRUE);
|
||||||
}
|
}
|
||||||
@ -4405,7 +4356,7 @@ zfs_do_send(int argc, char **argv)
|
|||||||
int c, err;
|
int c, err;
|
||||||
nvlist_t *dbgnv = NULL;
|
nvlist_t *dbgnv = NULL;
|
||||||
char *redactbook = NULL;
|
char *redactbook = NULL;
|
||||||
zfs_send_exclude_arg_t exclude_context = { 0 };
|
zfs_send_exclude_arg_t excludes = { 0 };
|
||||||
|
|
||||||
struct option long_options[] = {
|
struct option long_options[] = {
|
||||||
{"replicate", no_argument, NULL, 'R'},
|
{"replicate", no_argument, NULL, 'R'},
|
||||||
@ -4433,7 +4384,18 @@ zfs_do_send(int argc, char **argv)
|
|||||||
long_options, NULL)) != -1) {
|
long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'X':
|
case 'X':
|
||||||
add_dataset_excludes(optarg, &exclude_context);
|
for (char *ds; (ds = strsep(&optarg, ",")) != NULL; ) {
|
||||||
|
if (!zfs_name_valid(ds, ZFS_TYPE_DATASET) ||
|
||||||
|
strchr(ds, '/') == NULL) {
|
||||||
|
(void) fprintf(stderr, gettext("-X %s: "
|
||||||
|
"not a valid non-root dataset name"
|
||||||
|
".\n"), ds);
|
||||||
|
usage(B_FALSE);
|
||||||
|
}
|
||||||
|
excludes.list = safe_realloc(excludes.list,
|
||||||
|
sizeof (char *) * (excludes.count + 1));
|
||||||
|
excludes.list[excludes.count++] = ds;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
if (fromname)
|
if (fromname)
|
||||||
@ -4544,7 +4506,7 @@ zfs_do_send(int argc, char **argv)
|
|||||||
if (flags.parsable && flags.verbosity == 0)
|
if (flags.parsable && flags.verbosity == 0)
|
||||||
flags.verbosity = 1;
|
flags.verbosity = 1;
|
||||||
|
|
||||||
if (exclude_context.count > 0 && !flags.replicate) {
|
if (excludes.count > 0 && !flags.replicate) {
|
||||||
(void) fprintf(stderr, gettext("Cannot specify "
|
(void) fprintf(stderr, gettext("Cannot specify "
|
||||||
"dataset exclusion (-X) on a non-recursive "
|
"dataset exclusion (-X) on a non-recursive "
|
||||||
"send.\n"));
|
"send.\n"));
|
||||||
@ -4733,10 +4695,8 @@ zfs_do_send(int argc, char **argv)
|
|||||||
flags.doall = B_TRUE;
|
flags.doall = B_TRUE;
|
||||||
|
|
||||||
err = zfs_send(zhp, fromname, toname, &flags, STDOUT_FILENO,
|
err = zfs_send(zhp, fromname, toname, &flags, STDOUT_FILENO,
|
||||||
exclude_context.count > 0 ? zfs_do_send_exclude : NULL,
|
excludes.count > 0 ? zfs_do_send_exclude : NULL,
|
||||||
&exclude_context, flags.verbosity >= 3 ? &dbgnv : NULL);
|
&excludes, flags.verbosity >= 3 ? &dbgnv : NULL);
|
||||||
|
|
||||||
free_dataset_excludes(&exclude_context);
|
|
||||||
|
|
||||||
if (flags.verbosity >= 3 && dbgnv != NULL) {
|
if (flags.verbosity >= 3 && dbgnv != NULL) {
|
||||||
/*
|
/*
|
||||||
@ -4748,8 +4708,9 @@ zfs_do_send(int argc, char **argv)
|
|||||||
dump_nvlist(dbgnv, 0);
|
dump_nvlist(dbgnv, 0);
|
||||||
nvlist_free(dbgnv);
|
nvlist_free(dbgnv);
|
||||||
}
|
}
|
||||||
zfs_close(zhp);
|
|
||||||
|
|
||||||
|
zfs_close(zhp);
|
||||||
|
free(excludes.list);
|
||||||
return (err != 0);
|
return (err != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5473,8 +5434,6 @@ parse_fs_perm_set(fs_perm_set_t *fspset, nvlist_t *nvl)
|
|||||||
data_type_t type = nvpair_type(nvp);
|
data_type_t type = nvpair_type(nvp);
|
||||||
fs_perm_t *fsperm = NULL;
|
fs_perm_t *fsperm = NULL;
|
||||||
fs_perm_node_t *node = safe_malloc(sizeof (fs_perm_node_t));
|
fs_perm_node_t *node = safe_malloc(sizeof (fs_perm_node_t));
|
||||||
if (node == NULL)
|
|
||||||
nomem();
|
|
||||||
|
|
||||||
fsperm = &node->fspn_fsperm;
|
fsperm = &node->fspn_fsperm;
|
||||||
|
|
||||||
@ -6536,13 +6495,10 @@ holds_callback(zfs_handle_t *zhp, void *data)
|
|||||||
static int
|
static int
|
||||||
zfs_do_holds(int argc, char **argv)
|
zfs_do_holds(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int errors = 0;
|
|
||||||
int c;
|
int c;
|
||||||
int i;
|
boolean_t errors = B_FALSE;
|
||||||
boolean_t scripted = B_FALSE;
|
boolean_t scripted = B_FALSE;
|
||||||
boolean_t recursive = B_FALSE;
|
boolean_t recursive = B_FALSE;
|
||||||
const char *opts = "rH";
|
|
||||||
nvlist_t *nvl;
|
|
||||||
|
|
||||||
int types = ZFS_TYPE_SNAPSHOT;
|
int types = ZFS_TYPE_SNAPSHOT;
|
||||||
holds_cbdata_t cb = { 0 };
|
holds_cbdata_t cb = { 0 };
|
||||||
@ -6552,7 +6508,7 @@ zfs_do_holds(int argc, char **argv)
|
|||||||
int flags = 0;
|
int flags = 0;
|
||||||
|
|
||||||
/* check options */
|
/* check options */
|
||||||
while ((c = getopt(argc, argv, opts)) != -1) {
|
while ((c = getopt(argc, argv, "rH")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'r':
|
case 'r':
|
||||||
recursive = B_TRUE;
|
recursive = B_TRUE;
|
||||||
@ -6579,10 +6535,9 @@ zfs_do_holds(int argc, char **argv)
|
|||||||
if (argc < 1)
|
if (argc < 1)
|
||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
|
|
||||||
if (nvlist_alloc(&nvl, NV_UNIQUE_NAME, 0) != 0)
|
nvlist_t *nvl = fnvlist_alloc();
|
||||||
nomem();
|
|
||||||
|
|
||||||
for (i = 0; i < argc; ++i) {
|
for (int i = 0; i < argc; ++i) {
|
||||||
char *snapshot = argv[i];
|
char *snapshot = argv[i];
|
||||||
const char *delim;
|
const char *delim;
|
||||||
const char *snapname;
|
const char *snapname;
|
||||||
@ -6591,7 +6546,7 @@ zfs_do_holds(int argc, char **argv)
|
|||||||
if (delim == NULL) {
|
if (delim == NULL) {
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
gettext("'%s' is not a snapshot\n"), snapshot);
|
gettext("'%s' is not a snapshot\n"), snapshot);
|
||||||
++errors;
|
errors = B_TRUE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
snapname = delim + 1;
|
snapname = delim + 1;
|
||||||
@ -6605,10 +6560,10 @@ zfs_do_holds(int argc, char **argv)
|
|||||||
/*
|
/*
|
||||||
* 1. collect holds data, set format options
|
* 1. collect holds data, set format options
|
||||||
*/
|
*/
|
||||||
ret = zfs_for_each(argc, argv, flags, types, NULL, NULL, limit,
|
ret = zfs_for_each(1, argv + i, flags, types, NULL, NULL, limit,
|
||||||
holds_callback, &cb);
|
holds_callback, &cb);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
++errors;
|
errors = B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -6621,7 +6576,7 @@ zfs_do_holds(int argc, char **argv)
|
|||||||
|
|
||||||
nvlist_free(nvl);
|
nvlist_free(nvl);
|
||||||
|
|
||||||
return (0 != errors);
|
return (errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CHECK_SPINNER 30
|
#define CHECK_SPINNER 30
|
||||||
@ -6703,7 +6658,7 @@ typedef struct share_mount_state {
|
|||||||
boolean_t sm_verbose;
|
boolean_t sm_verbose;
|
||||||
int sm_flags;
|
int sm_flags;
|
||||||
char *sm_options;
|
char *sm_options;
|
||||||
char *sm_proto; /* only valid for OP_SHARE */
|
enum sa_protocol sm_proto; /* only valid for OP_SHARE */
|
||||||
pthread_mutex_t sm_lock; /* protects the remaining fields */
|
pthread_mutex_t sm_lock; /* protects the remaining fields */
|
||||||
uint_t sm_total; /* number of filesystems to process */
|
uint_t sm_total; /* number of filesystems to process */
|
||||||
uint_t sm_done; /* number of filesystems processed */
|
uint_t sm_done; /* number of filesystems processed */
|
||||||
@ -6714,7 +6669,7 @@ typedef struct share_mount_state {
|
|||||||
* Share or mount a dataset.
|
* Share or mount a dataset.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol,
|
share_mount_one(zfs_handle_t *zhp, int op, int flags, enum sa_protocol protocol,
|
||||||
boolean_t explicit, const char *options)
|
boolean_t explicit, const char *options)
|
||||||
{
|
{
|
||||||
char mountpoint[ZFS_MAXPROPLEN];
|
char mountpoint[ZFS_MAXPROPLEN];
|
||||||
@ -6832,7 +6787,7 @@ share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol,
|
|||||||
return (0);
|
return (0);
|
||||||
if (op == OP_SHARE && !zfs_is_mounted(zhp, NULL)) {
|
if (op == OP_SHARE && !zfs_is_mounted(zhp, NULL)) {
|
||||||
/* also purge it from existing exports */
|
/* also purge it from existing exports */
|
||||||
zfs_unshareall_bypath(zhp, mountpoint);
|
zfs_unshare(zhp, mountpoint, NULL);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6890,10 +6845,11 @@ share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol,
|
|||||||
* filesystem.
|
* filesystem.
|
||||||
*/
|
*/
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case OP_SHARE:
|
case OP_SHARE: {
|
||||||
|
enum sa_protocol prot[] = {SA_PROTOCOL_NFS, SA_NO_PROTOCOL};
|
||||||
shared_nfs = zfs_is_shared_nfs(zhp, NULL);
|
shared_nfs = zfs_is_shared(zhp, NULL, prot);
|
||||||
shared_smb = zfs_is_shared_smb(zhp, NULL);
|
*prot = SA_PROTOCOL_SMB;
|
||||||
|
shared_smb = zfs_is_shared(zhp, NULL, prot);
|
||||||
|
|
||||||
if ((shared_nfs && shared_smb) ||
|
if ((shared_nfs && shared_smb) ||
|
||||||
(shared_nfs && strcmp(shareopts, "on") == 0 &&
|
(shared_nfs && strcmp(shareopts, "on") == 0 &&
|
||||||
@ -6913,23 +6869,11 @@ share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol,
|
|||||||
zfs_mount(zhp, NULL, flags) != 0)
|
zfs_mount(zhp, NULL, flags) != 0)
|
||||||
return (1);
|
return (1);
|
||||||
|
|
||||||
if (protocol == NULL) {
|
*prot = protocol;
|
||||||
if (zfs_shareall(zhp) != 0)
|
if (zfs_share(zhp, protocol == SA_NO_PROTOCOL ? NULL : prot))
|
||||||
return (1);
|
return (1);
|
||||||
} else if (strcmp(protocol, "nfs") == 0) {
|
|
||||||
if (zfs_share_nfs(zhp))
|
|
||||||
return (1);
|
|
||||||
} else if (strcmp(protocol, "smb") == 0) {
|
|
||||||
if (zfs_share_smb(zhp))
|
|
||||||
return (1);
|
|
||||||
} else {
|
|
||||||
(void) fprintf(stderr, gettext("cannot share "
|
|
||||||
"'%s': invalid share type '%s' "
|
|
||||||
"specified\n"),
|
|
||||||
zfs_get_name(zhp), protocol);
|
|
||||||
return (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OP_MOUNT:
|
case OP_MOUNT:
|
||||||
@ -7027,6 +6971,22 @@ append_options(char *mntopts, char *newopts)
|
|||||||
(void) strcpy(&mntopts[len], newopts);
|
(void) strcpy(&mntopts[len], newopts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static enum sa_protocol
|
||||||
|
sa_protocol_decode(const char *protocol)
|
||||||
|
{
|
||||||
|
for (enum sa_protocol i = 0; i < ARRAY_SIZE(sa_protocol_names); ++i)
|
||||||
|
if (strcmp(protocol, sa_protocol_names[i]) == 0)
|
||||||
|
return (i);
|
||||||
|
|
||||||
|
(void) fputs(gettext("share type must be one of: "), stderr);
|
||||||
|
for (enum sa_protocol i = 0;
|
||||||
|
i < ARRAY_SIZE(sa_protocol_names); ++i)
|
||||||
|
(void) fprintf(stderr, "%s%s",
|
||||||
|
i != 0 ? ", " : "", sa_protocol_names[i]);
|
||||||
|
(void) fputc('\n', stderr);
|
||||||
|
usage(B_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
share_mount(int op, int argc, char **argv)
|
share_mount(int op, int argc, char **argv)
|
||||||
{
|
{
|
||||||
@ -7085,16 +7045,10 @@ share_mount(int op, int argc, char **argv)
|
|||||||
|
|
||||||
/* check number of arguments */
|
/* check number of arguments */
|
||||||
if (do_all) {
|
if (do_all) {
|
||||||
char *protocol = NULL;
|
enum sa_protocol protocol = SA_NO_PROTOCOL;
|
||||||
|
|
||||||
if (op == OP_SHARE && argc > 0) {
|
if (op == OP_SHARE && argc > 0) {
|
||||||
if (strcmp(argv[0], "nfs") != 0 &&
|
protocol = sa_protocol_decode(argv[0]);
|
||||||
strcmp(argv[0], "smb") != 0) {
|
|
||||||
(void) fprintf(stderr, gettext("share type "
|
|
||||||
"must be 'nfs' or 'smb'\n"));
|
|
||||||
usage(B_FALSE);
|
|
||||||
}
|
|
||||||
protocol = argv[0];
|
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
@ -7131,7 +7085,7 @@ share_mount(int op, int argc, char **argv)
|
|||||||
zfs_foreach_mountpoint(g_zfs, cb.cb_handles, cb.cb_used,
|
zfs_foreach_mountpoint(g_zfs, cb.cb_handles, cb.cb_used,
|
||||||
share_mount_one_cb, &share_mount_state,
|
share_mount_one_cb, &share_mount_state,
|
||||||
op == OP_MOUNT && !(flags & MS_CRYPT));
|
op == OP_MOUNT && !(flags & MS_CRYPT));
|
||||||
zfs_commit_all_shares();
|
zfs_commit_shares(NULL);
|
||||||
|
|
||||||
ret = share_mount_state.sm_status;
|
ret = share_mount_state.sm_status;
|
||||||
|
|
||||||
@ -7183,9 +7137,9 @@ share_mount(int op, int argc, char **argv)
|
|||||||
ZFS_TYPE_FILESYSTEM)) == NULL) {
|
ZFS_TYPE_FILESYSTEM)) == NULL) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
} else {
|
} else {
|
||||||
ret = share_mount_one(zhp, op, flags, NULL, B_TRUE,
|
ret = share_mount_one(zhp, op, flags, SA_NO_PROTOCOL,
|
||||||
options);
|
B_TRUE, options);
|
||||||
zfs_commit_all_shares();
|
zfs_commit_shares(NULL);
|
||||||
zfs_close(zhp);
|
zfs_close(zhp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7195,7 +7149,7 @@ share_mount(int op, int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* zfs mount -a [nfs]
|
* zfs mount -a
|
||||||
* zfs mount filesystem
|
* zfs mount filesystem
|
||||||
*
|
*
|
||||||
* Mount all filesystems, or mount the given filesystem.
|
* Mount all filesystems, or mount the given filesystem.
|
||||||
@ -7304,12 +7258,12 @@ unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual)
|
|||||||
"'%s': legacy share\n"), path);
|
"'%s': legacy share\n"), path);
|
||||||
(void) fprintf(stderr, gettext("use exportfs(8) "
|
(void) fprintf(stderr, gettext("use exportfs(8) "
|
||||||
"or smbcontrol(1) to unshare this filesystem\n"));
|
"or smbcontrol(1) to unshare this filesystem\n"));
|
||||||
} else if (!zfs_is_shared(zhp)) {
|
} else if (!zfs_is_shared(zhp, NULL, NULL)) {
|
||||||
(void) fprintf(stderr, gettext("cannot unshare '%s': "
|
(void) fprintf(stderr, gettext("cannot unshare '%s': "
|
||||||
"not currently shared\n"), path);
|
"not currently shared\n"), path);
|
||||||
} else {
|
} else {
|
||||||
ret = zfs_unshareall_bypath(zhp, path);
|
ret = zfs_unshare(zhp, path, NULL);
|
||||||
zfs_commit_all_shares();
|
zfs_commit_shares(NULL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
char mtpt_prop[ZFS_MAXPROPLEN];
|
char mtpt_prop[ZFS_MAXPROPLEN];
|
||||||
@ -7399,16 +7353,12 @@ unshare_unmount(int op, int argc, char **argv)
|
|||||||
unshare_unmount_node_t *node;
|
unshare_unmount_node_t *node;
|
||||||
uu_avl_index_t idx;
|
uu_avl_index_t idx;
|
||||||
uu_avl_walk_t *walk;
|
uu_avl_walk_t *walk;
|
||||||
char *protocol = NULL;
|
enum sa_protocol *protocol = NULL,
|
||||||
|
single_protocol[] = {SA_NO_PROTOCOL, SA_NO_PROTOCOL};
|
||||||
|
|
||||||
if (op == OP_SHARE && argc > 0) {
|
if (op == OP_SHARE && argc > 0) {
|
||||||
if (strcmp(argv[0], "nfs") != 0 &&
|
*single_protocol = sa_protocol_decode(argv[0]);
|
||||||
strcmp(argv[0], "smb") != 0) {
|
protocol = single_protocol;
|
||||||
(void) fprintf(stderr, gettext("share type "
|
|
||||||
"must be 'nfs' or 'smb'\n"));
|
|
||||||
usage(B_FALSE);
|
|
||||||
}
|
|
||||||
protocol = argv[0];
|
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
@ -7515,7 +7465,7 @@ unshare_unmount(int op, int argc, char **argv)
|
|||||||
uu_avl_remove(tree, node);
|
uu_avl_remove(tree, node);
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case OP_SHARE:
|
case OP_SHARE:
|
||||||
if (zfs_unshareall_bytype(node->un_zhp,
|
if (zfs_unshare(node->un_zhp,
|
||||||
node->un_mountp, protocol) != 0)
|
node->un_mountp, protocol) != 0)
|
||||||
ret = 1;
|
ret = 1;
|
||||||
break;
|
break;
|
||||||
@ -7588,12 +7538,12 @@ unshare_unmount(int op, int argc, char **argv)
|
|||||||
"exports(5) or smb.conf(5) to unshare "
|
"exports(5) or smb.conf(5) to unshare "
|
||||||
"this filesystem\n"));
|
"this filesystem\n"));
|
||||||
ret = 1;
|
ret = 1;
|
||||||
} else if (!zfs_is_shared(zhp)) {
|
} else if (!zfs_is_shared(zhp, NULL, NULL)) {
|
||||||
(void) fprintf(stderr, gettext("cannot "
|
(void) fprintf(stderr, gettext("cannot "
|
||||||
"unshare '%s': not currently "
|
"unshare '%s': not currently "
|
||||||
"shared\n"), zfs_get_name(zhp));
|
"shared\n"), zfs_get_name(zhp));
|
||||||
ret = 1;
|
ret = 1;
|
||||||
} else if (zfs_unshareall(zhp) != 0) {
|
} else if (zfs_unshareall(zhp, NULL) != 0) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -8702,7 +8652,7 @@ main(int argc, char **argv)
|
|||||||
* Many commands modify input strings for string parsing reasons.
|
* Many commands modify input strings for string parsing reasons.
|
||||||
* We create a copy to protect the original argv.
|
* We create a copy to protect the original argv.
|
||||||
*/
|
*/
|
||||||
newargv = malloc((argc + 1) * sizeof (newargv[0]));
|
newargv = safe_malloc((argc + 1) * sizeof (newargv[0]));
|
||||||
for (i = 0; i < argc; i++)
|
for (i = 0; i < argc; i++)
|
||||||
newargv[i] = strdup(argv[i]);
|
newargv[i] = strdup(argv[i]);
|
||||||
newargv[argc] = NULL;
|
newargv[argc] = NULL;
|
||||||
|
@ -1 +0,0 @@
|
|||||||
zfs_ids_to_path
|
|
@ -1,11 +0,0 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
|
||||||
|
|
||||||
sbin_PROGRAMS = zfs_ids_to_path
|
|
||||||
|
|
||||||
zfs_ids_to_path_SOURCES = \
|
|
||||||
zfs_ids_to_path.c
|
|
||||||
|
|
||||||
zfs_ids_to_path_LDADD = \
|
|
||||||
$(abs_top_builddir)/lib/libzfs/libzfs.la
|
|
||||||
|
|
||||||
include $(top_srcdir)/config/CppCheck.am
|
|
@ -1 +0,0 @@
|
|||||||
/zgenhostid
|
|
@ -1,7 +0,0 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
|
||||||
|
|
||||||
sbin_PROGRAMS = zgenhostid
|
|
||||||
|
|
||||||
zgenhostid_SOURCES = zgenhostid.c
|
|
||||||
|
|
||||||
include $(top_srcdir)/config/CppCheck.am
|
|
1
sys/contrib/openzfs/cmd/zhack/.gitignore
vendored
1
sys/contrib/openzfs/cmd/zhack/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/zhack
|
|
@ -1,16 +0,0 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
|
||||||
|
|
||||||
# Unconditionally enable debugging for zhack
|
|
||||||
AM_CPPFLAGS += -DDEBUG -UNDEBUG -DZFS_DEBUG
|
|
||||||
|
|
||||||
sbin_PROGRAMS = zhack
|
|
||||||
|
|
||||||
zhack_SOURCES = \
|
|
||||||
zhack.c
|
|
||||||
|
|
||||||
zhack_LDADD = \
|
|
||||||
$(abs_top_builddir)/lib/libzpool/libzpool.la \
|
|
||||||
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
|
||||||
$(abs_top_builddir)/lib/libnvpair/libnvpair.la
|
|
||||||
|
|
||||||
include $(top_srcdir)/config/CppCheck.am
|
|
1
sys/contrib/openzfs/cmd/zinject/.gitignore
vendored
1
sys/contrib/openzfs/cmd/zinject/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/zinject
|
|
@ -1,15 +1,12 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
sbin_PROGRAMS += zinject
|
||||||
|
CPPCHECKTARGETS += zinject
|
||||||
sbin_PROGRAMS = zinject
|
|
||||||
|
|
||||||
zinject_SOURCES = \
|
zinject_SOURCES = \
|
||||||
translate.c \
|
%D%/translate.c \
|
||||||
zinject.c \
|
%D%/zinject.c \
|
||||||
zinject.h
|
%D%/zinject.h
|
||||||
|
|
||||||
zinject_LDADD = \
|
zinject_LDADD = \
|
||||||
$(abs_top_builddir)/lib/libzfs/libzfs.la \
|
libzfs.la \
|
||||||
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
libzfs_core.la \
|
||||||
$(abs_top_builddir)/lib/libnvpair/libnvpair.la
|
libnvpair.la
|
||||||
|
|
||||||
include $(top_srcdir)/config/CppCheck.am
|
|
||||||
|
1
sys/contrib/openzfs/cmd/zpool/.gitignore
vendored
1
sys/contrib/openzfs/cmd/zpool/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/zpool
|
|
@ -1,34 +1,35 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
zpool_CFLAGS = $(AM_CFLAGS)
|
||||||
include $(top_srcdir)/config/Shellcheck.am
|
zpool_CFLAGS += $(LIBBLKID_CFLAGS) $(LIBUUID_CFLAGS)
|
||||||
|
|
||||||
AM_CFLAGS += $(LIBBLKID_CFLAGS) $(LIBUUID_CFLAGS)
|
zpool_CPPFLAGS = $(AM_CPPFLAGS)
|
||||||
|
zpool_CPPFLAGS += -I$(srcdir)/%D%
|
||||||
|
|
||||||
DEFAULT_INCLUDES += -I$(srcdir)
|
sbin_PROGRAMS += zpool
|
||||||
|
CPPCHECKTARGETS += zpool
|
||||||
|
|
||||||
sbin_PROGRAMS = zpool
|
|
||||||
|
|
||||||
zpool_SOURCES = \
|
zpool_SOURCES = \
|
||||||
zpool_iter.c \
|
%D%/zpool_iter.c \
|
||||||
zpool_main.c \
|
%D%/zpool_main.c \
|
||||||
zpool_util.c \
|
%D%/zpool_util.c \
|
||||||
zpool_util.h \
|
%D%/zpool_util.h \
|
||||||
zpool_vdev.c
|
%D%/zpool_vdev.c
|
||||||
|
|
||||||
if BUILD_FREEBSD
|
if BUILD_FREEBSD
|
||||||
zpool_SOURCES += os/freebsd/zpool_vdev_os.c
|
zpool_SOURCES += \
|
||||||
|
%D%/os/freebsd/zpool_vdev_os.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if BUILD_LINUX
|
if BUILD_LINUX
|
||||||
zpool_SOURCES += os/linux/zpool_vdev_os.c
|
zpool_SOURCES += \
|
||||||
|
%D%/os/linux/zpool_vdev_os.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
zpool_LDADD = \
|
zpool_LDADD = \
|
||||||
$(abs_top_builddir)/lib/libzfs/libzfs.la \
|
libzfs.la \
|
||||||
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
libzfs_core.la \
|
||||||
$(abs_top_builddir)/lib/libnvpair/libnvpair.la \
|
libnvpair.la \
|
||||||
$(abs_top_builddir)/lib/libuutil/libuutil.la \
|
libuutil.la \
|
||||||
$(abs_top_builddir)/lib/libzutil/libzutil.la
|
libzutil.la
|
||||||
|
|
||||||
zpool_LDADD += $(LTLIBINTL)
|
zpool_LDADD += $(LTLIBINTL)
|
||||||
|
|
||||||
@ -37,56 +38,53 @@ zpool_LDADD += -lgeom
|
|||||||
endif
|
endif
|
||||||
zpool_LDADD += -lm $(LIBBLKID_LIBS) $(LIBUUID_LIBS)
|
zpool_LDADD += -lm $(LIBBLKID_LIBS) $(LIBUUID_LIBS)
|
||||||
|
|
||||||
include $(top_srcdir)/config/CppCheck.am
|
EXTRA_DIST += $(addprefix %D%/,zpool.d/README compatibility.d)
|
||||||
|
|
||||||
zpoolconfdir = $(sysconfdir)/zfs/zpool.d
|
SHELLCHECKSCRIPTS += $(dist_zpoolexec_SCRIPTS)
|
||||||
zpoolexecdir = $(zfsexecdir)/zpool.d
|
zpoolexecdir = $(zfsexecdir)/zpool.d
|
||||||
|
|
||||||
EXTRA_DIST = zpool.d/README compatibility.d
|
|
||||||
|
|
||||||
dist_zpoolexec_SCRIPTS = \
|
dist_zpoolexec_SCRIPTS = \
|
||||||
zpool.d/dm-deps \
|
%D%/zpool.d/ata_err \
|
||||||
zpool.d/enc \
|
%D%/zpool.d/cmd_to \
|
||||||
zpool.d/encdev \
|
%D%/zpool.d/defect \
|
||||||
zpool.d/fault_led \
|
%D%/zpool.d/dm-deps \
|
||||||
zpool.d/iostat \
|
%D%/zpool.d/enc \
|
||||||
zpool.d/iostat-1s \
|
%D%/zpool.d/encdev \
|
||||||
zpool.d/iostat-10s \
|
%D%/zpool.d/fault_led \
|
||||||
zpool.d/label \
|
%D%/zpool.d/health \
|
||||||
zpool.d/locate_led \
|
%D%/zpool.d/hours_on \
|
||||||
zpool.d/lsblk \
|
%D%/zpool.d/iostat \
|
||||||
zpool.d/media \
|
%D%/zpool.d/iostat-10s \
|
||||||
zpool.d/model \
|
%D%/zpool.d/iostat-1s \
|
||||||
zpool.d/serial \
|
%D%/zpool.d/label \
|
||||||
zpool.d/ses \
|
%D%/zpool.d/locate_led \
|
||||||
zpool.d/size \
|
%D%/zpool.d/lsblk \
|
||||||
zpool.d/slot \
|
%D%/zpool.d/media \
|
||||||
zpool.d/smart \
|
%D%/zpool.d/model \
|
||||||
zpool.d/smartx \
|
%D%/zpool.d/nonmed \
|
||||||
zpool.d/temp \
|
%D%/zpool.d/nvme_err \
|
||||||
zpool.d/health \
|
%D%/zpool.d/off_ucor \
|
||||||
zpool.d/r_proc \
|
%D%/zpool.d/pend_sec \
|
||||||
zpool.d/w_proc \
|
%D%/zpool.d/pwr_cyc \
|
||||||
zpool.d/r_ucor \
|
%D%/zpool.d/r_proc \
|
||||||
zpool.d/w_ucor \
|
%D%/zpool.d/r_ucor \
|
||||||
zpool.d/nonmed \
|
%D%/zpool.d/realloc \
|
||||||
zpool.d/defect \
|
%D%/zpool.d/rep_ucor \
|
||||||
zpool.d/hours_on \
|
%D%/zpool.d/serial \
|
||||||
zpool.d/realloc \
|
%D%/zpool.d/ses \
|
||||||
zpool.d/rep_ucor \
|
%D%/zpool.d/size \
|
||||||
zpool.d/cmd_to \
|
%D%/zpool.d/slot \
|
||||||
zpool.d/pend_sec \
|
%D%/zpool.d/smart \
|
||||||
zpool.d/off_ucor \
|
%D%/zpool.d/smart_test \
|
||||||
zpool.d/ata_err \
|
%D%/zpool.d/smartx \
|
||||||
zpool.d/nvme_err \
|
%D%/zpool.d/temp \
|
||||||
zpool.d/pwr_cyc \
|
%D%/zpool.d/test_ended \
|
||||||
zpool.d/upath \
|
%D%/zpool.d/test_progress \
|
||||||
zpool.d/vendor \
|
%D%/zpool.d/test_status \
|
||||||
zpool.d/smart_test \
|
%D%/zpool.d/test_type \
|
||||||
zpool.d/test_type \
|
%D%/zpool.d/upath \
|
||||||
zpool.d/test_status \
|
%D%/zpool.d/vendor \
|
||||||
zpool.d/test_progress \
|
%D%/zpool.d/w_proc \
|
||||||
zpool.d/test_ended
|
%D%/zpool.d/w_ucor
|
||||||
|
|
||||||
zpoolconfdefaults = \
|
zpoolconfdefaults = \
|
||||||
dm-deps \
|
dm-deps \
|
||||||
@ -133,29 +131,28 @@ zpoolconfdefaults = \
|
|||||||
test_ended
|
test_ended
|
||||||
|
|
||||||
zpoolcompatdir = $(pkgdatadir)/compatibility.d
|
zpoolcompatdir = $(pkgdatadir)/compatibility.d
|
||||||
|
|
||||||
dist_zpoolcompat_DATA = \
|
dist_zpoolcompat_DATA = \
|
||||||
compatibility.d/compat-2018 \
|
%D%/compatibility.d/compat-2018 \
|
||||||
compatibility.d/compat-2019 \
|
%D%/compatibility.d/compat-2019 \
|
||||||
compatibility.d/compat-2020 \
|
%D%/compatibility.d/compat-2020 \
|
||||||
compatibility.d/compat-2021 \
|
%D%/compatibility.d/compat-2021 \
|
||||||
compatibility.d/freebsd-11.0 \
|
%D%/compatibility.d/freebsd-11.0 \
|
||||||
compatibility.d/freebsd-11.2 \
|
%D%/compatibility.d/freebsd-11.2 \
|
||||||
compatibility.d/freebsd-11.3 \
|
%D%/compatibility.d/freebsd-11.3 \
|
||||||
compatibility.d/freenas-9.10.2 \
|
%D%/compatibility.d/freenas-9.10.2 \
|
||||||
compatibility.d/grub2 \
|
%D%/compatibility.d/grub2 \
|
||||||
compatibility.d/openzfsonosx-1.7.0 \
|
%D%/compatibility.d/openzfs-2.0-freebsd \
|
||||||
compatibility.d/openzfsonosx-1.8.1 \
|
%D%/compatibility.d/openzfs-2.0-linux \
|
||||||
compatibility.d/openzfsonosx-1.9.3 \
|
%D%/compatibility.d/openzfs-2.1-freebsd \
|
||||||
compatibility.d/openzfs-2.0-freebsd \
|
%D%/compatibility.d/openzfs-2.1-linux \
|
||||||
compatibility.d/openzfs-2.0-linux \
|
%D%/compatibility.d/openzfsonosx-1.7.0 \
|
||||||
compatibility.d/openzfs-2.1-freebsd \
|
%D%/compatibility.d/openzfsonosx-1.8.1 \
|
||||||
compatibility.d/openzfs-2.1-linux \
|
%D%/compatibility.d/openzfsonosx-1.9.3 \
|
||||||
compatibility.d/zol-0.6.1 \
|
%D%/compatibility.d/zol-0.6.1 \
|
||||||
compatibility.d/zol-0.6.4 \
|
%D%/compatibility.d/zol-0.6.4 \
|
||||||
compatibility.d/zol-0.6.5 \
|
%D%/compatibility.d/zol-0.6.5 \
|
||||||
compatibility.d/zol-0.7 \
|
%D%/compatibility.d/zol-0.7 \
|
||||||
compatibility.d/zol-0.8
|
%D%/compatibility.d/zol-0.8
|
||||||
|
|
||||||
# canonical <- alias symbolic link pairs
|
# canonical <- alias symbolic link pairs
|
||||||
# eg: "2018" is a link to "compat-2018"
|
# eg: "2018" is a link to "compat-2018"
|
||||||
@ -178,13 +175,16 @@ zpoolcompatlinks = \
|
|||||||
"zol-0.7 ubuntu-18.04" \
|
"zol-0.7 ubuntu-18.04" \
|
||||||
"zol-0.8 ubuntu-20.04"
|
"zol-0.8 ubuntu-20.04"
|
||||||
|
|
||||||
install-data-hook:
|
zpoolconfdir = $(sysconfdir)/zfs/zpool.d
|
||||||
|
INSTALL_DATA_HOOKS += zpool-install-data-hook
|
||||||
|
zpool-install-data-hook:
|
||||||
$(MKDIR_P) "$(DESTDIR)$(zpoolconfdir)"
|
$(MKDIR_P) "$(DESTDIR)$(zpoolconfdir)"
|
||||||
for f in $(zpoolconfdefaults); do \
|
set -x; for f in $(zpoolconfdefaults); do \
|
||||||
test -f "$(DESTDIR)$(zpoolconfdir)/$${f}" -o \
|
[ -f "$(DESTDIR)$(zpoolconfdir)/$${f}" ] || \
|
||||||
-L "$(DESTDIR)$(zpoolconfdir)/$${f}" || \
|
[ -L "$(DESTDIR)$(zpoolconfdir)/$${f}" ] || \
|
||||||
ln -s "$(zpoolexecdir)/$${f}" "$(DESTDIR)$(zpoolconfdir)"; \
|
$(LN_S) "$(zpoolexecdir)/$${f}" "$(DESTDIR)$(zpoolconfdir)"; \
|
||||||
done
|
done
|
||||||
for l in $(zpoolcompatlinks); do \
|
set -x; printf '%s\n' $(zpoolcompatlinks) | \
|
||||||
(cd "$(DESTDIR)$(zpoolcompatdir)"; ln -sf $${l} ); \
|
while read -r canon alias; do \
|
||||||
|
$(LN_S) -f "$${canon}" "$(DESTDIR)$(zpoolcompatdir)/$${alias}"; \
|
||||||
done
|
done
|
||||||
|
@ -15,6 +15,15 @@ if [ "$1" = "-h" ] ; then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Sometimes, UPATH ends up /dev/(null).
|
||||||
|
# That should be corrected, but for now...
|
||||||
|
# shellcheck disable=SC2154
|
||||||
|
if [ ! -b "$VDEV_UPATH" ]; then
|
||||||
|
somepath="${VDEV_PATH}"
|
||||||
|
else
|
||||||
|
somepath="${VDEV_UPATH}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$script" = "iostat-1s" ] ; then
|
if [ "$script" = "iostat-1s" ] ; then
|
||||||
# Do a single one-second sample
|
# Do a single one-second sample
|
||||||
interval=1
|
interval=1
|
||||||
@ -27,8 +36,7 @@ elif [ "$script" = "iostat-10s" ] ; then
|
|||||||
brief="yes"
|
brief="yes"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# shellcheck disable=SC2154
|
if [ -f "$somepath" ] ; then
|
||||||
if [ -f "$VDEV_UPATH" ] ; then
|
|
||||||
# We're a file-based vdev, iostat doesn't work on us. Do nothing.
|
# We're a file-based vdev, iostat doesn't work on us. Do nothing.
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
@ -37,13 +45,13 @@ if [ "$(uname)" = "FreeBSD" ]; then
|
|||||||
out=$(iostat -dKx \
|
out=$(iostat -dKx \
|
||||||
${interval:+"-w $interval"} \
|
${interval:+"-w $interval"} \
|
||||||
${interval:+"-c 1"} \
|
${interval:+"-c 1"} \
|
||||||
"$VDEV_UPATH" | tail -n 2)
|
"$somepath" | tail -n 2)
|
||||||
else
|
else
|
||||||
out=$(iostat -kx \
|
out=$(iostat -kx \
|
||||||
${brief:+"-y"} \
|
${brief:+"-y"} \
|
||||||
${interval:+"$interval"} \
|
${interval:+"$interval"} \
|
||||||
${interval:+"1"} \
|
${interval:+"1"} \
|
||||||
"$VDEV_UPATH" | grep -v '^$' | tail -n 2)
|
"$somepath" | grep -v '^$' | tail -n 2)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,21 +61,29 @@ else
|
|||||||
list=$(echo "$script" | tr '[:upper:]' '[:lower:]')
|
list=$(echo "$script" | tr '[:upper:]' '[:lower:]')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Sometimes, UPATH ends up /dev/(null).
|
||||||
|
# That should be corrected, but for now...
|
||||||
|
# shellcheck disable=SC2154
|
||||||
|
if [ ! -b "$VDEV_UPATH" ]; then
|
||||||
|
somepath="${VDEV_PATH}"
|
||||||
|
else
|
||||||
|
somepath="${VDEV_UPATH}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Older versions of lsblk don't support all these values (like SERIAL).
|
# Older versions of lsblk don't support all these values (like SERIAL).
|
||||||
for i in $list ; do
|
for i in $list ; do
|
||||||
|
|
||||||
# Special case: Looking up the size of a file-based vdev can't
|
# Special case: Looking up the size of a file-based vdev can't
|
||||||
# be done with lsblk.
|
# be done with lsblk.
|
||||||
# shellcheck disable=SC2154
|
if [ "$i" = "size" ] && [ -f "$somepath" ] ; then
|
||||||
if [ "$i" = "size" ] && [ -f "$VDEV_UPATH" ] ; then
|
size=$(du -h --apparent-size "$somepath" | cut -f 1)
|
||||||
size=$(du -h --apparent-size "$VDEV_UPATH" | cut -f 1)
|
|
||||||
echo "size=$size"
|
echo "size=$size"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
val=""
|
val=""
|
||||||
if val=$(eval "lsblk -dl -n -o $i $VDEV_UPATH 2>/dev/null") ; then
|
if val=$(eval "lsblk -dl -n -o $i $somepath 2>/dev/null") ; then
|
||||||
# Remove leading/trailing whitespace from value
|
# Remove leading/trailing whitespace from value
|
||||||
val=$(echo "$val" | sed -e 's/^[[:space:]]*//' \
|
val=$(echo "$val" | sed -e 's/^[[:space:]]*//' \
|
||||||
-e 's/[[:space:]]*$//')
|
-e 's/[[:space:]]*$//')
|
||||||
|
@ -69,8 +69,16 @@ if [ "$1" = "-h" ] ; then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Sometimes, UPATH ends up /dev/(null).
|
||||||
|
# That should be corrected, but for now...
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
if [ -b "$VDEV_UPATH" ] && PATH="/usr/sbin:$PATH" command -v smartctl > /dev/null || [ -n "$samples" ] ; then
|
if [ ! -b "$VDEV_UPATH" ]; then
|
||||||
|
somepath="${VDEV_PATH}"
|
||||||
|
else
|
||||||
|
somepath="${VDEV_UPATH}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -b "$somepath" ] && PATH="/usr/sbin:$PATH" command -v smartctl > /dev/null || [ -n "$samples" ] ; then
|
||||||
if [ -n "$samples" ] ; then
|
if [ -n "$samples" ] ; then
|
||||||
# cat a smartctl output text file instead of running smartctl
|
# cat a smartctl output text file instead of running smartctl
|
||||||
# on a vdev (only used for developer testing).
|
# on a vdev (only used for developer testing).
|
||||||
@ -78,7 +86,7 @@ if [ -b "$VDEV_UPATH" ] && PATH="/usr/sbin:$PATH" command -v smartctl > /dev/nul
|
|||||||
echo "file=$file"
|
echo "file=$file"
|
||||||
raw_out=$(cat "$samples/$file")
|
raw_out=$(cat "$samples/$file")
|
||||||
else
|
else
|
||||||
raw_out=$(sudo smartctl -a "$VDEV_UPATH")
|
raw_out=$(sudo smartctl -a "$somepath")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# What kind of drive are we? Look for the right line in smartctl:
|
# What kind of drive are we? Look for the right line in smartctl:
|
||||||
|
@ -1790,8 +1790,8 @@ zpool_do_create(int argc, char **argv)
|
|||||||
tname ? tname : poolname, ZFS_TYPE_FILESYSTEM);
|
tname ? tname : poolname, ZFS_TYPE_FILESYSTEM);
|
||||||
if (pool != NULL) {
|
if (pool != NULL) {
|
||||||
if (zfs_mount(pool, NULL, 0) == 0) {
|
if (zfs_mount(pool, NULL, 0) == 0) {
|
||||||
ret = zfs_shareall(pool);
|
ret = zfs_share(pool, NULL);
|
||||||
zfs_commit_all_shares();
|
zfs_commit_shares(NULL);
|
||||||
}
|
}
|
||||||
zfs_close(pool);
|
zfs_close(pool);
|
||||||
}
|
}
|
||||||
@ -1987,40 +1987,21 @@ static int
|
|||||||
max_width(zpool_handle_t *zhp, nvlist_t *nv, int depth, int max,
|
max_width(zpool_handle_t *zhp, nvlist_t *nv, int depth, int max,
|
||||||
int name_flags)
|
int name_flags)
|
||||||
{
|
{
|
||||||
char *name;
|
static const char *const subtypes[] =
|
||||||
nvlist_t **child;
|
{ZPOOL_CONFIG_SPARES, ZPOOL_CONFIG_L2CACHE, ZPOOL_CONFIG_CHILDREN};
|
||||||
uint_t c, children;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
name = zpool_vdev_name(g_zfs, zhp, nv, name_flags);
|
|
||||||
if (strlen(name) + depth > max)
|
|
||||||
max = strlen(name) + depth;
|
|
||||||
|
|
||||||
|
char *name = zpool_vdev_name(g_zfs, zhp, nv, name_flags);
|
||||||
|
max = MAX(strlen(name) + depth, max);
|
||||||
free(name);
|
free(name);
|
||||||
|
|
||||||
if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_SPARES,
|
nvlist_t **child;
|
||||||
&child, &children) == 0) {
|
uint_t children;
|
||||||
for (c = 0; c < children; c++)
|
for (size_t i = 0; i < ARRAY_SIZE(subtypes); ++i)
|
||||||
if ((ret = max_width(zhp, child[c], depth + 2,
|
if (nvlist_lookup_nvlist_array(nv, subtypes[i],
|
||||||
max, name_flags)) > max)
|
&child, &children) == 0)
|
||||||
max = ret;
|
for (uint_t c = 0; c < children; ++c)
|
||||||
}
|
max = MAX(max_width(zhp, child[c], depth + 2,
|
||||||
|
max, name_flags), max);
|
||||||
if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_L2CACHE,
|
|
||||||
&child, &children) == 0) {
|
|
||||||
for (c = 0; c < children; c++)
|
|
||||||
if ((ret = max_width(zhp, child[c], depth + 2,
|
|
||||||
max, name_flags)) > max)
|
|
||||||
max = ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
|
|
||||||
&child, &children) == 0) {
|
|
||||||
for (c = 0; c < children; c++)
|
|
||||||
if ((ret = max_width(zhp, child[c], depth + 2,
|
|
||||||
max, name_flags)) > max)
|
|
||||||
max = ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (max);
|
return (max);
|
||||||
}
|
}
|
||||||
@ -2472,7 +2453,7 @@ print_status_config(zpool_handle_t *zhp, status_cbdata_t *cb, const char *name,
|
|||||||
|
|
||||||
if (vs->vs_scan_removing != 0) {
|
if (vs->vs_scan_removing != 0) {
|
||||||
(void) printf(gettext(" (removing)"));
|
(void) printf(gettext(" (removing)"));
|
||||||
} else if (vs->vs_noalloc != 0) {
|
} else if (VDEV_STAT_VALID(vs_noalloc, vsc) && vs->vs_noalloc != 0) {
|
||||||
(void) printf(gettext(" (non-allocating)"));
|
(void) printf(gettext(" (non-allocating)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6162,7 +6143,7 @@ print_list_stats(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
|
|||||||
* 'toplevel' boolean value is passed to the print_one_column()
|
* 'toplevel' boolean value is passed to the print_one_column()
|
||||||
* to indicate that the value is valid.
|
* to indicate that the value is valid.
|
||||||
*/
|
*/
|
||||||
if (vs->vs_pspace)
|
if (VDEV_STAT_VALID(vs_pspace, c) && vs->vs_pspace)
|
||||||
print_one_column(ZPOOL_PROP_SIZE, vs->vs_pspace, NULL,
|
print_one_column(ZPOOL_PROP_SIZE, vs->vs_pspace, NULL,
|
||||||
scripted, B_TRUE, format);
|
scripted, B_TRUE, format);
|
||||||
else
|
else
|
||||||
@ -10924,7 +10905,7 @@ main(int argc, char **argv)
|
|||||||
* Many commands modify input strings for string parsing reasons.
|
* Many commands modify input strings for string parsing reasons.
|
||||||
* We create a copy to protect the original argv.
|
* We create a copy to protect the original argv.
|
||||||
*/
|
*/
|
||||||
newargv = malloc((argc + 1) * sizeof (newargv[0]));
|
newargv = safe_malloc((argc + 1) * sizeof (newargv[0]));
|
||||||
for (i = 0; i < argc; i++)
|
for (i = 0; i < argc; i++)
|
||||||
newargv[i] = strdup(argv[i]);
|
newargv[i] = strdup(argv[i]);
|
||||||
newargv[argc] = NULL;
|
newargv[argc] = NULL;
|
||||||
|
@ -1 +0,0 @@
|
|||||||
/zpool_influxdb
|
|
@ -1,13 +1,10 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
zfsexec_PROGRAMS += zpool_influxdb
|
||||||
|
CPPCHECKTARGETS += zpool_influxdb
|
||||||
zfsexec_PROGRAMS = zpool_influxdb
|
|
||||||
|
|
||||||
zpool_influxdb_SOURCES = \
|
zpool_influxdb_SOURCES = \
|
||||||
zpool_influxdb.c
|
%D%/zpool_influxdb.c
|
||||||
|
|
||||||
zpool_influxdb_LDADD = \
|
zpool_influxdb_LDADD = \
|
||||||
$(top_builddir)/lib/libspl/libspl.la \
|
libspl.la \
|
||||||
$(top_builddir)/lib/libnvpair/libnvpair.la \
|
libnvpair.la \
|
||||||
$(top_builddir)/lib/libzfs/libzfs.la
|
libzfs.la
|
||||||
|
|
||||||
include $(top_srcdir)/config/CppCheck.am
|
|
||||||
|
1
sys/contrib/openzfs/cmd/zstream/.gitignore
vendored
1
sys/contrib/openzfs/cmd/zstream/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
zstream
|
|
@ -1,20 +1,18 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
sbin_PROGRAMS += zstream
|
||||||
|
CPPCHECKTARGETS += zstream
|
||||||
sbin_PROGRAMS = zstream
|
|
||||||
|
|
||||||
zstream_SOURCES = \
|
zstream_SOURCES = \
|
||||||
zstream.c \
|
%D%/zstream.c \
|
||||||
zstream.h \
|
%D%/zstream.h \
|
||||||
zstream_dump.c \
|
%D%/zstream_dump.c \
|
||||||
zstream_redup.c \
|
%D%/zstream_redup.c \
|
||||||
zstream_token.c
|
%D%/zstream_token.c
|
||||||
|
|
||||||
zstream_LDADD = \
|
zstream_LDADD = \
|
||||||
$(abs_top_builddir)/lib/libzfs/libzfs.la \
|
libzfs.la \
|
||||||
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
libzfs_core.la \
|
||||||
$(abs_top_builddir)/lib/libnvpair/libnvpair.la
|
libnvpair.la
|
||||||
|
|
||||||
include $(top_srcdir)/config/CppCheck.am
|
|
||||||
|
|
||||||
|
PHONY += install-exec-hook
|
||||||
install-exec-hook:
|
install-exec-hook:
|
||||||
cd $(DESTDIR)$(sbindir) && $(LN_S) -f zstream zstreamdump
|
cd $(DESTDIR)$(sbindir) && $(LN_S) -f zstream zstreamdump
|
||||||
|
@ -929,8 +929,7 @@ process_options(int argc, char **argv)
|
|||||||
|
|
||||||
int opt;
|
int opt;
|
||||||
uint64_t value;
|
uint64_t value;
|
||||||
char altdir[MAXNAMELEN] = { 0 };
|
const char *raid_kind = "random";
|
||||||
char raid_kind[8] = "random";
|
|
||||||
|
|
||||||
memcpy(zo, &ztest_opts_defaults, sizeof (*zo));
|
memcpy(zo, &ztest_opts_defaults, sizeof (*zo));
|
||||||
|
|
||||||
@ -978,7 +977,7 @@ process_options(int argc, char **argv)
|
|||||||
zo->zo_raid_parity = MIN(MAX(value, 1), 3);
|
zo->zo_raid_parity = MIN(MAX(value, 1), 3);
|
||||||
break;
|
break;
|
||||||
case 'K':
|
case 'K':
|
||||||
(void) strlcpy(raid_kind, optarg, sizeof (raid_kind));
|
raid_kind = optarg;
|
||||||
break;
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
zo->zo_draid_data = MAX(1, value);
|
zo->zo_draid_data = MAX(1, value);
|
||||||
@ -1037,7 +1036,8 @@ process_options(int argc, char **argv)
|
|||||||
zo->zo_maxloops = MAX(1, value);
|
zo->zo_maxloops = MAX(1, value);
|
||||||
break;
|
break;
|
||||||
case 'B':
|
case 'B':
|
||||||
(void) strlcpy(altdir, optarg, sizeof (altdir));
|
(void) strlcpy(zo->zo_alt_ztest, optarg,
|
||||||
|
sizeof (zo->zo_alt_ztest));
|
||||||
break;
|
break;
|
||||||
case 'C':
|
case 'C':
|
||||||
ztest_parse_name_value(optarg, zo);
|
ztest_parse_name_value(optarg, zo);
|
||||||
@ -1076,8 +1076,7 @@ process_options(int argc, char **argv)
|
|||||||
|
|
||||||
/* When raid choice is 'random' add a draid pool 50% of the time */
|
/* When raid choice is 'random' add a draid pool 50% of the time */
|
||||||
if (strcmp(raid_kind, "random") == 0) {
|
if (strcmp(raid_kind, "random") == 0) {
|
||||||
(void) strlcpy(raid_kind, (ztest_random(2) == 0) ?
|
raid_kind = (ztest_random(2) == 0) ? "draid" : "raidz";
|
||||||
"draid" : "raidz", sizeof (raid_kind));
|
|
||||||
|
|
||||||
if (ztest_opts.zo_verbose >= 3)
|
if (ztest_opts.zo_verbose >= 3)
|
||||||
(void) printf("choosing RAID type '%s'\n", raid_kind);
|
(void) printf("choosing RAID type '%s'\n", raid_kind);
|
||||||
@ -1127,51 +1126,28 @@ process_options(int argc, char **argv)
|
|||||||
(zo->zo_vdevs > 0 ? zo->zo_time * NANOSEC / zo->zo_vdevs :
|
(zo->zo_vdevs > 0 ? zo->zo_time * NANOSEC / zo->zo_vdevs :
|
||||||
UINT64_MAX >> 2);
|
UINT64_MAX >> 2);
|
||||||
|
|
||||||
if (strlen(altdir) > 0) {
|
if (*zo->zo_alt_ztest) {
|
||||||
char *cmd;
|
const char *invalid_what = "ztest";
|
||||||
char *realaltdir;
|
char *val = zo->zo_alt_ztest;
|
||||||
char *bin;
|
if (0 != access(val, X_OK) ||
|
||||||
char *ztest;
|
(strrchr(val, '/') == NULL && (errno = EINVAL)))
|
||||||
char *isa;
|
goto invalid;
|
||||||
int isalen;
|
|
||||||
|
|
||||||
cmd = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
|
int dirlen = strrchr(val, '/') - val;
|
||||||
realaltdir = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
|
strncpy(zo->zo_alt_libpath, val, dirlen);
|
||||||
|
invalid_what = "library path", val = zo->zo_alt_libpath;
|
||||||
|
if (strrchr(val, '/') == NULL && (errno = EINVAL))
|
||||||
|
goto invalid;
|
||||||
|
*strrchr(val, '/') = '\0';
|
||||||
|
strlcat(val, "/lib", sizeof (zo->zo_alt_libpath));
|
||||||
|
|
||||||
VERIFY3P(NULL, !=, realpath(getexecname(), cmd));
|
if (0 != access(zo->zo_alt_libpath, X_OK))
|
||||||
if (0 != access(altdir, F_OK)) {
|
goto invalid;
|
||||||
|
return;
|
||||||
|
|
||||||
|
invalid:
|
||||||
ztest_dump_core = B_FALSE;
|
ztest_dump_core = B_FALSE;
|
||||||
fatal(B_TRUE, "invalid alternate ztest path: %s",
|
fatal(B_TRUE, "invalid alternate %s %s", invalid_what, val);
|
||||||
altdir);
|
|
||||||
}
|
|
||||||
VERIFY3P(NULL, !=, realpath(altdir, realaltdir));
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 'cmd' should be of the form "<anything>/usr/bin/<isa>/ztest".
|
|
||||||
* We want to extract <isa> to determine if we should use
|
|
||||||
* 32 or 64 bit binaries.
|
|
||||||
*/
|
|
||||||
bin = strstr(cmd, "/usr/bin/");
|
|
||||||
ztest = strstr(bin, "/ztest");
|
|
||||||
isa = bin + 9;
|
|
||||||
isalen = ztest - isa;
|
|
||||||
(void) snprintf(zo->zo_alt_ztest, sizeof (zo->zo_alt_ztest),
|
|
||||||
"%s/usr/bin/%.*s/ztest", realaltdir, isalen, isa);
|
|
||||||
(void) snprintf(zo->zo_alt_libpath, sizeof (zo->zo_alt_libpath),
|
|
||||||
"%s/usr/lib/%.*s", realaltdir, isalen, isa);
|
|
||||||
|
|
||||||
if (0 != access(zo->zo_alt_ztest, X_OK)) {
|
|
||||||
ztest_dump_core = B_FALSE;
|
|
||||||
fatal(B_TRUE, "invalid alternate ztest: %s",
|
|
||||||
zo->zo_alt_ztest);
|
|
||||||
} else if (0 != access(zo->zo_alt_libpath, X_OK)) {
|
|
||||||
ztest_dump_core = B_FALSE;
|
|
||||||
fatal(B_TRUE, "invalid alternate lib directory %s",
|
|
||||||
zo->zo_alt_libpath);
|
|
||||||
}
|
|
||||||
|
|
||||||
umem_free(cmd, MAXPATHLEN);
|
|
||||||
umem_free(realaltdir, MAXPATHLEN);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1182,14 +1158,14 @@ ztest_kill(ztest_shared_t *zs)
|
|||||||
zs->zs_space = metaslab_class_get_space(spa_normal_class(ztest_spa));
|
zs->zs_space = metaslab_class_get_space(spa_normal_class(ztest_spa));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Before we kill off ztest, make sure that the config is updated.
|
* Before we kill ourselves, make sure that the config is updated.
|
||||||
* See comment above spa_write_cachefile().
|
* See comment above spa_write_cachefile().
|
||||||
*/
|
*/
|
||||||
mutex_enter(&spa_namespace_lock);
|
mutex_enter(&spa_namespace_lock);
|
||||||
spa_write_cachefile(ztest_spa, B_FALSE, B_FALSE);
|
spa_write_cachefile(ztest_spa, B_FALSE, B_FALSE);
|
||||||
mutex_exit(&spa_namespace_lock);
|
mutex_exit(&spa_namespace_lock);
|
||||||
|
|
||||||
(void) kill(getpid(), SIGKILL);
|
(void) raise(SIGKILL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -6626,22 +6602,22 @@ ztest_get_zdb_bin(char *bin, int len)
|
|||||||
{
|
{
|
||||||
char *zdb_path;
|
char *zdb_path;
|
||||||
/*
|
/*
|
||||||
* Try to use ZDB_PATH and in-tree zdb path. If not successful, just
|
* Try to use $ZDB and in-tree zdb path. If not successful, just
|
||||||
* let popen to search through PATH.
|
* let popen to search through PATH.
|
||||||
*/
|
*/
|
||||||
if ((zdb_path = getenv("ZDB_PATH"))) {
|
if ((zdb_path = getenv("ZDB"))) {
|
||||||
strlcpy(bin, zdb_path, len); /* In env */
|
strlcpy(bin, zdb_path, len); /* In env */
|
||||||
if (!ztest_check_path(bin)) {
|
if (!ztest_check_path(bin)) {
|
||||||
ztest_dump_core = 0;
|
ztest_dump_core = 0;
|
||||||
fatal(B_TRUE, "invalid ZDB_PATH '%s'", bin);
|
fatal(B_TRUE, "invalid ZDB '%s'", bin);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VERIFY3P(realpath(getexecname(), bin), !=, NULL);
|
VERIFY3P(realpath(getexecname(), bin), !=, NULL);
|
||||||
if (strstr(bin, "/ztest/")) {
|
if (strstr(bin, ".libs/ztest")) {
|
||||||
strstr(bin, "/ztest/")[0] = '\0'; /* In-tree */
|
strstr(bin, ".libs/ztest")[0] = '\0'; /* In-tree */
|
||||||
strcat(bin, "/zdb/zdb");
|
strcat(bin, "zdb");
|
||||||
if (ztest_check_path(bin))
|
if (ztest_check_path(bin))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -6858,7 +6834,7 @@ ztest_run_zdb(char *pool)
|
|||||||
free(set_gvars_args_joined);
|
free(set_gvars_args_joined);
|
||||||
|
|
||||||
if (ztest_opts.zo_verbose >= 5)
|
if (ztest_opts.zo_verbose >= 5)
|
||||||
(void) printf("Executing %s\n", strstr(zdb, "zdb "));
|
(void) printf("Executing %s\n", zdb);
|
||||||
|
|
||||||
fp = popen(zdb, "r");
|
fp = popen(zdb, "r");
|
||||||
|
|
||||||
@ -7888,21 +7864,24 @@ exec_child(char *cmd, char *libpath, boolean_t ignorekill, int *statusp)
|
|||||||
fatal(B_TRUE, "fork failed");
|
fatal(B_TRUE, "fork failed");
|
||||||
|
|
||||||
if (pid == 0) { /* child */
|
if (pid == 0) { /* child */
|
||||||
char *emptyargv[2] = { cmd, NULL };
|
|
||||||
char fd_data_str[12];
|
char fd_data_str[12];
|
||||||
|
|
||||||
struct rlimit rl = { 1024, 1024 };
|
|
||||||
(void) setrlimit(RLIMIT_NOFILE, &rl);
|
|
||||||
|
|
||||||
(void) close(ztest_fd_rand);
|
|
||||||
VERIFY3S(11, >=,
|
VERIFY3S(11, >=,
|
||||||
snprintf(fd_data_str, 12, "%d", ztest_fd_data));
|
snprintf(fd_data_str, 12, "%d", ztest_fd_data));
|
||||||
VERIFY0(setenv("ZTEST_FD_DATA", fd_data_str, 1));
|
VERIFY0(setenv("ZTEST_FD_DATA", fd_data_str, 1));
|
||||||
|
|
||||||
(void) enable_extended_FILE_stdio(-1, -1);
|
if (libpath != NULL) {
|
||||||
if (libpath != NULL)
|
const char *curlp = getenv("LD_LIBRARY_PATH");
|
||||||
|
if (curlp == NULL)
|
||||||
VERIFY0(setenv("LD_LIBRARY_PATH", libpath, 1));
|
VERIFY0(setenv("LD_LIBRARY_PATH", libpath, 1));
|
||||||
(void) execv(cmd, emptyargv);
|
else {
|
||||||
|
char *newlp = NULL;
|
||||||
|
VERIFY3S(-1, !=,
|
||||||
|
asprintf(&newlp, "%s:%s", libpath, curlp));
|
||||||
|
VERIFY0(setenv("LD_LIBRARY_PATH", newlp, 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(void) execl(cmd, cmd, (char *)NULL);
|
||||||
ztest_dump_core = B_FALSE;
|
ztest_dump_core = B_FALSE;
|
||||||
fatal(B_TRUE, "exec failed: %s", cmd);
|
fatal(B_TRUE, "exec failed: %s", cmd);
|
||||||
}
|
}
|
||||||
@ -8033,7 +8012,7 @@ main(int argc, char **argv)
|
|||||||
* ztest from needlessly depleting the system entropy pool.
|
* ztest from needlessly depleting the system entropy pool.
|
||||||
*/
|
*/
|
||||||
random_path = "/dev/urandom";
|
random_path = "/dev/urandom";
|
||||||
ztest_fd_rand = open(random_path, O_RDONLY);
|
ztest_fd_rand = open(random_path, O_RDONLY | O_CLOEXEC);
|
||||||
ASSERT3S(ztest_fd_rand, >=, 0);
|
ASSERT3S(ztest_fd_rand, >=, 0);
|
||||||
|
|
||||||
if (!fd_data_str) {
|
if (!fd_data_str) {
|
1
sys/contrib/openzfs/cmd/ztest/.gitignore
vendored
1
sys/contrib/openzfs/cmd/ztest/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/ztest
|
|
@ -1,25 +0,0 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
|
||||||
|
|
||||||
# Get rid of compiler warning for unchecked truncating snprintfs on gcc 7.1.1
|
|
||||||
AM_CFLAGS += $(NO_FORMAT_TRUNCATION)
|
|
||||||
|
|
||||||
# Includes kernel code, generate warnings for large stack frames
|
|
||||||
AM_CFLAGS += $(FRAME_LARGER_THAN)
|
|
||||||
|
|
||||||
# Unconditionally enable ASSERTs
|
|
||||||
AM_CPPFLAGS += -DDEBUG -UNDEBUG -DZFS_DEBUG
|
|
||||||
|
|
||||||
sbin_PROGRAMS = ztest
|
|
||||||
|
|
||||||
ztest_SOURCES = \
|
|
||||||
ztest.c
|
|
||||||
|
|
||||||
ztest_LDADD = \
|
|
||||||
$(abs_top_builddir)/lib/libzpool/libzpool.la \
|
|
||||||
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
|
||||||
$(abs_top_builddir)/lib/libnvpair/libnvpair.la
|
|
||||||
|
|
||||||
ztest_LDADD += -lm
|
|
||||||
ztest_LDFLAGS = -pthread
|
|
||||||
|
|
||||||
include $(top_srcdir)/config/CppCheck.am
|
|
1
sys/contrib/openzfs/cmd/zvol_id/.gitignore
vendored
1
sys/contrib/openzfs/cmd/zvol_id/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
zvol_id
|
|
@ -1,12 +0,0 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
|
||||||
|
|
||||||
# Disable GCC stack protection for zvol_id. This is a kludge and should be
|
|
||||||
# removed once https://github.com/openzfs/zfs/issues/569 is resolved.
|
|
||||||
AM_CFLAGS += -fno-stack-protector
|
|
||||||
|
|
||||||
udev_PROGRAMS = zvol_id
|
|
||||||
|
|
||||||
zvol_id_SOURCES = \
|
|
||||||
zvol_id_main.c
|
|
||||||
|
|
||||||
include $(top_srcdir)/config/CppCheck.am
|
|
@ -1,129 +0,0 @@
|
|||||||
/*
|
|
||||||
* CDDL HEADER START
|
|
||||||
*
|
|
||||||
* 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]
|
|
||||||
*
|
|
||||||
* CDDL HEADER END
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2011, Fajar A. Nugraha. All rights reserved.
|
|
||||||
* Use is subject to license terms.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <linux/ioctl.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <sys/zfs_znode.h>
|
|
||||||
#include <sys/fs/zfs.h>
|
|
||||||
|
|
||||||
#if defined(ZFS_ASAN_ENABLED)
|
|
||||||
/*
|
|
||||||
* zvol_id is invoked by udev with the help of ptrace()
|
|
||||||
* making sanitized binary with leak detection croak
|
|
||||||
* because of tracing mechanisms collision
|
|
||||||
*/
|
|
||||||
extern const char *__asan_default_options(void);
|
|
||||||
|
|
||||||
const char *__asan_default_options(void) {
|
|
||||||
return ("abort_on_error=true:halt_on_error=true:"
|
|
||||||
"allocator_may_return_null=true:disable_coredump=false:"
|
|
||||||
"detect_stack_use_after_return=true:detect_leaks=false");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int
|
|
||||||
ioctl_get_msg(char *var, int fd)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
char msg[ZFS_MAX_DATASET_NAME_LEN];
|
|
||||||
|
|
||||||
ret = ioctl(fd, BLKZNAME, msg);
|
|
||||||
if (ret < 0) {
|
|
||||||
return (ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
snprintf(var, ZFS_MAX_DATASET_NAME_LEN, "%s", msg);
|
|
||||||
return (ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
main(int argc, char **argv)
|
|
||||||
{
|
|
||||||
int fd = -1, ret = 0, status = EXIT_FAILURE;
|
|
||||||
char zvol_name[ZFS_MAX_DATASET_NAME_LEN];
|
|
||||||
char *zvol_name_part = NULL;
|
|
||||||
char *dev_name;
|
|
||||||
struct stat64 statbuf;
|
|
||||||
int dev_minor, dev_part;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (argc < 2) {
|
|
||||||
fprintf(stderr, "Usage: %s /dev/zvol_device_node\n", argv[0]);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
dev_name = argv[1];
|
|
||||||
ret = stat64(dev_name, &statbuf);
|
|
||||||
if (ret != 0) {
|
|
||||||
fprintf(stderr, "Unable to access device file: %s\n", dev_name);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
dev_minor = minor(statbuf.st_rdev);
|
|
||||||
dev_part = dev_minor % ZVOL_MINORS;
|
|
||||||
|
|
||||||
fd = open(dev_name, O_RDONLY);
|
|
||||||
if (fd < 0) {
|
|
||||||
fprintf(stderr, "Unable to open device file: %s\n", dev_name);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = ioctl_get_msg(zvol_name, fd);
|
|
||||||
if (ret < 0) {
|
|
||||||
fprintf(stderr, "ioctl_get_msg failed: %s\n", strerror(errno));
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
if (dev_part > 0)
|
|
||||||
ret = asprintf(&zvol_name_part, "%s-part%d", zvol_name,
|
|
||||||
dev_part);
|
|
||||||
else
|
|
||||||
ret = asprintf(&zvol_name_part, "%s", zvol_name);
|
|
||||||
|
|
||||||
if (ret == -1 || zvol_name_part == NULL)
|
|
||||||
goto fail;
|
|
||||||
|
|
||||||
for (i = 0; i < strlen(zvol_name_part); i++) {
|
|
||||||
if (isblank(zvol_name_part[i]))
|
|
||||||
zvol_name_part[i] = '+';
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("%s\n", zvol_name_part);
|
|
||||||
status = EXIT_SUCCESS;
|
|
||||||
|
|
||||||
fail:
|
|
||||||
if (zvol_name_part)
|
|
||||||
free(zvol_name_part);
|
|
||||||
if (fd >= 0)
|
|
||||||
close(fd);
|
|
||||||
|
|
||||||
return (status);
|
|
||||||
}
|
|
@ -28,15 +28,17 @@ filter_out_deleted_zvols() {
|
|||||||
list_zvols() {
|
list_zvols() {
|
||||||
read -r default_volmode < /sys/module/zfs/parameters/zvol_volmode
|
read -r default_volmode < /sys/module/zfs/parameters/zvol_volmode
|
||||||
zfs list -t volume -H -o \
|
zfs list -t volume -H -o \
|
||||||
name,volmode,receive_resume_token,redact_snaps |
|
name,volmode,receive_resume_token,redact_snaps,keystatus |
|
||||||
while IFS=" " read -r name volmode token redacted; do # IFS=\t here!
|
while IFS=" " read -r name volmode token redacted keystatus; do # IFS=\t here!
|
||||||
|
|
||||||
# /dev links are not created for zvols with volmode = "none"
|
# /dev links are not created for zvols with volmode = "none",
|
||||||
# or for redacted zvols.
|
# redacted zvols, or encrypted zvols for which the key has not
|
||||||
|
# been loaded.
|
||||||
[ "$volmode" = "none" ] && continue
|
[ "$volmode" = "none" ] && continue
|
||||||
[ "$volmode" = "default" ] && [ "$default_volmode" = "3" ] &&
|
[ "$volmode" = "default" ] && [ "$default_volmode" = "3" ] &&
|
||||||
continue
|
continue
|
||||||
[ "$redacted" = "-" ] || continue
|
[ "$redacted" = "-" ] || continue
|
||||||
|
[ "$keystatus" = "unavailable" ] && continue
|
||||||
|
|
||||||
# We also ignore partially received zvols if it is
|
# We also ignore partially received zvols if it is
|
||||||
# not an incremental receive, as those won't even have a block
|
# not an incremental receive, as those won't even have a block
|
@ -1,4 +0,0 @@
|
|||||||
include $(top_srcdir)/config/Shellcheck.am
|
|
||||||
|
|
||||||
dist_bin_SCRIPTS = zvol_wait
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
|||||||
#
|
|
||||||
# When performing an ABI check the following options are applied:
|
|
||||||
#
|
|
||||||
# --no-unreferenced-symbols: Exclude symbols which are not referenced by
|
|
||||||
# any debug information. Without this _init() and _fini() are incorrectly
|
|
||||||
# reported on CentOS7 for libuutil.so.
|
|
||||||
#
|
|
||||||
# --headers-dir1: Limit ABI checks to public OpenZFS headers, otherwise
|
|
||||||
# changes in public system headers are also reported.
|
|
||||||
#
|
|
||||||
# --suppressions: Honor a suppressions file for each library to provide
|
|
||||||
# a mechanism for suppressing harmless warnings.
|
|
||||||
#
|
|
||||||
|
|
||||||
PHONY += checkabi storeabi check_libabi_version allow_libabi_only_for_x86_64
|
|
||||||
|
|
||||||
check_libabi_version:
|
|
||||||
libabiversion=`abidw -v | $(SED) 's/[^0-9]//g'`; \
|
|
||||||
if test $$libabiversion -lt "200"; then \
|
|
||||||
/bin/echo -e "\n" \
|
|
||||||
"*** Please use libabigail 2.0.0 version or newer;\n" \
|
|
||||||
"*** otherwise results are not consistent!\n" \
|
|
||||||
"(or see https://github.com/openzfs/libabigail-docker )\n"; \
|
|
||||||
exit 1; \
|
|
||||||
fi;
|
|
||||||
|
|
||||||
allow_libabi_only_for_x86_64:
|
|
||||||
echo '*** ABI definitions provided apply only to x86_64 architecture'
|
|
||||||
echo '*** Skipping `checkabi`/`storeabi` target and assuming success.'
|
|
||||||
|
|
||||||
if TARGET_CPU_X86_64
|
|
||||||
checkabi: check_libabi_version
|
|
||||||
for lib in $(lib_LTLIBRARIES) ; do \
|
|
||||||
abidiff --no-unreferenced-symbols \
|
|
||||||
--headers-dir1 ../../include \
|
|
||||||
--suppressions $${lib%.la}.suppr \
|
|
||||||
$${lib%.la}.abi .libs/$${lib%.la}.so ; \
|
|
||||||
done
|
|
||||||
|
|
||||||
storeabi: check_libabi_version
|
|
||||||
cd .libs ; \
|
|
||||||
for lib in $(lib_LTLIBRARIES) ; do \
|
|
||||||
abidw --no-show-locs \
|
|
||||||
--no-corpus-path \
|
|
||||||
--no-comp-dir-path \
|
|
||||||
--type-id-style hash \
|
|
||||||
$${lib%.la}.so > ../$${lib%.la}.abi ; \
|
|
||||||
done
|
|
||||||
else
|
|
||||||
checkabi: allow_libabi_only_for_x86_64
|
|
||||||
storeabi: allow_libabi_only_for_x86_64
|
|
||||||
endif
|
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Default rules for running cppcheck against the user space components.
|
# cppcheck for userspace – nodist_*_SOURCES are kernel code and cppcheck goes crazy on them.
|
||||||
#
|
#
|
||||||
|
|
||||||
PHONY += cppcheck
|
PHONY += cppcheck
|
||||||
@ -7,5 +7,15 @@ PHONY += cppcheck
|
|||||||
CPPCHECKFLAGS = --std=c99 --quiet --max-configs=1 --error-exitcode=2
|
CPPCHECKFLAGS = --std=c99 --quiet --max-configs=1 --error-exitcode=2
|
||||||
CPPCHECKFLAGS += --inline-suppr -U_KERNEL
|
CPPCHECKFLAGS += --inline-suppr -U_KERNEL
|
||||||
|
|
||||||
cppcheck:
|
CPPCHECKDIRS =
|
||||||
$(CPPCHECK) -j$(CPU_COUNT) $(CPPCHECKFLAGS) $(DEFAULT_INCLUDES) $(SOURCES)
|
CPPCHECKTARGETS =
|
||||||
|
|
||||||
|
cppcheck-recursive-%:
|
||||||
|
$(MAKE) -C $(subst cppcheck-recursive-,,$@) cppcheck
|
||||||
|
|
||||||
|
_CTGT = $(subst cppcheck-for-,,$@)
|
||||||
|
cppcheck-for-%:
|
||||||
|
@[ -n "$($(_CTGT)_SOURCES)$(dist_$(_CTGT)_SOURCES)" ]
|
||||||
|
$(CPPCHECK) -j$(CPU_COUNT) $(CPPCHECKFLAGS) $(patsubst -U%,,$(patsubst -D%,,$(filter-out $(AM_CPPFLAGS_NOCHECK),$(or $($(_CTGT)_CPPFLAGS),$(AM_CPPFLAGS))))) $($(_CTGT)_SOURCES) $(dist_$(_CTGT)_SOURCES)
|
||||||
|
|
||||||
|
cppcheck: $(addprefix cppcheck-for-,$(subst -,_,$(subst .,_,$(subst /,_,$(CPPCHECKTARGETS))))) $(addprefix cppcheck-recursive-,$(CPPCHECKDIRS))
|
||||||
|
@ -4,22 +4,13 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
PHONY =
|
PHONY =
|
||||||
DEFAULT_INCLUDES = \
|
AM_CPPFLAGS = \
|
||||||
-include $(top_builddir)/zfs_config.h \
|
-include $(top_builddir)/zfs_config.h \
|
||||||
-I$(top_builddir)/include \
|
-I$(top_builddir)/include \
|
||||||
-I$(top_srcdir)/include \
|
-I$(top_srcdir)/include \
|
||||||
-I$(top_srcdir)/module/icp/include \
|
-I$(top_srcdir)/module/icp/include \
|
||||||
-I$(top_srcdir)/lib/libspl/include
|
-I$(top_srcdir)/lib/libspl/include \
|
||||||
|
-I$(top_srcdir)/lib/libspl/include/os/@ac_system_l@
|
||||||
if BUILD_LINUX
|
|
||||||
DEFAULT_INCLUDES += \
|
|
||||||
-I$(top_srcdir)/lib/libspl/include/os/linux
|
|
||||||
endif
|
|
||||||
|
|
||||||
if BUILD_FREEBSD
|
|
||||||
DEFAULT_INCLUDES += \
|
|
||||||
-I$(top_srcdir)/lib/libspl/include/os/freebsd
|
|
||||||
endif
|
|
||||||
|
|
||||||
AM_LIBTOOLFLAGS = --silent
|
AM_LIBTOOLFLAGS = --silent
|
||||||
|
|
||||||
@ -37,7 +28,7 @@ AM_CFLAGS += -include $(top_srcdir)/include/os/freebsd/spl/sys/ccompile.h
|
|||||||
AM_CFLAGS += -I/usr/include -I/usr/local/include
|
AM_CFLAGS += -I/usr/include -I/usr/local/include
|
||||||
endif
|
endif
|
||||||
|
|
||||||
AM_CPPFLAGS = -D_GNU_SOURCE
|
AM_CPPFLAGS += -D_GNU_SOURCE
|
||||||
AM_CPPFLAGS += -D_REENTRANT
|
AM_CPPFLAGS += -D_REENTRANT
|
||||||
AM_CPPFLAGS += -D_FILE_OFFSET_BITS=64
|
AM_CPPFLAGS += -D_FILE_OFFSET_BITS=64
|
||||||
AM_CPPFLAGS += -D_LARGEFILE64_SOURCE
|
AM_CPPFLAGS += -D_LARGEFILE64_SOURCE
|
||||||
@ -48,19 +39,20 @@ AM_CPPFLAGS += -DSYSCONFDIR=\"$(sysconfdir)\"
|
|||||||
AM_CPPFLAGS += -DPKGDATADIR=\"$(pkgdatadir)\"
|
AM_CPPFLAGS += -DPKGDATADIR=\"$(pkgdatadir)\"
|
||||||
AM_CPPFLAGS += $(DEBUG_CPPFLAGS)
|
AM_CPPFLAGS += $(DEBUG_CPPFLAGS)
|
||||||
AM_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
|
AM_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
|
||||||
if BUILD_LINUX
|
AM_CPPFLAGS += -DTEXT_DOMAIN=\"zfs-@ac_system_l@-user\"
|
||||||
AM_CPPFLAGS += -DTEXT_DOMAIN=\"zfs-linux-user\"
|
|
||||||
endif
|
AM_CPPFLAGS_NOCHECK = -D"strtok(...)=strtok(__VA_ARGS__) __attribute__((deprecated(\"Use strtok_r(3) instead!\")))"
|
||||||
if BUILD_FREEBSD
|
AM_CPPFLAGS_NOCHECK += -D"__xpg_basename(...)=__xpg_basename(__VA_ARGS__) __attribute__((deprecated(\"basename(3) is underspecified. Use zfs_basename() instead!\")))"
|
||||||
AM_CPPFLAGS += -DTEXT_DOMAIN=\"zfs-freebsd-user\"
|
AM_CPPFLAGS_NOCHECK += -D"basename(...)=basename(__VA_ARGS__) __attribute__((deprecated(\"basename(3) is underspecified. Use zfs_basename() instead!\")))"
|
||||||
endif
|
AM_CPPFLAGS_NOCHECK += -D"dirname(...)=dirname(__VA_ARGS__) __attribute__((deprecated(\"dirname(3) is underspecified. Use zfs_dirnamelen() instead!\")))"
|
||||||
AM_CPPFLAGS += -D"strtok(...)=strtok(__VA_ARGS__) __attribute__((deprecated(\"Use strtok_r(3) instead!\")))"
|
AM_CPPFLAGS_NOCHECK += -D"bcopy(...)=__attribute__((deprecated(\"bcopy(3) is deprecated. Use memcpy(3)/memmove(3) instead!\"))) bcopy(__VA_ARGS__)"
|
||||||
AM_CPPFLAGS += -D"__xpg_basename(...)=__xpg_basename(__VA_ARGS__) __attribute__((deprecated(\"basename(3) is underspecified. Use zfs_basename() instead!\")))"
|
AM_CPPFLAGS_NOCHECK += -D"bcmp(...)=__attribute__((deprecated(\"bcmp(3) is deprecated. Use memcmp(3) instead!\"))) bcmp(__VA_ARGS__)"
|
||||||
AM_CPPFLAGS += -D"basename(...)=basename(__VA_ARGS__) __attribute__((deprecated(\"basename(3) is underspecified. Use zfs_basename() instead!\")))"
|
AM_CPPFLAGS_NOCHECK += -D"bzero(...)=__attribute__((deprecated(\"bzero(3) is deprecated. Use memset(3) instead!\"))) bzero(__VA_ARGS__)"
|
||||||
AM_CPPFLAGS += -D"dirname(...)=dirname(__VA_ARGS__) __attribute__((deprecated(\"dirname(3) is underspecified. Use zfs_dirnamelen() instead!\")))"
|
AM_CPPFLAGS_NOCHECK += -D"asctime(...)=__attribute__((deprecated(\"Use strftime(3) instead!\"))) asctime(__VA_ARGS__)"
|
||||||
AM_CPPFLAGS += -D"bcopy(...)=__attribute__((deprecated(\"bcopy(3) is deprecated. Use memcpy(3)/memmove(3) instead!\"))) bcopy(__VA_ARGS__)"
|
AM_CPPFLAGS_NOCHECK += -D"asctime_r(...)=__attribute__((deprecated(\"Use strftime(3) instead!\"))) asctime_r(__VA_ARGS__)"
|
||||||
AM_CPPFLAGS += -D"bcmp(...)=__attribute__((deprecated(\"bcmp(3) is deprecated. Use memcmp(3) instead!\"))) bcmp(__VA_ARGS__)"
|
AM_CPPFLAGS_NOCHECK += -D"gmtime(...)=__attribute__((deprecated(\"gmtime(3) isn't thread-safe. Use gmtime_r(3) instead!\"))) gmtime(__VA_ARGS__)"
|
||||||
AM_CPPFLAGS += -D"bzero(...)=__attribute__((deprecated(\"bzero(3) is deprecated. Use memset(3) instead!\"))) bzero(__VA_ARGS__)"
|
AM_CPPFLAGS_NOCHECK += -D"localtime(...)=__attribute__((deprecated(\"localtime(3) isn't thread-safe. Use localtime_r(3) instead!\"))) localtime(__VA_ARGS__)"
|
||||||
|
AM_CPPFLAGS += $(AM_CPPFLAGS_NOCHECK)
|
||||||
|
|
||||||
if ASAN_ENABLED
|
if ASAN_ENABLED
|
||||||
AM_CPPFLAGS += -DZFS_ASAN_ENABLED
|
AM_CPPFLAGS += -DZFS_ASAN_ENABLED
|
||||||
@ -79,3 +71,13 @@ AM_LDFLAGS += -fstack-protector-strong -shared
|
|||||||
AM_LDFLAGS += -Wl,-x -Wl,--fatal-warnings -Wl,--warn-shared-textrel
|
AM_LDFLAGS += -Wl,-x -Wl,--fatal-warnings -Wl,--warn-shared-textrel
|
||||||
AM_LDFLAGS += -lm
|
AM_LDFLAGS += -lm
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
# If a target includes kernel code, generate warnings for large stack frames
|
||||||
|
KERNEL_CFLAGS = $(FRAME_LARGER_THAN)
|
||||||
|
|
||||||
|
# See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54020
|
||||||
|
LIBRARY_CFLAGS = -no-suppress
|
||||||
|
|
||||||
|
# Forcibly enable asserts/debugging for libzpool &al.
|
||||||
|
FORCEDEBUG_CPPFLAGS = -DDEBUG -UNDEBUG -DZFS_DEBUG
|
||||||
|
@ -1,30 +1,40 @@
|
|||||||
.PHONY: shellcheck
|
# Global ShellCheck exclusions:
|
||||||
shellcheck: $(SCRIPTS) $(SHELLCHECKSCRIPTS)
|
|
||||||
|
|
||||||
# ShellCheck exclusions
|
|
||||||
#
|
#
|
||||||
# ShellCheck can't follow non-constant source. Use a directive to specify location. [SC1090]
|
# ShellCheck can't follow non-constant source. Use a directive to specify location. [SC1090]
|
||||||
# Not following: a was not specified as input (see shellcheck -x). [SC1091]
|
# Not following: a was not specified as input (see shellcheck -x). [SC1091]
|
||||||
# Prefer putting braces around variable references even when not strictly required. [SC2250]
|
# Prefer putting braces around variable references even when not strictly required. [SC2250]
|
||||||
# In POSIX sh, 'local' is undefined. [SC2039] # older ShellCheck versions
|
# In POSIX sh, 'local' is undefined. [SC2039] # older ShellCheck versions
|
||||||
# In POSIX sh, 'local' is undefined. [SC3043] # newer ShellCheck versions
|
# In POSIX sh, 'local' is undefined. [SC3043] # newer ShellCheck versions
|
||||||
if HAVE_SHELLCHECK
|
|
||||||
[ -z "$(SCRIPTS)$(SHELLCHECKSCRIPTS)" ] && exit; shellcheck --format=gcc --enable=all --exclude=SC1090,SC1091,SC2039,SC2250,SC3043 $$([ -n "$(SHELLCHECK_SHELL)" ] && echo "--shell=$(SHELLCHECK_SHELL)") $(SHELLCHECK_OPTS) $(SCRIPTS) $(SHELLCHECKSCRIPTS)
|
|
||||||
else
|
|
||||||
@[ -z "$(SCRIPTS)$(SHELLCHECKSCRIPTS)" ] && exit; echo "skipping shellcheck of" $(SCRIPTS) $(SHELLCHECKSCRIPTS) "because shellcheck is not installed"
|
|
||||||
endif
|
|
||||||
@set -e; for dir in $(SHELLCHECKDIRS); do $(MAKE) -C $$dir shellcheck; done
|
|
||||||
|
|
||||||
|
SHELLCHECKSCRIPTS =
|
||||||
|
|
||||||
|
JUST_SHELLCHECK_OPTS = $(addprefix shellcheck-here-,$(subst /,^,$(1)))
|
||||||
|
JUST_CHECKBASHISMS_OPTS = $(addprefix checkbashisms-here-,$(subst /,^,$(1)))
|
||||||
|
SHELLCHECK_OPTS = $(call JUST_SHELLCHECK_OPTS,$(1)) $(call JUST_CHECKBASHISMS_OPTS,$(1))
|
||||||
|
|
||||||
|
PHONY += shellcheck
|
||||||
|
|
||||||
|
_STGT = $(subst ^,/,$(subst shellcheck-here-,,$@))
|
||||||
|
shellcheck-here-%:
|
||||||
|
if HAVE_SHELLCHECK
|
||||||
|
shellcheck --format=gcc --enable=all --exclude=SC1090,SC1091,SC2039,SC2250,SC3043 $$([ -n "$(SHELLCHECK_SHELL)" ] && echo "--shell=$(SHELLCHECK_SHELL)") "$$([ -e "$(_STGT)" ] || echo "$(srcdir)/")$(_STGT)"
|
||||||
|
else
|
||||||
|
@echo "skipping shellcheck of" $(_STGT) "because shellcheck is not installed"
|
||||||
|
endif
|
||||||
|
|
||||||
|
shellcheck: $(SHELLCHECKSCRIPTS) $(call JUST_SHELLCHECK_OPTS,$(SHELLCHECKSCRIPTS))
|
||||||
|
|
||||||
|
|
||||||
|
PHONY += checkbashisms
|
||||||
|
|
||||||
# command -v *is* specified by POSIX and every shell in existence supports it
|
# command -v *is* specified by POSIX and every shell in existence supports it
|
||||||
.PHONY: checkbashisms
|
_BTGT = $(subst ^,/,$(subst checkbashisms-here-,,$@))
|
||||||
checkbashisms: $(SCRIPTS) $(SHELLCHECKSCRIPTS)
|
checkbashisms-here-%:
|
||||||
if HAVE_CHECKBASHISMS
|
if HAVE_CHECKBASHISMS
|
||||||
[ -z "$(SCRIPTS)$(SHELLCHECKSCRIPTS)" ] && exit; ! if [ -z "$(SHELLCHECK_SHELL)" ]; then \
|
! { [ -n "$(SHELLCHECK_SHELL)" ] && echo '#!/bin/$(SHELLCHECK_SHELL)'; cat "$$([ -e "$(_BTGT)" ] || echo "$(srcdir)/")$(_BTGT)"; } | \
|
||||||
checkbashisms -npx $(SCRIPTS) $(SHELLCHECKSCRIPTS); else \
|
checkbashisms -npx 2>&1 | grep -vFe "'command' with option other than -p" -e 'command -v' -e 'any possible bashisms' $(CHECKBASHISMS_IGNORE) >&2
|
||||||
for f in $(SCRIPTS) $(SHELLCHECKSCRIPTS); do echo $$f >&3; { echo '#!/bin/$(SHELLCHECK_SHELL)'; cat $$f; } | checkbashisms -npx; done; \
|
|
||||||
fi 3>&2 2>&1 | grep -vFe "'command' with option other than -p" -e 'command -v' $(CHECKBASHISMS_IGNORE) >&2
|
|
||||||
else
|
else
|
||||||
@[ -z "$(SCRIPTS)$(SHELLCHECKSCRIPTS)" ] && exit; echo "skipping checkbashisms of" $(SCRIPTS) $(SHELLCHECKSCRIPTS) "because checkbashisms is not installed"
|
@echo "skipping checkbashisms of" $(_BTGT) "because checkbashisms is not installed"
|
||||||
endif
|
endif
|
||||||
@set -e; for dir in $(SHELLCHECKDIRS); do $(MAKE) -C $$dir checkbashisms; done
|
|
||||||
|
checkbashisms: $(SHELLCHECKSCRIPTS) $(call JUST_CHECKBASHISMS_OPTS,$(SHELLCHECKSCRIPTS))
|
||||||
|
@ -1,38 +1,46 @@
|
|||||||
subst_sed_cmd = \
|
subst_sed_cmd = \
|
||||||
|
-e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \
|
||||||
-e 's|@bindir[@]|$(bindir)|g' \
|
-e 's|@bindir[@]|$(bindir)|g' \
|
||||||
-e 's|@sbindir[@]|$(sbindir)|g' \
|
|
||||||
-e 's|@datadir[@]|$(datadir)|g' \
|
-e 's|@datadir[@]|$(datadir)|g' \
|
||||||
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
|
|
||||||
-e 's|@runstatedir[@]|$(runstatedir)|g' \
|
|
||||||
-e 's|@initconfdir[@]|$(initconfdir)|g' \
|
-e 's|@initconfdir[@]|$(initconfdir)|g' \
|
||||||
-e 's|@initdir[@]|$(initdir)|g' \
|
-e 's|@initdir[@]|$(initdir)|g' \
|
||||||
-e 's|@mounthelperdir[@]|$(mounthelperdir)|g' \
|
-e 's|@mounthelperdir[@]|$(mounthelperdir)|g' \
|
||||||
|
-e 's|@pammoduledir[@]|$(pammoduledir)|g' \
|
||||||
|
-e 's|@runstatedir[@]|$(runstatedir)|g' \
|
||||||
|
-e 's|@sbindir[@]|$(sbindir)|g' \
|
||||||
|
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
|
||||||
-e 's|@systemdgeneratordir[@]|$(systemdgeneratordir)|g' \
|
-e 's|@systemdgeneratordir[@]|$(systemdgeneratordir)|g' \
|
||||||
-e 's|@systemdunitdir[@]|$(systemdunitdir)|g' \
|
-e 's|@systemdunitdir[@]|$(systemdunitdir)|g' \
|
||||||
-e 's|@udevdir[@]|$(udevdir)|g' \
|
-e 's|@udevdir[@]|$(udevdir)|g' \
|
||||||
-e 's|@udevruledir[@]|$(udevruledir)|g' \
|
-e 's|@udevruledir[@]|$(udevruledir)|g' \
|
||||||
-e 's|@zfsexecdir[@]|$(zfsexecdir)|g' \
|
-e 's|@zfsexecdir[@]|$(zfsexecdir)|g' \
|
||||||
-e 's|@PYTHON[@]|$(PYTHON)|g' \
|
\
|
||||||
-e 's|@PYTHON_SHEBANG[@]|$(PYTHON_SHEBANG)|g' \
|
-e 's|@ASAN_ENABLED[@]|$(ASAN_ENABLED)|g' \
|
||||||
-e 's|@DEFAULT_INIT_NFS_SERVER[@]|$(DEFAULT_INIT_NFS_SERVER)|g' \
|
-e 's|@DEFAULT_INIT_NFS_SERVER[@]|$(DEFAULT_INIT_NFS_SERVER)|g' \
|
||||||
-e 's|@DEFAULT_INIT_SHELL[@]|$(DEFAULT_INIT_SHELL)|g' \
|
-e 's|@DEFAULT_INIT_SHELL[@]|$(DEFAULT_INIT_SHELL)|g' \
|
||||||
-e 's|@LIBFETCH_DYNAMIC[@]|$(LIBFETCH_DYNAMIC)|g' \
|
-e 's|@LIBFETCH_DYNAMIC[@]|$(LIBFETCH_DYNAMIC)|g' \
|
||||||
-e 's|@LIBFETCH_SONAME[@]|$(LIBFETCH_SONAME)|g' \
|
-e 's|@LIBFETCH_SONAME[@]|$(LIBFETCH_SONAME)|g' \
|
||||||
-e 's|@ASAN_ENABLED[@]|$(ASAN_ENABLED)|g' \
|
-e 's|@PYTHON[@]|$(PYTHON)|g' \
|
||||||
-e 's|@UBSAN_ENABLED[@]|$(UBSAN_ENABLED)|g'
|
-e 's|@PYTHON_SHEBANG[@]|$(PYTHON_SHEBANG)|g' \
|
||||||
|
-e 's|@UBSAN_ENABLED[@]|$(UBSAN_ENABLED)|g' \
|
||||||
|
-e 's|@VERSION[@]|$(VERSION)|g'
|
||||||
|
|
||||||
SUBSTFILES =
|
define SUBST
|
||||||
CLEANFILES = $(SUBSTFILES)
|
$(1) : $(2)$(1).in Makefile;
|
||||||
EXTRA_DIST = $(SUBSTFILES:=.in)
|
$$(AM_V_GEN)set -e; \
|
||||||
|
$$(MKDIR_P) $$(@D); \
|
||||||
$(SUBSTFILES):%:%.in Makefile
|
$$(RM) $$@~; \
|
||||||
$(AM_V_GEN)set -e; \
|
$$(SED) $$(subst_sed_cmd) $$< >$$@~; \
|
||||||
$(MKDIR_P) $$(dirname $@); \
|
if grep -E '@[a-zA-Z0-9_]+@' $$@~ >&2; then \
|
||||||
$(RM) $@~; \
|
|
||||||
$(SED) $(subst_sed_cmd) $< >$@~; \
|
|
||||||
if grep -E '@[a-zA-Z0-9_]+@' $@~ >&2; then \
|
|
||||||
echo "Undefined substitution" >&2; \
|
echo "Undefined substitution" >&2; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
else test $$? -eq 1; fi; \
|
fi; \
|
||||||
test -x $< && chmod +x $@~; \
|
[ -x $$< ] && chmod +x $$@~; \
|
||||||
mv -f $@~ $@
|
mv -f $$@~ $$@
|
||||||
|
endef
|
||||||
|
|
||||||
|
SUBSTFILES =
|
||||||
|
CLEANFILES += $(SUBSTFILES)
|
||||||
|
EXTRA_DIST += $(SUBSTFILES:=.in)
|
||||||
|
|
||||||
|
$(call SUBST,%,)
|
||||||
|
@ -3,4 +3,7 @@ dnl # Check if cppcheck is available.
|
|||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CPPCHECK], [
|
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CPPCHECK], [
|
||||||
AC_CHECK_PROG([CPPCHECK], [cppcheck], [cppcheck])
|
AC_CHECK_PROG([CPPCHECK], [cppcheck], [cppcheck])
|
||||||
|
if test -z "$CPPCHECK"; then
|
||||||
|
CPPCHECK='@printf "skipping cppcheck because cppcheck is not installed\n"'
|
||||||
|
fi
|
||||||
])
|
])
|
||||||
|
@ -8,18 +8,22 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_SYSTEM], [
|
|||||||
AC_DEFINE([SYSTEM_LINUX], [1],
|
AC_DEFINE([SYSTEM_LINUX], [1],
|
||||||
[True if ZFS is to be compiled for a Linux system])
|
[True if ZFS is to be compiled for a Linux system])
|
||||||
ac_system="Linux"
|
ac_system="Linux"
|
||||||
|
ac_system_l="linux"
|
||||||
;;
|
;;
|
||||||
*freebsd*)
|
*freebsd*)
|
||||||
AC_DEFINE([SYSTEM_FREEBSD], [1],
|
AC_DEFINE([SYSTEM_FREEBSD], [1],
|
||||||
[True if ZFS is to be compiled for a FreeBSD system])
|
[True if ZFS is to be compiled for a FreeBSD system])
|
||||||
ac_system="FreeBSD"
|
ac_system="FreeBSD"
|
||||||
|
ac_system_l="freebsd"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
ac_system="unknown"
|
ac_system="unknown"
|
||||||
|
ac_system_l="unknown"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
AC_MSG_RESULT([$ac_system])
|
AC_MSG_RESULT([$ac_system])
|
||||||
AC_SUBST([ac_system])
|
AC_SUBST([ac_system])
|
||||||
|
AC_SUBST([ac_system_l])
|
||||||
|
|
||||||
AM_CONDITIONAL([BUILD_LINUX], [test "x$ac_system" = "xLinux"])
|
AM_CONDITIONAL([BUILD_LINUX], [test "x$ac_system" = "xLinux"])
|
||||||
AM_CONDITIONAL([BUILD_FREEBSD], [test "x$ac_system" = "xFreeBSD"])
|
AM_CONDITIONAL([BUILD_FREEBSD], [test "x$ac_system" = "xFreeBSD"])
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
# Remove default preprocessor define's from config.h
|
|
||||||
# PACKAGE
|
|
||||||
# PACKAGE_BUGREPORT
|
|
||||||
# PACKAGE_NAME
|
|
||||||
# PACKAGE_STRING
|
|
||||||
# PACKAGE_TARNAME
|
|
||||||
# PACKAGE_VERSION
|
|
||||||
# STDC_HEADERS
|
|
||||||
# VERSION
|
|
||||||
|
|
||||||
BEGIN { RS = "" ; FS = "\n" } \
|
|
||||||
!/.#define PACKAGE./ && \
|
|
||||||
!/.#define VERSION./ && \
|
|
||||||
!/.#define STDC_HEADERS./ \
|
|
||||||
{ print $0"\n" }
|
|
@ -61,8 +61,8 @@ deb-utils: deb-local rpm-utils-initramfs
|
|||||||
pkg7=$${name}-test-$${version}.$${arch}.rpm; \
|
pkg7=$${name}-test-$${version}.$${arch}.rpm; \
|
||||||
pkg8=$${name}-dracut-$${version}.noarch.rpm; \
|
pkg8=$${name}-dracut-$${version}.noarch.rpm; \
|
||||||
pkg9=$${name}-initramfs-$${version}.$${arch}.rpm; \
|
pkg9=$${name}-initramfs-$${version}.$${arch}.rpm; \
|
||||||
pkg10=`ls python*-pyzfs-$${version}* | tail -1`; \
|
pkg10=`ls python3-pyzfs-$${version}.noarch.rpm 2>/dev/null`; \
|
||||||
pkg11=pam_zfs_key-$${version}.$${arch}.rpm; \
|
pkg11=`ls pam_zfs_key-$${version}.$${arch}.rpm 2>/dev/null`; \
|
||||||
## Arguments need to be passed to dh_shlibdeps. Alien provides no mechanism
|
## Arguments need to be passed to dh_shlibdeps. Alien provides no mechanism
|
||||||
## to do this, so we install a shim onto the path which calls the real
|
## to do this, so we install a shim onto the path which calls the real
|
||||||
## dh_shlibdeps with the required arguments.
|
## dh_shlibdeps with the required arguments.
|
||||||
|
@ -93,8 +93,10 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_DISCARD], [
|
|||||||
ZFS_LINUX_TEST_SRC([blk_queue_discard], [
|
ZFS_LINUX_TEST_SRC([blk_queue_discard], [
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
struct request_queue *q __attribute__ ((unused)) = NULL;
|
struct request_queue r;
|
||||||
|
struct request_queue *q = &r;
|
||||||
int value __attribute__ ((unused));
|
int value __attribute__ ((unused));
|
||||||
|
memset(q, 0, sizeof(r));
|
||||||
value = blk_queue_discard(q);
|
value = blk_queue_discard(q);
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
@ -119,16 +121,20 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_SECURE_ERASE], [
|
|||||||
ZFS_LINUX_TEST_SRC([blk_queue_secure_erase], [
|
ZFS_LINUX_TEST_SRC([blk_queue_secure_erase], [
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
struct request_queue *q __attribute__ ((unused)) = NULL;
|
struct request_queue r;
|
||||||
|
struct request_queue *q = &r;
|
||||||
int value __attribute__ ((unused));
|
int value __attribute__ ((unused));
|
||||||
|
memset(q, 0, sizeof(r));
|
||||||
value = blk_queue_secure_erase(q);
|
value = blk_queue_secure_erase(q);
|
||||||
])
|
])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([blk_queue_secdiscard], [
|
ZFS_LINUX_TEST_SRC([blk_queue_secdiscard], [
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
struct request_queue *q __attribute__ ((unused)) = NULL;
|
struct request_queue r;
|
||||||
|
struct request_queue *q = &r;
|
||||||
int value __attribute__ ((unused));
|
int value __attribute__ ((unused));
|
||||||
|
memset(q, 0, sizeof(r));
|
||||||
value = blk_queue_secdiscard(q);
|
value = blk_queue_secdiscard(q);
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
@ -19,19 +19,48 @@ AC_DEFUN([ZFS_AC_KERNEL_CONFIG_DEFINED], [
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
ZFS_AC_KERNEL_SRC_CONFIG_MODULES
|
||||||
|
ZFS_AC_KERNEL_SRC_CONFIG_BLOCK
|
||||||
ZFS_AC_KERNEL_SRC_CONFIG_DEBUG_LOCK_ALLOC
|
ZFS_AC_KERNEL_SRC_CONFIG_DEBUG_LOCK_ALLOC
|
||||||
ZFS_AC_KERNEL_SRC_CONFIG_TRIM_UNUSED_KSYMS
|
ZFS_AC_KERNEL_SRC_CONFIG_TRIM_UNUSED_KSYMS
|
||||||
ZFS_AC_KERNEL_SRC_CONFIG_ZLIB_INFLATE
|
|
||||||
ZFS_AC_KERNEL_SRC_CONFIG_ZLIB_DEFLATE
|
ZFS_AC_KERNEL_SRC_CONFIG_ZLIB_DEFLATE
|
||||||
|
ZFS_AC_KERNEL_SRC_CONFIG_ZLIB_INFLATE
|
||||||
|
|
||||||
AC_MSG_CHECKING([for kernel config option compatibility])
|
AC_MSG_CHECKING([for kernel config option compatibility])
|
||||||
ZFS_LINUX_TEST_COMPILE_ALL([config])
|
ZFS_LINUX_TEST_COMPILE_ALL([config])
|
||||||
AC_MSG_RESULT([done])
|
AC_MSG_RESULT([done])
|
||||||
|
|
||||||
|
ZFS_AC_KERNEL_CONFIG_MODULES
|
||||||
|
ZFS_AC_KERNEL_CONFIG_BLOCK
|
||||||
ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC
|
ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC
|
||||||
ZFS_AC_KERNEL_CONFIG_TRIM_UNUSED_KSYMS
|
ZFS_AC_KERNEL_CONFIG_TRIM_UNUSED_KSYMS
|
||||||
ZFS_AC_KERNEL_CONFIG_ZLIB_INFLATE
|
|
||||||
ZFS_AC_KERNEL_CONFIG_ZLIB_DEFLATE
|
ZFS_AC_KERNEL_CONFIG_ZLIB_DEFLATE
|
||||||
|
ZFS_AC_KERNEL_CONFIG_ZLIB_INFLATE
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Check CONFIG_BLOCK
|
||||||
|
dnl #
|
||||||
|
dnl # Verify the kernel has CONFIG_BLOCK support enabled.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_CONFIG_BLOCK], [
|
||||||
|
ZFS_LINUX_TEST_SRC([config_block], [
|
||||||
|
#if !defined(CONFIG_BLOCK)
|
||||||
|
#error CONFIG_BLOCK not defined
|
||||||
|
#endif
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_BLOCK], [
|
||||||
|
AC_MSG_CHECKING([whether CONFIG_BLOCK is defined])
|
||||||
|
ZFS_LINUX_TEST_RESULT([config_block], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
AC_MSG_ERROR([
|
||||||
|
*** This kernel does not include the required block device support.
|
||||||
|
*** Rebuild the kernel with CONFIG_BLOCK=y set.])
|
||||||
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
@ -72,6 +101,61 @@ AC_DEFUN([ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC], [
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Check CONFIG_MODULES
|
||||||
|
dnl #
|
||||||
|
dnl # Verify the kernel has CONFIG_MODULES support enabled.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_CONFIG_MODULES], [
|
||||||
|
ZFS_LINUX_TEST_SRC([config_modules], [
|
||||||
|
#if !defined(CONFIG_MODULES)
|
||||||
|
#error CONFIG_MODULES not defined
|
||||||
|
#endif
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_MODULES], [
|
||||||
|
AC_MSG_CHECKING([whether CONFIG_MODULES is defined])
|
||||||
|
AS_IF([test "x$enable_linux_builtin" != xyes], [
|
||||||
|
ZFS_LINUX_TEST_RESULT([config_modules], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
AC_MSG_ERROR([
|
||||||
|
*** This kernel does not include the required loadable module
|
||||||
|
*** support!
|
||||||
|
***
|
||||||
|
*** To build OpenZFS as a loadable Linux kernel module
|
||||||
|
*** enable loadable module support by setting
|
||||||
|
*** `CONFIG_MODULES=y` in the kernel configuration and run
|
||||||
|
*** `make modules_prepare` in the Linux source tree.
|
||||||
|
***
|
||||||
|
*** If you don't intend to enable loadable kernel module
|
||||||
|
*** support, please compile OpenZFS as a Linux kernel built-in.
|
||||||
|
***
|
||||||
|
*** Prepare the Linux source tree by running `make prepare`,
|
||||||
|
*** use the OpenZFS `--enable-linux-builtin` configure option,
|
||||||
|
*** copy the OpenZFS sources into the Linux source tree using
|
||||||
|
*** `./copy-builtin <linux source directory>`,
|
||||||
|
*** set `CONFIG_ZFS=y` in the kernel configuration and compile
|
||||||
|
*** kernel as usual.
|
||||||
|
])
|
||||||
|
])
|
||||||
|
], [
|
||||||
|
ZFS_LINUX_TRY_COMPILE([], [], [
|
||||||
|
AC_MSG_RESULT([not needed])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([error])
|
||||||
|
AC_MSG_ERROR([
|
||||||
|
*** This kernel is unable to compile object files.
|
||||||
|
***
|
||||||
|
*** Please make sure you prepared the Linux source tree
|
||||||
|
*** by running `make prepare` there.
|
||||||
|
])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # Check CONFIG_TRIM_UNUSED_KSYMS
|
dnl # Check CONFIG_TRIM_UNUSED_KSYMS
|
||||||
dnl #
|
dnl #
|
||||||
|
29
sys/contrib/openzfs/config/kernel-copy-from-user-inatomic.m4
Normal file
29
sys/contrib/openzfs/config/kernel-copy-from-user-inatomic.m4
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # On certain architectures `__copy_from_user_inatomic`
|
||||||
|
dnl # is a GPL exported variable and cannot be used by OpenZFS.
|
||||||
|
dnl #
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Checking if `__copy_from_user_inatomic` is available.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC___COPY_FROM_USER_INATOMIC], [
|
||||||
|
ZFS_LINUX_TEST_SRC([__copy_from_user_inatomic], [
|
||||||
|
#include <linux/uaccess.h>
|
||||||
|
], [
|
||||||
|
int result __attribute__ ((unused)) = __copy_from_user_inatomic(NULL, NULL, 0);
|
||||||
|
], [], [ZFS_META_LICENSE])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL___COPY_FROM_USER_INATOMIC], [
|
||||||
|
AC_MSG_CHECKING([whether __copy_from_user_inatomic is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([__copy_from_user_inatomic_license], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
AC_MSG_ERROR([
|
||||||
|
*** The `__copy_from_user_inatomic()` Linux kernel function is
|
||||||
|
*** incompatible with the CDDL license and will prevent the module
|
||||||
|
*** linking stage from succeeding. OpenZFS cannot be compiled.
|
||||||
|
])
|
||||||
|
])
|
||||||
|
])
|
58
sys/contrib/openzfs/config/kernel-genhd-flags.m4
Normal file
58
sys/contrib/openzfs/config/kernel-genhd-flags.m4
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # 5.17 API change,
|
||||||
|
dnl #
|
||||||
|
dnl # GENHD_FL_EXT_DEVT flag removed
|
||||||
|
dnl # GENHD_FL_NO_PART_SCAN renamed GENHD_FL_NO_PART
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_GENHD_FLAGS], [
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([genhd_fl_ext_devt], [
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
], [
|
||||||
|
int flags __attribute__ ((unused)) = GENHD_FL_EXT_DEVT;
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([genhd_fl_no_part], [
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
], [
|
||||||
|
int flags __attribute__ ((unused)) = GENHD_FL_NO_PART;
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([genhd_fl_no_part_scan], [
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
], [
|
||||||
|
int flags __attribute__ ((unused)) = GENHD_FL_NO_PART_SCAN;
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_GENHD_FLAGS], [
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether GENHD_FL_EXT_DEVT flag is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([genhd_fl_ext_devt], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(ZFS_GENHD_FL_EXT_DEVT, GENHD_FL_EXT_DEVT,
|
||||||
|
[GENHD_FL_EXT_DEVT flag is available])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
AC_DEFINE(ZFS_GENHD_FL_EXT_DEVT, 0,
|
||||||
|
[GENHD_FL_EXT_DEVT flag is not available])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether GENHD_FL_NO_PART flag is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([genhd_fl_no_part], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(ZFS_GENHD_FL_NO_PART, GENHD_FL_NO_PART,
|
||||||
|
[GENHD_FL_NO_PART flag is available])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether GENHD_FL_NO_PART_SCAN flag is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([genhd_fl_no_part_scan], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(ZFS_GENHD_FL_NO_PART, GENHD_FL_NO_PART_SCAN,
|
||||||
|
[GENHD_FL_NO_PART_SCAN flag is available])
|
||||||
|
], [
|
||||||
|
ZFS_LINUX_TEST_ERROR([GENHD_FL_NO_PART|GENHD_FL_NO_PART_SCAN])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
])
|
@ -55,7 +55,7 @@ dnl #
|
|||||||
AC_DEFUN([ZFS_AC_KERNEL_ENUM_MEMBER], [
|
AC_DEFUN([ZFS_AC_KERNEL_ENUM_MEMBER], [
|
||||||
AC_MSG_CHECKING([whether enum $2 contains $1])
|
AC_MSG_CHECKING([whether enum $2 contains $1])
|
||||||
AS_IF([AC_TRY_COMMAND(
|
AS_IF([AC_TRY_COMMAND(
|
||||||
"${srcdir}/scripts/enum-extract.pl" "$2" "$3" | egrep -qx $1)],[
|
"${srcdir}/scripts/enum-extract.pl" "$2" "$3" | grep -Eqx $1)],[
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
AC_DEFINE(m4_join([_], [ZFS_ENUM], m4_toupper($2), $1), 1,
|
AC_DEFINE(m4_join([_], [ZFS_ENUM], m4_toupper($2), $1), 1,
|
||||||
[enum $2 contains $1])
|
[enum $2 contains $1])
|
||||||
|
@ -6,8 +6,8 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GROUP_INFO_GID], [
|
|||||||
ZFS_LINUX_TEST_SRC([group_info_gid], [
|
ZFS_LINUX_TEST_SRC([group_info_gid], [
|
||||||
#include <linux/cred.h>
|
#include <linux/cred.h>
|
||||||
],[
|
],[
|
||||||
struct group_info *gi = groups_alloc(1);
|
struct group_info gi __attribute__ ((unused)) = {};
|
||||||
gi->gid[0] = KGIDT_INIT(0);
|
gi.gid[0] = KGIDT_INIT(0);
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
29
sys/contrib/openzfs/config/kernel-inode-permission.m4
Normal file
29
sys/contrib/openzfs/config/kernel-inode-permission.m4
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_PERMISSION], [
|
||||||
|
dnl #
|
||||||
|
dnl # 5.12 API change that added the struct user_namespace* arg
|
||||||
|
dnl # to the front of this function type's arg list.
|
||||||
|
dnl #
|
||||||
|
ZFS_LINUX_TEST_SRC([permission_userns], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/sched.h>
|
||||||
|
|
||||||
|
int inode_permission(struct user_namespace *userns,
|
||||||
|
struct inode *inode, int mask) { return 0; }
|
||||||
|
|
||||||
|
static const struct inode_operations
|
||||||
|
iops __attribute__ ((unused)) = {
|
||||||
|
.permission = inode_permission,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_PERMISSION], [
|
||||||
|
AC_MSG_CHECKING([whether iops->permission() takes struct user_namespace*])
|
||||||
|
ZFS_LINUX_TEST_RESULT([permission_userns], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOPS_PERMISSION_USERNS, 1,
|
||||||
|
[iops->permission() takes struct user_namespace*])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
@ -53,6 +53,8 @@ AC_DEFUN([ZFS_AC_KERNEL_MKDIR], [
|
|||||||
AC_DEFINE(HAVE_IOPS_MKDIR_USERNS, 1,
|
AC_DEFINE(HAVE_IOPS_MKDIR_USERNS, 1,
|
||||||
[iops->mkdir() takes struct user_namespace*])
|
[iops->mkdir() takes struct user_namespace*])
|
||||||
],[
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether iops->mkdir() takes umode_t])
|
AC_MSG_CHECKING([whether iops->mkdir() takes umode_t])
|
||||||
ZFS_LINUX_TEST_RESULT([inode_operations_mkdir], [
|
ZFS_LINUX_TEST_RESULT([inode_operations_mkdir], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
|
25
sys/contrib/openzfs/config/kernel-readpages.m4
Normal file
25
sys/contrib/openzfs/config/kernel-readpages.m4
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Linux 5.18 removes address_space_operations ->readpages in favour of
|
||||||
|
dnl # ->readahead
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_READPAGES], [
|
||||||
|
ZFS_LINUX_TEST_SRC([vfs_has_readpages], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
|
||||||
|
static const struct address_space_operations
|
||||||
|
aops __attribute__ ((unused)) = {
|
||||||
|
.readpages = NULL,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_VFS_READPAGES], [
|
||||||
|
AC_MSG_CHECKING([address_space_operations->readpages exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([vfs_has_readpages], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE(HAVE_VFS_READPAGES, 1,
|
||||||
|
[address_space_operations->readpages exists])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
|
])
|
37
sys/contrib/openzfs/config/kernel-sysfs.m4
Normal file
37
sys/contrib/openzfs/config/kernel-sysfs.m4
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Linux 5.2/5.18 API
|
||||||
|
dnl #
|
||||||
|
dnl # In cdb4f26a63c391317e335e6e683a614358e70aeb ("kobject: kobj_type: remove default_attrs")
|
||||||
|
dnl # struct kobj_type.default_attrs
|
||||||
|
dnl # was finally removed in favour of
|
||||||
|
dnl # struct kobj_type.default_groups
|
||||||
|
dnl #
|
||||||
|
dnl # This was added in aa30f47cf666111f6bbfd15f290a27e8a7b9d854 ("kobject: Add support for default attribute groups to kobj_type"),
|
||||||
|
dnl # if both are present (5.2-5.17), we prefer default_groups; they're otherwise equivalent
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_SYSFS_DEFAULT_GROUPS], [
|
||||||
|
ZFS_LINUX_TEST_SRC([sysfs_default_groups], [
|
||||||
|
#include <linux/kobject.h>
|
||||||
|
],[
|
||||||
|
struct kobj_type __attribute__ ((unused)) kt = {
|
||||||
|
.default_groups = (const struct attribute_group **)NULL };
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SYSFS_DEFAULT_GROUPS], [
|
||||||
|
AC_MSG_CHECKING([for struct kobj_type.default_groups])
|
||||||
|
ZFS_LINUX_TEST_RESULT([sysfs_default_groups],[
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE([HAVE_SYSFS_DEFAULT_GROUPS], 1, [struct kobj_type has default_groups])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_SYSFS], [
|
||||||
|
ZFS_AC_KERNEL_SRC_SYSFS_DEFAULT_GROUPS
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SYSFS], [
|
||||||
|
ZFS_AC_KERNEL_SYSFS_DEFAULT_GROUPS
|
||||||
|
])
|
30
sys/contrib/openzfs/config/kernel-vfs-filemap_dirty_folio.m4
Normal file
30
sys/contrib/openzfs/config/kernel-vfs-filemap_dirty_folio.m4
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Linux 5.18 uses filemap_dirty_folio in lieu of
|
||||||
|
dnl # ___set_page_dirty_nobuffers
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_FILEMAP_DIRTY_FOLIO], [
|
||||||
|
ZFS_LINUX_TEST_SRC([vfs_has_filemap_dirty_folio], [
|
||||||
|
#include <linux/pagemap.h>
|
||||||
|
#include <linux/writeback.h>
|
||||||
|
|
||||||
|
static const struct address_space_operations
|
||||||
|
aops __attribute__ ((unused)) = {
|
||||||
|
.dirty_folio = filemap_dirty_folio,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_VFS_FILEMAP_DIRTY_FOLIO], [
|
||||||
|
dnl #
|
||||||
|
dnl # Linux 5.18 uses filemap_dirty_folio in lieu of
|
||||||
|
dnl # ___set_page_dirty_nobuffers
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([filemap_dirty_folio exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([vfs_has_filemap_dirty_folio], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE(HAVE_VFS_FILEMAP_DIRTY_FOLIO, 1,
|
||||||
|
[filemap_dirty_folio exists])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
|
])
|
@ -8,8 +8,8 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
|
|||||||
ZFS_AC_QAT
|
ZFS_AC_QAT
|
||||||
|
|
||||||
dnl # Sanity checks for module building and CONFIG_* defines
|
dnl # Sanity checks for module building and CONFIG_* defines
|
||||||
ZFS_AC_KERNEL_TEST_MODULE
|
|
||||||
ZFS_AC_KERNEL_CONFIG_DEFINED
|
ZFS_AC_KERNEL_CONFIG_DEFINED
|
||||||
|
ZFS_AC_MODULE_SYMVERS
|
||||||
|
|
||||||
dnl # Sequential ZFS_LINUX_TRY_COMPILE tests
|
dnl # Sequential ZFS_LINUX_TRY_COMPILE tests
|
||||||
ZFS_AC_KERNEL_FPU_HEADER
|
ZFS_AC_KERNEL_FPU_HEADER
|
||||||
@ -61,6 +61,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_BIO
|
ZFS_AC_KERNEL_SRC_BIO
|
||||||
ZFS_AC_KERNEL_SRC_BLKDEV
|
ZFS_AC_KERNEL_SRC_BLKDEV
|
||||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE
|
ZFS_AC_KERNEL_SRC_BLK_QUEUE
|
||||||
|
ZFS_AC_KERNEL_SRC_GENHD_FLAGS
|
||||||
ZFS_AC_KERNEL_SRC_REVALIDATE_DISK
|
ZFS_AC_KERNEL_SRC_REVALIDATE_DISK
|
||||||
ZFS_AC_KERNEL_SRC_GET_DISK_RO
|
ZFS_AC_KERNEL_SRC_GET_DISK_RO
|
||||||
ZFS_AC_KERNEL_SRC_GENERIC_READLINK_GLOBAL
|
ZFS_AC_KERNEL_SRC_GENERIC_READLINK_GLOBAL
|
||||||
@ -82,6 +83,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_MKDIR
|
ZFS_AC_KERNEL_SRC_MKDIR
|
||||||
ZFS_AC_KERNEL_SRC_LOOKUP_FLAGS
|
ZFS_AC_KERNEL_SRC_LOOKUP_FLAGS
|
||||||
ZFS_AC_KERNEL_SRC_CREATE
|
ZFS_AC_KERNEL_SRC_CREATE
|
||||||
|
ZFS_AC_KERNEL_SRC_PERMISSION
|
||||||
ZFS_AC_KERNEL_SRC_GET_LINK
|
ZFS_AC_KERNEL_SRC_GET_LINK
|
||||||
ZFS_AC_KERNEL_SRC_PUT_LINK
|
ZFS_AC_KERNEL_SRC_PUT_LINK
|
||||||
ZFS_AC_KERNEL_SRC_TMPFILE
|
ZFS_AC_KERNEL_SRC_TMPFILE
|
||||||
@ -99,6 +101,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_SET_NLINK
|
ZFS_AC_KERNEL_SRC_SET_NLINK
|
||||||
ZFS_AC_KERNEL_SRC_SGET
|
ZFS_AC_KERNEL_SRC_SGET
|
||||||
ZFS_AC_KERNEL_SRC_LSEEK_EXECUTE
|
ZFS_AC_KERNEL_SRC_LSEEK_EXECUTE
|
||||||
|
ZFS_AC_KERNEL_SRC_VFS_FILEMAP_DIRTY_FOLIO
|
||||||
ZFS_AC_KERNEL_SRC_VFS_GETATTR
|
ZFS_AC_KERNEL_SRC_VFS_GETATTR
|
||||||
ZFS_AC_KERNEL_SRC_VFS_FSYNC_2ARGS
|
ZFS_AC_KERNEL_SRC_VFS_FSYNC_2ARGS
|
||||||
ZFS_AC_KERNEL_SRC_VFS_ITERATE
|
ZFS_AC_KERNEL_SRC_VFS_ITERATE
|
||||||
@ -131,13 +134,16 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_BIO_MAX_SEGS
|
ZFS_AC_KERNEL_SRC_BIO_MAX_SEGS
|
||||||
ZFS_AC_KERNEL_SRC_SIGNAL_STOP
|
ZFS_AC_KERNEL_SRC_SIGNAL_STOP
|
||||||
ZFS_AC_KERNEL_SRC_SIGINFO
|
ZFS_AC_KERNEL_SRC_SIGINFO
|
||||||
|
ZFS_AC_KERNEL_SRC_SYSFS
|
||||||
ZFS_AC_KERNEL_SRC_SET_SPECIAL_STATE
|
ZFS_AC_KERNEL_SRC_SET_SPECIAL_STATE
|
||||||
|
ZFS_AC_KERNEL_SRC_VFS_READPAGES
|
||||||
ZFS_AC_KERNEL_SRC_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
ZFS_AC_KERNEL_SRC_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
||||||
ZFS_AC_KERNEL_SRC_STANDALONE_LINUX_STDARG
|
ZFS_AC_KERNEL_SRC_STANDALONE_LINUX_STDARG
|
||||||
ZFS_AC_KERNEL_SRC_PAGEMAP_FOLIO_WAIT_BIT
|
ZFS_AC_KERNEL_SRC_PAGEMAP_FOLIO_WAIT_BIT
|
||||||
ZFS_AC_KERNEL_SRC_ADD_DISK
|
ZFS_AC_KERNEL_SRC_ADD_DISK
|
||||||
ZFS_AC_KERNEL_SRC_KTHREAD
|
ZFS_AC_KERNEL_SRC_KTHREAD
|
||||||
ZFS_AC_KERNEL_SRC_ZERO_PAGE
|
ZFS_AC_KERNEL_SRC_ZERO_PAGE
|
||||||
|
ZFS_AC_KERNEL_SRC___COPY_FROM_USER_INATOMIC
|
||||||
|
|
||||||
AC_MSG_CHECKING([for available kernel interfaces])
|
AC_MSG_CHECKING([for available kernel interfaces])
|
||||||
ZFS_LINUX_TEST_COMPILE_ALL([kabi])
|
ZFS_LINUX_TEST_COMPILE_ALL([kabi])
|
||||||
@ -172,6 +178,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_BIO
|
ZFS_AC_KERNEL_BIO
|
||||||
ZFS_AC_KERNEL_BLKDEV
|
ZFS_AC_KERNEL_BLKDEV
|
||||||
ZFS_AC_KERNEL_BLK_QUEUE
|
ZFS_AC_KERNEL_BLK_QUEUE
|
||||||
|
ZFS_AC_KERNEL_GENHD_FLAGS
|
||||||
ZFS_AC_KERNEL_REVALIDATE_DISK
|
ZFS_AC_KERNEL_REVALIDATE_DISK
|
||||||
ZFS_AC_KERNEL_GET_DISK_RO
|
ZFS_AC_KERNEL_GET_DISK_RO
|
||||||
ZFS_AC_KERNEL_GENERIC_READLINK_GLOBAL
|
ZFS_AC_KERNEL_GENERIC_READLINK_GLOBAL
|
||||||
@ -193,6 +200,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_MKDIR
|
ZFS_AC_KERNEL_MKDIR
|
||||||
ZFS_AC_KERNEL_LOOKUP_FLAGS
|
ZFS_AC_KERNEL_LOOKUP_FLAGS
|
||||||
ZFS_AC_KERNEL_CREATE
|
ZFS_AC_KERNEL_CREATE
|
||||||
|
ZFS_AC_KERNEL_PERMISSION
|
||||||
ZFS_AC_KERNEL_GET_LINK
|
ZFS_AC_KERNEL_GET_LINK
|
||||||
ZFS_AC_KERNEL_PUT_LINK
|
ZFS_AC_KERNEL_PUT_LINK
|
||||||
ZFS_AC_KERNEL_TMPFILE
|
ZFS_AC_KERNEL_TMPFILE
|
||||||
@ -210,6 +218,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_SET_NLINK
|
ZFS_AC_KERNEL_SET_NLINK
|
||||||
ZFS_AC_KERNEL_SGET
|
ZFS_AC_KERNEL_SGET
|
||||||
ZFS_AC_KERNEL_LSEEK_EXECUTE
|
ZFS_AC_KERNEL_LSEEK_EXECUTE
|
||||||
|
ZFS_AC_KERNEL_VFS_FILEMAP_DIRTY_FOLIO
|
||||||
ZFS_AC_KERNEL_VFS_GETATTR
|
ZFS_AC_KERNEL_VFS_GETATTR
|
||||||
ZFS_AC_KERNEL_VFS_FSYNC_2ARGS
|
ZFS_AC_KERNEL_VFS_FSYNC_2ARGS
|
||||||
ZFS_AC_KERNEL_VFS_ITERATE
|
ZFS_AC_KERNEL_VFS_ITERATE
|
||||||
@ -242,13 +251,16 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_BIO_MAX_SEGS
|
ZFS_AC_KERNEL_BIO_MAX_SEGS
|
||||||
ZFS_AC_KERNEL_SIGNAL_STOP
|
ZFS_AC_KERNEL_SIGNAL_STOP
|
||||||
ZFS_AC_KERNEL_SIGINFO
|
ZFS_AC_KERNEL_SIGINFO
|
||||||
|
ZFS_AC_KERNEL_SYSFS
|
||||||
ZFS_AC_KERNEL_SET_SPECIAL_STATE
|
ZFS_AC_KERNEL_SET_SPECIAL_STATE
|
||||||
|
ZFS_AC_KERNEL_VFS_READPAGES
|
||||||
ZFS_AC_KERNEL_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
ZFS_AC_KERNEL_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
||||||
ZFS_AC_KERNEL_STANDALONE_LINUX_STDARG
|
ZFS_AC_KERNEL_STANDALONE_LINUX_STDARG
|
||||||
ZFS_AC_KERNEL_PAGEMAP_FOLIO_WAIT_BIT
|
ZFS_AC_KERNEL_PAGEMAP_FOLIO_WAIT_BIT
|
||||||
ZFS_AC_KERNEL_ADD_DISK
|
ZFS_AC_KERNEL_ADD_DISK
|
||||||
ZFS_AC_KERNEL_KTHREAD
|
ZFS_AC_KERNEL_KTHREAD
|
||||||
ZFS_AC_KERNEL_ZERO_PAGE
|
ZFS_AC_KERNEL_ZERO_PAGE
|
||||||
|
ZFS_AC_KERNEL___COPY_FROM_USER_INATOMIC
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
@ -392,11 +404,11 @@ AC_DEFUN([ZFS_AC_KERNEL], [
|
|||||||
utsrelease1=$kernelbuild/include/linux/version.h
|
utsrelease1=$kernelbuild/include/linux/version.h
|
||||||
utsrelease2=$kernelbuild/include/linux/utsrelease.h
|
utsrelease2=$kernelbuild/include/linux/utsrelease.h
|
||||||
utsrelease3=$kernelbuild/include/generated/utsrelease.h
|
utsrelease3=$kernelbuild/include/generated/utsrelease.h
|
||||||
AS_IF([test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1], [
|
AS_IF([test -r $utsrelease1 && grep -qF UTS_RELEASE $utsrelease1], [
|
||||||
utsrelease=$utsrelease1
|
utsrelease=$utsrelease1
|
||||||
], [test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2], [
|
], [test -r $utsrelease2 && grep -qF UTS_RELEASE $utsrelease2], [
|
||||||
utsrelease=$utsrelease2
|
utsrelease=$utsrelease2
|
||||||
], [test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3], [
|
], [test -r $utsrelease3 && grep -qF UTS_RELEASE $utsrelease3], [
|
||||||
utsrelease=$utsrelease3
|
utsrelease=$utsrelease3
|
||||||
])
|
])
|
||||||
|
|
||||||
@ -437,8 +449,6 @@ AC_DEFUN([ZFS_AC_KERNEL], [
|
|||||||
AC_SUBST(LINUX)
|
AC_SUBST(LINUX)
|
||||||
AC_SUBST(LINUX_OBJ)
|
AC_SUBST(LINUX_OBJ)
|
||||||
AC_SUBST(LINUX_VERSION)
|
AC_SUBST(LINUX_VERSION)
|
||||||
|
|
||||||
ZFS_AC_MODULE_SYMVERS
|
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
@ -533,27 +543,6 @@ AC_DEFUN([ZFS_AC_QAT], [
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl #
|
|
||||||
dnl # Basic toolchain sanity check.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_TEST_MODULE], [
|
|
||||||
AC_MSG_CHECKING([whether modules can be built])
|
|
||||||
ZFS_LINUX_TRY_COMPILE([], [], [
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
if test "x$enable_linux_builtin" != xyes; then
|
|
||||||
AC_MSG_ERROR([
|
|
||||||
*** Unable to build an empty module.
|
|
||||||
])
|
|
||||||
else
|
|
||||||
AC_MSG_ERROR([
|
|
||||||
*** Unable to build an empty module.
|
|
||||||
*** Please run 'make scripts' inside the kernel source tree.])
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # ZFS_LINUX_CONFTEST_H
|
dnl # ZFS_LINUX_CONFTEST_H
|
||||||
dnl #
|
dnl #
|
||||||
@ -656,8 +645,10 @@ AC_DEFUN([ZFS_LINUX_COMPILE], [
|
|||||||
build kernel modules with LLVM/CLANG toolchain])
|
build kernel modules with LLVM/CLANG toolchain])
|
||||||
AC_TRY_COMMAND([
|
AC_TRY_COMMAND([
|
||||||
KBUILD_MODPOST_NOFINAL="$5" KBUILD_MODPOST_WARN="$6"
|
KBUILD_MODPOST_NOFINAL="$5" KBUILD_MODPOST_WARN="$6"
|
||||||
make modules -k -j$TEST_JOBS ${KERNEL_CC:+CC=$KERNEL_CC} ${KERNEL_LD:+LD=$KERNEL_LD} ${KERNEL_LLVM:+LLVM=$KERNEL_LLVM} -C $LINUX_OBJ $ARCH_UM
|
make modules -k -j$TEST_JOBS ${KERNEL_CC:+CC=$KERNEL_CC}
|
||||||
M=$PWD/$1 >$1/build.log 2>&1])
|
${KERNEL_LD:+LD=$KERNEL_LD} ${KERNEL_LLVM:+LLVM=$KERNEL_LLVM}
|
||||||
|
CONFIG_MODULES=y CFLAGS_MODULE=-DCONFIG_MODULES
|
||||||
|
-C $LINUX_OBJ $ARCH_UM M=$PWD/$1 >$1/build.log 2>&1])
|
||||||
AS_IF([AC_TRY_COMMAND([$2])], [$3], [$4])
|
AS_IF([AC_TRY_COMMAND([$2])], [$3], [$4])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -35,16 +35,15 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_SYSTEMD], [
|
|||||||
AC_MSG_RESULT([$enable_systemd])
|
AC_MSG_RESULT([$enable_systemd])
|
||||||
|
|
||||||
AS_IF([test "x$enable_systemd" = xyes], [
|
AS_IF([test "x$enable_systemd" = xyes], [
|
||||||
ZFS_INIT_SYSTEMD=systemd
|
|
||||||
ZFS_MODULE_LOAD=modules-load.d
|
|
||||||
DEFINE_SYSTEMD='--with systemd --define "_unitdir $(systemdunitdir)" --define "_presetdir $(systemdpresetdir)" --define "_generatordir $(systemdgeneratordir)"'
|
DEFINE_SYSTEMD='--with systemd --define "_unitdir $(systemdunitdir)" --define "_presetdir $(systemdpresetdir)" --define "_generatordir $(systemdgeneratordir)"'
|
||||||
modulesloaddir=$systemdmodulesloaddir
|
modulesloaddir=$systemdmodulesloaddir
|
||||||
],[
|
],[
|
||||||
DEFINE_SYSTEMD='--without systemd'
|
DEFINE_SYSTEMD='--without systemd'
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_SUBST(ZFS_INIT_SYSTEMD)
|
ZFS_INIT_SYSTEMD=$enable_systemd
|
||||||
AC_SUBST(ZFS_MODULE_LOAD)
|
ZFS_WANT_MODULES_LOAD_D=$enable_systemd
|
||||||
|
|
||||||
AC_SUBST(DEFINE_SYSTEMD)
|
AC_SUBST(DEFINE_SYSTEMD)
|
||||||
AC_SUBST(systemdunitdir)
|
AC_SUBST(systemdunitdir)
|
||||||
AC_SUBST(systemdpresetdir)
|
AC_SUBST(systemdpresetdir)
|
||||||
|
@ -4,8 +4,5 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_SYSVINIT], [
|
|||||||
[install SysV init scripts [default: yes]]),
|
[install SysV init scripts [default: yes]]),
|
||||||
[], enable_sysvinit=yes)
|
[], enable_sysvinit=yes)
|
||||||
|
|
||||||
AS_IF([test "x$enable_sysvinit" = xyes],
|
ZFS_INIT_SYSV=$enable_sysvinit
|
||||||
[ZFS_INIT_SYSV=init.d])
|
|
||||||
|
|
||||||
AC_SUBST(ZFS_INIT_SYSV)
|
|
||||||
])
|
])
|
||||||
|
@ -30,19 +30,8 @@ AC_DEFUN([ZFS_AC_CONFIG_USER], [
|
|||||||
ZFS_AC_CONFIG_USER_MAKEDEV_IN_SYSMACROS
|
ZFS_AC_CONFIG_USER_MAKEDEV_IN_SYSMACROS
|
||||||
ZFS_AC_CONFIG_USER_MAKEDEV_IN_MKDEV
|
ZFS_AC_CONFIG_USER_MAKEDEV_IN_MKDEV
|
||||||
ZFS_AC_CONFIG_USER_ZFSEXEC
|
ZFS_AC_CONFIG_USER_ZFSEXEC
|
||||||
ZFS_AC_TEST_FRAMEWORK
|
|
||||||
|
|
||||||
AC_CHECK_FUNCS([issetugid mlockall strlcat strlcpy])
|
AC_CHECK_FUNCS([issetugid mlockall strlcat strlcpy])
|
||||||
])
|
|
||||||
|
|
||||||
dnl #
|
|
||||||
dnl # Setup the environment for the ZFS Test Suite. Currently only
|
|
||||||
dnl # Linux style systems are supported but this infrastructure can
|
|
||||||
dnl # be extended to support other platforms if needed.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_TEST_FRAMEWORK], [
|
|
||||||
ZONENAME="echo global"
|
|
||||||
AC_SUBST(ZONENAME)
|
|
||||||
|
|
||||||
AC_SUBST(RM)
|
AC_SUBST(RM)
|
||||||
])
|
])
|
||||||
|
@ -173,7 +173,7 @@ AC_DEFUN([ZFS_AC_DEBUG_KMEM_TRACKING], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_DEBUG_INVARIANTS_DETECT_FREEBSD], [
|
AC_DEFUN([ZFS_AC_DEBUG_INVARIANTS_DETECT_FREEBSD], [
|
||||||
AS_IF([sysctl -n kern.conftxt | fgrep -qx $'options\tINVARIANTS'],
|
AS_IF([sysctl -n kern.conftxt | grep -Fqx $'options\tINVARIANTS'],
|
||||||
[enable_invariants="yes"],
|
[enable_invariants="yes"],
|
||||||
[enable_invariants="no"])
|
[enable_invariants="no"])
|
||||||
])
|
])
|
||||||
@ -259,6 +259,10 @@ AC_DEFUN([ZFS_AC_CONFIG], [
|
|||||||
AC_SUBST(TEST_JOBS)
|
AC_SUBST(TEST_JOBS)
|
||||||
])
|
])
|
||||||
|
|
||||||
|
ZFS_INIT_SYSV=
|
||||||
|
ZFS_INIT_SYSTEMD=
|
||||||
|
ZFS_WANT_MODULES_LOAD_D=
|
||||||
|
|
||||||
case "$ZFS_CONFIG" in
|
case "$ZFS_CONFIG" in
|
||||||
kernel) ZFS_AC_CONFIG_KERNEL ;;
|
kernel) ZFS_AC_CONFIG_KERNEL ;;
|
||||||
user) ZFS_AC_CONFIG_USER ;;
|
user) ZFS_AC_CONFIG_USER ;;
|
||||||
@ -271,6 +275,10 @@ AC_DEFUN([ZFS_AC_CONFIG], [
|
|||||||
user kernel|user|all|srpm]) ;;
|
user kernel|user|all|srpm]) ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
AM_CONDITIONAL([INIT_SYSV], [test "x$ZFS_INIT_SYSV" = "xyes"])
|
||||||
|
AM_CONDITIONAL([INIT_SYSTEMD], [test "x$ZFS_INIT_SYSTEMD" = "xyes"])
|
||||||
|
AM_CONDITIONAL([WANT_MODULES_LOAD_D], [test "x$ZFS_WANT_MODULES_LOAD_D" = "xyes"])
|
||||||
|
|
||||||
AM_CONDITIONAL([CONFIG_USER],
|
AM_CONDITIONAL([CONFIG_USER],
|
||||||
[test "$ZFS_CONFIG" = user -o "$ZFS_CONFIG" = all])
|
[test "$ZFS_CONFIG" = user -o "$ZFS_CONFIG" = all])
|
||||||
AM_CONDITIONAL([CONFIG_KERNEL],
|
AM_CONDITIONAL([CONFIG_KERNEL],
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Linux port.
|
* This file is part of OpenZFS.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2009 Lawrence Livermore National Security, LLC.
|
* Copyright (c) 2009 Lawrence Livermore National Security, LLC.
|
||||||
* Produced at Lawrence Livermore National Laboratory
|
* Produced at Lawrence Livermore National Laboratory
|
||||||
@ -30,8 +30,8 @@
|
|||||||
* CDDL HEADER END
|
* CDDL HEADER END
|
||||||
*/
|
*/
|
||||||
|
|
||||||
AC_INIT(m4_esyscmd(grep ^Name: META | cut -d ':' -f 2 | tr -d ' \n'),
|
AC_INIT(m4_esyscmd(awk '/^Name:/ {printf $2}' META),
|
||||||
m4_esyscmd(grep ^Version: META | cut -d ':' -f 2 | tr -d ' \n'))
|
m4_esyscmd(awk '/^Version:/ {printf $2}' META))
|
||||||
AC_LANG(C)
|
AC_LANG(C)
|
||||||
ZFS_AC_META
|
ZFS_AC_META
|
||||||
AC_CONFIG_AUX_DIR([config])
|
AC_CONFIG_AUX_DIR([config])
|
||||||
@ -39,11 +39,11 @@ AC_CONFIG_MACRO_DIR([config])
|
|||||||
AC_CANONICAL_TARGET
|
AC_CANONICAL_TARGET
|
||||||
AM_MAINTAINER_MODE
|
AM_MAINTAINER_MODE
|
||||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||||
AM_INIT_AUTOMAKE([subdir-objects])
|
AM_INIT_AUTOMAKE([subdir-objects foreign])
|
||||||
|
# Remove default macros from config.h:
|
||||||
|
# PACKAGE, PACKAGE_{BUGREPORT,NAME,STRING,TARNAME,VERSION}, STDC_HEADERS, VERSION
|
||||||
AC_CONFIG_HEADERS([zfs_config.h], [
|
AC_CONFIG_HEADERS([zfs_config.h], [
|
||||||
(mv zfs_config.h zfs_config.h.tmp &&
|
sed -nEi~ -e '/^$/be' -e 'N;N;/#define (PACKAGE|VERSION|STDC_HEADERS)/d' -e ':e' -e 'p' zfs_config.h && rm zfs_config.h~ || exit])
|
||||||
awk -f ${ac_srcdir}/config/config.awk zfs_config.h.tmp >zfs_config.h &&
|
|
||||||
rm zfs_config.h.tmp) || exit 1])
|
|
||||||
|
|
||||||
LT_INIT
|
LT_INIT
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
@ -66,356 +66,19 @@ ZFS_AC_DEBUG_INVARIANTS
|
|||||||
|
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
Makefile
|
Makefile
|
||||||
cmd/Makefile
|
|
||||||
cmd/arc_summary/Makefile
|
|
||||||
cmd/arcstat/Makefile
|
|
||||||
cmd/dbufstat/Makefile
|
|
||||||
cmd/fsck_zfs/Makefile
|
|
||||||
cmd/mount_zfs/Makefile
|
|
||||||
cmd/raidz_test/Makefile
|
|
||||||
cmd/vdev_id/Makefile
|
|
||||||
cmd/zdb/Makefile
|
|
||||||
cmd/zed/Makefile
|
|
||||||
cmd/zed/zed.d/Makefile
|
|
||||||
cmd/zfs/Makefile
|
|
||||||
cmd/zfs_ids_to_path/Makefile
|
|
||||||
cmd/zgenhostid/Makefile
|
|
||||||
cmd/zhack/Makefile
|
|
||||||
cmd/zinject/Makefile
|
|
||||||
cmd/zpool/Makefile
|
|
||||||
cmd/zstream/Makefile
|
|
||||||
cmd/ztest/Makefile
|
|
||||||
cmd/zvol_id/Makefile
|
|
||||||
cmd/zvol_wait/Makefile
|
|
||||||
cmd/zpool_influxdb/Makefile
|
|
||||||
contrib/Makefile
|
|
||||||
contrib/bash_completion.d/Makefile
|
|
||||||
contrib/bpftrace/Makefile
|
|
||||||
contrib/dracut/02zfsexpandknowledge/Makefile
|
|
||||||
contrib/dracut/90zfs/Makefile
|
|
||||||
contrib/dracut/Makefile
|
|
||||||
contrib/initramfs/Makefile
|
|
||||||
contrib/initramfs/conf.d/Makefile
|
|
||||||
contrib/initramfs/conf-hooks.d/Makefile
|
|
||||||
contrib/initramfs/hooks/Makefile
|
|
||||||
contrib/initramfs/scripts/Makefile
|
|
||||||
contrib/initramfs/scripts/local-top/Makefile
|
|
||||||
contrib/pam_zfs_key/Makefile
|
|
||||||
contrib/pyzfs/Makefile
|
|
||||||
contrib/pyzfs/setup.py
|
|
||||||
contrib/zcp/Makefile
|
|
||||||
etc/Makefile
|
|
||||||
etc/default/Makefile
|
|
||||||
etc/init.d/Makefile
|
|
||||||
etc/modules-load.d/Makefile
|
|
||||||
etc/sudoers.d/Makefile
|
|
||||||
etc/systemd/Makefile
|
|
||||||
etc/systemd/system-generators/Makefile
|
|
||||||
etc/systemd/system/Makefile
|
|
||||||
etc/zfs/Makefile
|
|
||||||
include/Makefile
|
include/Makefile
|
||||||
include/os/Makefile
|
|
||||||
include/os/freebsd/Makefile
|
|
||||||
include/os/freebsd/linux/Makefile
|
|
||||||
include/os/freebsd/spl/Makefile
|
|
||||||
include/os/freebsd/spl/acl/Makefile
|
|
||||||
include/os/freebsd/spl/rpc/Makefile
|
|
||||||
include/os/freebsd/spl/sys/Makefile
|
|
||||||
include/os/freebsd/zfs/Makefile
|
|
||||||
include/os/freebsd/zfs/sys/Makefile
|
|
||||||
include/os/linux/Makefile
|
|
||||||
include/os/linux/kernel/Makefile
|
|
||||||
include/os/linux/kernel/linux/Makefile
|
|
||||||
include/os/linux/spl/Makefile
|
|
||||||
include/os/linux/spl/rpc/Makefile
|
|
||||||
include/os/linux/spl/sys/Makefile
|
|
||||||
include/os/linux/zfs/Makefile
|
|
||||||
include/os/linux/zfs/sys/Makefile
|
|
||||||
include/sys/Makefile
|
|
||||||
include/sys/crypto/Makefile
|
|
||||||
include/sys/fm/Makefile
|
|
||||||
include/sys/fm/fs/Makefile
|
|
||||||
include/sys/fs/Makefile
|
|
||||||
include/sys/lua/Makefile
|
|
||||||
include/sys/sysevent/Makefile
|
|
||||||
include/sys/zstd/Makefile
|
|
||||||
lib/Makefile
|
|
||||||
lib/libavl/Makefile
|
|
||||||
lib/libefi/Makefile
|
|
||||||
lib/libicp/Makefile
|
|
||||||
lib/libnvpair/Makefile
|
|
||||||
lib/libshare/Makefile
|
|
||||||
lib/libspl/Makefile
|
|
||||||
lib/libspl/include/Makefile
|
|
||||||
lib/libspl/include/os/Makefile
|
|
||||||
lib/libspl/include/os/freebsd/Makefile
|
|
||||||
lib/libspl/include/os/freebsd/sys/Makefile
|
|
||||||
lib/libspl/include/os/linux/Makefile
|
|
||||||
lib/libspl/include/os/linux/sys/Makefile
|
|
||||||
lib/libspl/include/rpc/Makefile
|
|
||||||
lib/libspl/include/sys/Makefile
|
|
||||||
lib/libspl/include/sys/dktp/Makefile
|
|
||||||
lib/libspl/include/util/Makefile
|
|
||||||
lib/libtpool/Makefile
|
|
||||||
lib/libunicode/Makefile
|
|
||||||
lib/libuutil/Makefile
|
|
||||||
lib/libzfs/Makefile
|
|
||||||
lib/libzfs/libzfs.pc
|
lib/libzfs/libzfs.pc
|
||||||
lib/libzfsbootenv/Makefile
|
|
||||||
lib/libzfsbootenv/libzfsbootenv.pc
|
|
||||||
lib/libzfs_core/Makefile
|
|
||||||
lib/libzfs_core/libzfs_core.pc
|
lib/libzfs_core/libzfs_core.pc
|
||||||
lib/libzpool/Makefile
|
lib/libzfsbootenv/libzfsbootenv.pc
|
||||||
lib/libzstd/Makefile
|
|
||||||
lib/libzutil/Makefile
|
|
||||||
man/Makefile
|
|
||||||
module/Kbuild
|
module/Kbuild
|
||||||
module/Makefile
|
module/Makefile
|
||||||
module/avl/Makefile
|
|
||||||
module/icp/Makefile
|
|
||||||
module/lua/Makefile
|
|
||||||
module/nvpair/Makefile
|
|
||||||
module/os/linux/spl/Makefile
|
|
||||||
module/os/linux/zfs/Makefile
|
|
||||||
module/spl/Makefile
|
|
||||||
module/unicode/Makefile
|
|
||||||
module/zcommon/Makefile
|
|
||||||
module/zfs/Makefile
|
|
||||||
module/zstd/Makefile
|
|
||||||
rpm/Makefile
|
|
||||||
rpm/generic/Makefile
|
|
||||||
rpm/generic/zfs-dkms.spec
|
rpm/generic/zfs-dkms.spec
|
||||||
rpm/generic/zfs-kmod.spec
|
rpm/generic/zfs-kmod.spec
|
||||||
rpm/generic/zfs.spec
|
rpm/generic/zfs.spec
|
||||||
rpm/redhat/Makefile
|
|
||||||
rpm/redhat/zfs-dkms.spec
|
rpm/redhat/zfs-dkms.spec
|
||||||
rpm/redhat/zfs-kmod.spec
|
rpm/redhat/zfs-kmod.spec
|
||||||
rpm/redhat/zfs.spec
|
rpm/redhat/zfs.spec
|
||||||
scripts/Makefile
|
|
||||||
tests/Makefile
|
|
||||||
tests/runfiles/Makefile
|
|
||||||
tests/test-runner/Makefile
|
|
||||||
tests/test-runner/bin/Makefile
|
|
||||||
tests/test-runner/include/Makefile
|
|
||||||
tests/test-runner/man/Makefile
|
|
||||||
tests/zfs-tests/Makefile
|
|
||||||
tests/zfs-tests/callbacks/Makefile
|
|
||||||
tests/zfs-tests/cmd/Makefile
|
|
||||||
tests/zfs-tests/cmd/badsend/Makefile
|
|
||||||
tests/zfs-tests/cmd/btree_test/Makefile
|
|
||||||
tests/zfs-tests/cmd/chg_usr_exec/Makefile
|
|
||||||
tests/zfs-tests/cmd/devname2devid/Makefile
|
|
||||||
tests/zfs-tests/cmd/draid/Makefile
|
|
||||||
tests/zfs-tests/cmd/dir_rd_update/Makefile
|
|
||||||
tests/zfs-tests/cmd/file_check/Makefile
|
|
||||||
tests/zfs-tests/cmd/file_trunc/Makefile
|
|
||||||
tests/zfs-tests/cmd/file_write/Makefile
|
|
||||||
tests/zfs-tests/cmd/get_diff/Makefile
|
|
||||||
tests/zfs-tests/cmd/getversion/Makefile
|
|
||||||
tests/zfs-tests/cmd/largest_file/Makefile
|
|
||||||
tests/zfs-tests/cmd/libzfs_input_check/Makefile
|
|
||||||
tests/zfs-tests/cmd/mkbusy/Makefile
|
|
||||||
tests/zfs-tests/cmd/mkfile/Makefile
|
|
||||||
tests/zfs-tests/cmd/mkfiles/Makefile
|
|
||||||
tests/zfs-tests/cmd/mktree/Makefile
|
|
||||||
tests/zfs-tests/cmd/mmap_exec/Makefile
|
|
||||||
tests/zfs-tests/cmd/mmap_libaio/Makefile
|
|
||||||
tests/zfs-tests/cmd/mmap_seek/Makefile
|
|
||||||
tests/zfs-tests/cmd/mmapwrite/Makefile
|
|
||||||
tests/zfs-tests/cmd/nvlist_to_lua/Makefile
|
|
||||||
tests/zfs-tests/cmd/randfree_file/Makefile
|
|
||||||
tests/zfs-tests/cmd/randwritecomp/Makefile
|
|
||||||
tests/zfs-tests/cmd/readmmap/Makefile
|
|
||||||
tests/zfs-tests/cmd/read_dos_attributes/Makefile
|
|
||||||
tests/zfs-tests/cmd/rename_dir/Makefile
|
|
||||||
tests/zfs-tests/cmd/rm_lnkcnt_zero_file/Makefile
|
|
||||||
tests/zfs-tests/cmd/send_doall/Makefile
|
|
||||||
tests/zfs-tests/cmd/stride_dd/Makefile
|
|
||||||
tests/zfs-tests/cmd/threadsappend/Makefile
|
|
||||||
tests/zfs-tests/cmd/user_ns_exec/Makefile
|
|
||||||
tests/zfs-tests/cmd/write_dos_attributes/Makefile
|
|
||||||
tests/zfs-tests/cmd/xattrtest/Makefile
|
|
||||||
tests/zfs-tests/include/Makefile
|
|
||||||
tests/zfs-tests/tests/Makefile
|
tests/zfs-tests/tests/Makefile
|
||||||
tests/zfs-tests/tests/functional/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/acl/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/acl/off/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/acl/posix/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/acl/posix-sa/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/alloc_class/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/arc/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/atime/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/bootfs/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/btree/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cache/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cachefile/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/casenorm/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/channel_program/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/channel_program/lua_core/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/channel_program/synctask_core/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/chattr/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/checksum/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/clean_mirror/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zdb/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_change-key/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_clone/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_copies/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_create/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_diff/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_get/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_ids_to_path/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_inherit/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_jail/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_load-key/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_mount/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_program/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_promote/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_property/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_receive/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_rename/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_reservation/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_rollback/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_send/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_set/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_share/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_unload-key/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_unmount/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_unshare/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zfs_wait/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zhack/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_add/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_attach/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_clear/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_create/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_destroy/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_detach/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_events/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_expand/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_export/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_get/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_history/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_import/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_import/blockfiles/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_initialize/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_labelclear/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_offline/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_online/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_remove/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_reopen/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_replace/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_resilver/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_scrub/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_set/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_split/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_status/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_sync/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_trim/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_wait/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_root/zpool_wait/scan/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_user/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_user/misc/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_user/zfs_list/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_user/zpool_iostat/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_user/zpool_list/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cli_user/zpool_status/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/compression/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/cp_files/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/crtime/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/ctime/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/deadman/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/delegate/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/devices/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/dos_attributes/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/events/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/exec/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/fallocate/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/fault/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/features/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/features/async_destroy/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/features/large_dnode/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/grow/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/history/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/hkdf/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/inheritance/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/inuse/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/io/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/l2arc/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/large_files/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/largest_pool/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/libzfs/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/limits/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/link_count/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/log_spacemap/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/migration/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/mmap/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/mmp/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/mount/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/mv_files/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/nestedfs/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/no_space/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/nopwrite/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/online_offline/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/pam/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/pool_checkpoint/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/pool_names/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/poolversion/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/privilege/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/procfs/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/projectquota/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/pyzfs/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/quota/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/raidz/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/redacted_send/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/redundancy/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/refquota/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/refreserv/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/removal/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/rename_dirs/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/replacement/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/reservation/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/rootpool/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/rsend/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/scrub_mirror/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/simd/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/slog/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/snapshot/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/snapused/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/sparse/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/stat/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/suid/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/threadsappend/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/tmpfile/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/trim/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/truncate/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/upgrade/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/user_namespace/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/userquota/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/vdev_zaps/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/write_dirs/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/xattr/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/zpool_influxdb/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/zvol/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/zvol/zvol_cli/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/zvol/zvol_misc/Makefile
|
|
||||||
tests/zfs-tests/tests/functional/zvol/zvol_swap/Makefile
|
|
||||||
tests/zfs-tests/tests/perf/Makefile
|
|
||||||
tests/zfs-tests/tests/perf/fio/Makefile
|
|
||||||
tests/zfs-tests/tests/perf/regression/Makefile
|
|
||||||
tests/zfs-tests/tests/perf/scripts/Makefile
|
|
||||||
tests/zfs-tests/tests/stress/Makefile
|
|
||||||
udev/Makefile
|
|
||||||
udev/rules.d/Makefile
|
|
||||||
zfs.release
|
zfs.release
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
include $(top_srcdir)/config/Shellcheck.am
|
include $(srcdir)/%D%/bash_completion.d/Makefile.am
|
||||||
|
include $(srcdir)/%D%/pyzfs/Makefile.am
|
||||||
|
include $(srcdir)/%D%/zcp/Makefile.am
|
||||||
|
|
||||||
SUBDIRS = bash_completion.d pyzfs zcp
|
|
||||||
if BUILD_LINUX
|
if BUILD_LINUX
|
||||||
SUBDIRS += bpftrace dracut initramfs
|
include $(srcdir)/%D%/bpftrace/Makefile.am
|
||||||
|
include $(srcdir)/%D%/dracut/Makefile.am
|
||||||
|
include $(srcdir)/%D%/initramfs/Makefile.am
|
||||||
endif
|
endif
|
||||||
if PAM_ZFS_ENABLED
|
|
||||||
SUBDIRS += pam_zfs_key
|
|
||||||
endif
|
|
||||||
DIST_SUBDIRS = bash_completion.d bpftrace dracut initramfs pam_zfs_key pyzfs zcp
|
|
||||||
|
|
||||||
SHELLCHECKDIRS = bash_completion.d bpftrace dracut initramfs
|
if PAM_ZFS_ENABLED
|
||||||
|
include $(srcdir)/%D%/pam_zfs_key/Makefile.am
|
||||||
|
endif
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
include $(top_srcdir)/config/Substfiles.am
|
|
||||||
include $(top_srcdir)/config/Shellcheck.am
|
|
||||||
|
|
||||||
bashcompletiondir = $(sysconfdir)/bash_completion.d
|
bashcompletiondir = $(sysconfdir)/bash_completion.d
|
||||||
|
|
||||||
noinst_DATA = zfs
|
nodist_bashcompletion_DATA = %D%/zfs
|
||||||
|
SUBSTFILES += $(nodist_bashcompletion_DATA)
|
||||||
|
|
||||||
EXTRA_DIST += $(noinst_DATA)
|
SHELLCHECKSCRIPTS += $(nodist_bashcompletion_DATA)
|
||||||
SUBSTFILES += $(noinst_DATA)
|
$(call SHELLCHECK_OPTS,$(nodist_bashcompletion_DATA)): SHELLCHECK_SHELL = bash
|
||||||
|
|
||||||
SHELLCHECKSCRIPTS = $(noinst_DATA)
|
|
||||||
SHELLCHECK_SHELL = bash
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
include $(top_srcdir)/config/Shellcheck.am
|
EXTRA_DIST += $(addprefix %D%/, \
|
||||||
|
|
||||||
EXTRA_DIST = \
|
|
||||||
taskqlatency.bt \
|
taskqlatency.bt \
|
||||||
zfs-trace.sh
|
zfs-trace.sh)
|
||||||
|
|
||||||
SHELLCHECKSCRIPTS = zfs-trace.sh
|
SHELLCHECKSCRIPTS += %D%/zfs-trace.sh
|
||||||
|
@ -1 +0,0 @@
|
|||||||
module-setup.sh
|
|
@ -1,8 +0,0 @@
|
|||||||
include $(top_srcdir)/config/Substfiles.am
|
|
||||||
include $(top_srcdir)/config/Shellcheck.am
|
|
||||||
|
|
||||||
pkgdracutdir = $(dracutdir)/modules.d/02zfsexpandknowledge
|
|
||||||
pkgdracut_SCRIPTS = \
|
|
||||||
module-setup.sh
|
|
||||||
|
|
||||||
SUBSTFILES += $(pkgdracut_SCRIPTS)
|
|
@ -1,24 +0,0 @@
|
|||||||
include $(top_srcdir)/config/Substfiles.am
|
|
||||||
include $(top_srcdir)/config/Shellcheck.am
|
|
||||||
|
|
||||||
pkgdracutdir = $(dracutdir)/modules.d/90zfs
|
|
||||||
pkgdracut_SCRIPTS = \
|
|
||||||
export-zfs.sh \
|
|
||||||
module-setup.sh \
|
|
||||||
mount-zfs.sh \
|
|
||||||
parse-zfs.sh \
|
|
||||||
zfs-generator.sh \
|
|
||||||
zfs-load-key.sh \
|
|
||||||
zfs-needshutdown.sh \
|
|
||||||
zfs-lib.sh \
|
|
||||||
import-opts-generator.sh
|
|
||||||
|
|
||||||
pkgdracut_DATA = \
|
|
||||||
zfs-env-bootfs.service \
|
|
||||||
zfs-snapshot-bootfs.service \
|
|
||||||
zfs-rollback-bootfs.service
|
|
||||||
|
|
||||||
SUBSTFILES += $(pkgdracut_SCRIPTS) $(pkgdracut_DATA)
|
|
||||||
|
|
||||||
# Provided by /bin/sleep, and, again, every implementation of that supports this
|
|
||||||
CHECKBASHISMS_IGNORE = -e 'sleep only takes one integer' -e 'sleep 0.'
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user