mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
Compare commits
208 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e9353bc2ef | |||
| 87d93731e7 | |||
| bd197378e7 | |||
| cd2bb9ca44 | |||
| 52d9bc7174 | |||
| 6905f6b2c1 | |||
| cfc82609a2 | |||
| e26776f14c | |||
| e68e938f54 | |||
| ab2110e3e2 | |||
| a909190683 | |||
| 073f3c7826 | |||
| 5072f37419 | |||
| 332cd2e313 | |||
| ac6f332154 | |||
| f14b6f2302 | |||
| bfb2928490 | |||
| ecb1b1a31d | |||
| 412b69dfab | |||
| d014da0032 | |||
| 8f93ab53d4 | |||
| 88891b804b | |||
| 87b5e7fb1d | |||
| 5722dce473 | |||
| 91d5ac85c0 | |||
| fd8ccce07b | |||
| c2a3bcc91d | |||
| d1277e2a13 | |||
| a59bf29606 | |||
| 28fdc5f811 | |||
| a78a93e67e | |||
| 9a68ceba10 | |||
| 3c7ad493a6 | |||
| faad85637b | |||
| 501da8d433 | |||
| 30620ad8e1 | |||
| 1d65d1a597 | |||
| edf3d7aa43 | |||
| 9755cdfd89 | |||
| f36e8118fd | |||
| e69f73c5cf | |||
| 3430eced80 | |||
| 0839934d84 | |||
| f831d1377f | |||
| a559c3d0f4 | |||
| 95e29a7275 | |||
| 85890d54d9 | |||
| 12e25a6ec3 | |||
| 57490d5e13 | |||
| 214196e9f5 | |||
| 932d471bec | |||
| 77cba40b85 | |||
| 18d069a20f | |||
| dfc25ea91c | |||
| 7428adc6b7 | |||
| 30782f2ff5 | |||
| 43efd5625b | |||
| 87a520c4e7 | |||
| d02bcae0c4 | |||
| d9bcadc6ba | |||
| 67819ea28d | |||
| 79430bf34b | |||
| cabc605aa7 | |||
| 0740d41e9b | |||
| 16e8e24f9c | |||
| bc5afff351 | |||
| 825d8e1b0f | |||
| f7797f3f5e | |||
| 2439e95f36 | |||
| de722e55ca | |||
| acb4e7b0e1 | |||
| 5a397fda09 | |||
| 525a7037c7 | |||
| 789f3d0e56 | |||
| 5d946dfa1c | |||
| cd80d6d355 | |||
| 140584bfff | |||
| 8773e29c23 | |||
| bb21c0aa3b | |||
| 455ea5bb1f | |||
| 7126b0e5ed | |||
| 7ca0ef36e1 | |||
| 0d6186cff3 | |||
| 6f349d33a5 | |||
| 226d362b12 | |||
| 497fc5fb06 | |||
| abb485a34a | |||
| 0ccffb2634 | |||
| 26cb87d22d | |||
| 43dbfa3921 | |||
| 395583e38e | |||
| 818bc70c32 | |||
| 6150fbe67f | |||
| 458bb8c8a1 | |||
| cda6fdd500 | |||
| df8271301e | |||
| e219935f10 | |||
| bb9104f1e8 | |||
| 94b240bae0 | |||
| e93203e004 | |||
| ccb453acd0 | |||
| 6c1989923e | |||
| a0eb5a77a0 | |||
| fe77c48320 | |||
| db9b29895e | |||
| 4d4dd76f0f | |||
| 286c7f75bb | |||
| 403703d57a | |||
| f17c843eff | |||
| f6440fa094 | |||
| 62f9691e10 | |||
| 73e26fdc09 | |||
| 65a89d9f49 | |||
| 8829ba19b7 | |||
| 642d86af0d | |||
| 07ca7592ad | |||
| fb0d807477 | |||
| 858ea8861c | |||
| 549841ef9a | |||
| 96f322e7e2 | |||
| d022406a14 | |||
| a1a1386965 | |||
| 43eaef6de8 | |||
| 5bc4c39d70 | |||
| 756e28be51 | |||
| 039a810491 | |||
| bfb7b9613a | |||
| 3e33897bec | |||
| 0f3b928e85 | |||
| 12fec4a147 | |||
| 7930a5ee65 | |||
| be94a3de0f | |||
| db83b3abe9 | |||
| 55fd8ceab6 | |||
| e269e1c07a | |||
| 81f981cd82 | |||
| 3790aa8176 | |||
| 4e1d1b4b92 | |||
| c32c475363 | |||
| dd487640b2 | |||
| acb39fc9a4 | |||
| 6539bf71fe | |||
| 32a78e579d | |||
| fb7aa3c9b2 | |||
| 4016ad705b | |||
| 59570a05d8 | |||
| 88ae76a4e0 | |||
| 88d7da62b5 | |||
| 6410ee4a94 | |||
| a296875da0 | |||
| 921ec61b77 | |||
| fcd9966ed9 | |||
| a2621753b2 | |||
| e888f28988 | |||
| 305510fd33 | |||
| 67cff6e4c1 | |||
| 944180ab50 | |||
| 3075b29ca8 | |||
| e1d9228b08 | |||
| afaf9414ff | |||
| cee725c9bd | |||
| 03ad94a3b2 | |||
| 7a7e101437 | |||
| 401ba57ccd | |||
| 188950df9e | |||
| 58bc86c5cb | |||
| 7cf4cd8246 | |||
| 783be694f1 | |||
| af5626ac27 | |||
| cc1f85be8b | |||
| 9585538d0e | |||
| 86e74dc162 | |||
| b3d723fb0e | |||
| 3d40b65540 | |||
| fa7b558bef | |||
| a103ae446e | |||
| 2ab24dfded | |||
| 489633d99a | |||
| ee49d9e02b | |||
| 1fbda9caee | |||
| 42bdfd3b36 | |||
| 900480bd96 | |||
| 058b6fd069 | |||
| 8847b06bf6 | |||
| 21adfb031c | |||
| ae2cfdf8a7 | |||
| 20e4513c56 | |||
| f217a2b902 | |||
| aa5b9e1d7c | |||
| fb3ad5d24e | |||
| de2ac3f700 | |||
| f9688b21d7 | |||
| fad85e52e5 | |||
| 038aaec1cd | |||
| 94ca328fb3 | |||
| 65c4c9a233 | |||
| 07ca433973 | |||
| f21d1f8fad | |||
| ee8794195b | |||
| 0ef4def852 | |||
| aa51adf0a2 | |||
| 1d02bdee6c | |||
| 2080c4f27e | |||
| 49ba502f99 | |||
| 7735c9addf | |||
| ed02d603a1 | |||
| 529469769f | |||
| 3b854534f0 |
@@ -2,11 +2,11 @@ name: checkstyle
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
pull_request_target:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
checkstyle:
|
checkstyle:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -0,0 +1,70 @@
|
|||||||
|
name: zfs-tests-functional
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tests-functional-ubuntu:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [18.04, 20.04]
|
||||||
|
runs-on: ubuntu-${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install --yes -qq build-essential autoconf libtool gdb lcov \
|
||||||
|
git alien fakeroot wget curl bc fio acl \
|
||||||
|
sysstat mdadm lsscsi parted gdebi attr dbench watchdog ksh \
|
||||||
|
nfs-kernel-server samba rng-tools xz-utils \
|
||||||
|
zlib1g-dev uuid-dev libblkid-dev libselinux-dev \
|
||||||
|
xfslibs-dev libattr1-dev libacl1-dev libudev-dev libdevmapper-dev \
|
||||||
|
libssl-dev libffi-dev libaio-dev libelf-dev libmount-dev \
|
||||||
|
libpam0g-dev pamtester python-dev python-setuptools python-cffi \
|
||||||
|
python3 python3-dev python3-setuptools python3-cffi
|
||||||
|
- name: Autogen.sh
|
||||||
|
run: |
|
||||||
|
sh autogen.sh
|
||||||
|
- name: Configure
|
||||||
|
run: |
|
||||||
|
./configure --enable-debug --enable-debuginfo
|
||||||
|
- name: Make
|
||||||
|
run: |
|
||||||
|
make --no-print-directory -s pkg-utils pkg-kmod
|
||||||
|
- name: Install
|
||||||
|
run: |
|
||||||
|
sudo dpkg -i *.deb
|
||||||
|
# Update order of directories to search for modules, otherwise
|
||||||
|
# Ubuntu will load kernel-shipped ones.
|
||||||
|
sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf
|
||||||
|
sudo depmod
|
||||||
|
sudo modprobe zfs
|
||||||
|
# Workaround to provide additional free space for testing.
|
||||||
|
# https://github.com/actions/virtual-environments/issues/2840
|
||||||
|
sudo rm -rf /usr/share/dotnet
|
||||||
|
sudo rm -rf /opt/ghc
|
||||||
|
sudo rm -rf "/usr/local/share/boost"
|
||||||
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
||||||
|
- name: Tests
|
||||||
|
run: |
|
||||||
|
/usr/share/zfs/zfs-tests.sh -v -s 3G
|
||||||
|
- name: Prepare artifacts
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
RESULTS_PATH=$(readlink -f /var/tmp/test_results/current)
|
||||||
|
sudo dmesg > $RESULTS_PATH/dmesg
|
||||||
|
sudo cp /var/log/syslog $RESULTS_PATH/
|
||||||
|
sudo chmod +r $RESULTS_PATH/*
|
||||||
|
# Replace ':' in dir names, actions/upload-artifact doesn't support it
|
||||||
|
for f in $(find $RESULTS_PATH -name '*:*'); do mv "$f" "${f//:/__}"; done
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
if: failure()
|
||||||
|
with:
|
||||||
|
name: Test logs Ubuntu-${{ matrix.os }}
|
||||||
|
path: /var/tmp/test_results/20*/
|
||||||
|
if-no-files-found: ignore
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
name: zfs-tests-sanity
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install --yes -qq build-essential autoconf libtool gdb lcov \
|
||||||
|
git alien fakeroot wget curl bc fio acl \
|
||||||
|
sysstat mdadm lsscsi parted gdebi attr dbench watchdog ksh \
|
||||||
|
nfs-kernel-server samba rng-tools xz-utils \
|
||||||
|
zlib1g-dev uuid-dev libblkid-dev libselinux-dev \
|
||||||
|
xfslibs-dev libattr1-dev libacl1-dev libudev-dev libdevmapper-dev \
|
||||||
|
libssl-dev libffi-dev libaio-dev libelf-dev libmount-dev \
|
||||||
|
libpam0g-dev pamtester python-dev python-setuptools python-cffi \
|
||||||
|
python3 python3-dev python3-setuptools python3-cffi
|
||||||
|
- name: Autogen.sh
|
||||||
|
run: |
|
||||||
|
sh autogen.sh
|
||||||
|
- name: Configure
|
||||||
|
run: |
|
||||||
|
./configure --enable-debug --enable-debuginfo
|
||||||
|
- name: Make
|
||||||
|
run: |
|
||||||
|
make --no-print-directory -s pkg-utils pkg-kmod
|
||||||
|
- name: Install
|
||||||
|
run: |
|
||||||
|
sudo dpkg -i *.deb
|
||||||
|
# Update order of directories to search for modules, otherwise
|
||||||
|
# Ubuntu will load kernel-shipped ones.
|
||||||
|
sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf
|
||||||
|
sudo depmod
|
||||||
|
sudo modprobe zfs
|
||||||
|
# Workaround to provide additional free space for testing.
|
||||||
|
# https://github.com/actions/virtual-environments/issues/2840
|
||||||
|
sudo rm -rf /usr/share/dotnet
|
||||||
|
sudo rm -rf /opt/ghc
|
||||||
|
sudo rm -rf "/usr/local/share/boost"
|
||||||
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
||||||
|
- name: Tests
|
||||||
|
run: |
|
||||||
|
/usr/share/zfs/zfs-tests.sh -v -s 3G -r sanity
|
||||||
|
- name: Prepare artifacts
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
RESULTS_PATH=$(readlink -f /var/tmp/test_results/current)
|
||||||
|
sudo dmesg > $RESULTS_PATH/dmesg
|
||||||
|
sudo cp /var/log/syslog $RESULTS_PATH/
|
||||||
|
sudo chmod +r $RESULTS_PATH/*
|
||||||
|
# Replace ':' in dir names, actions/upload-artifact doesn't support it
|
||||||
|
for f in $(find $RESULTS_PATH -name '*:*'); do mv "$f" "${f//:/__}"; done
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
if: failure()
|
||||||
|
with:
|
||||||
|
name: Test logs
|
||||||
|
path: /var/tmp/test_results/20*/
|
||||||
|
if-no-files-found: ignore
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
name: zloop
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
TEST_DIR: /var/tmp/zloop
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install --yes -qq build-essential autoconf libtool gdb \
|
||||||
|
git alien fakeroot \
|
||||||
|
zlib1g-dev uuid-dev libblkid-dev libselinux-dev \
|
||||||
|
xfslibs-dev libattr1-dev libacl1-dev libudev-dev libdevmapper-dev \
|
||||||
|
libssl-dev libffi-dev libaio-dev libelf-dev libmount-dev \
|
||||||
|
libpam0g-dev \
|
||||||
|
python-dev python-setuptools python-cffi \
|
||||||
|
python3 python3-dev python3-setuptools python3-cffi
|
||||||
|
- name: Autogen.sh
|
||||||
|
run: |
|
||||||
|
sh autogen.sh
|
||||||
|
- name: Configure
|
||||||
|
run: |
|
||||||
|
./configure --enable-debug --enable-debuginfo
|
||||||
|
- name: Make
|
||||||
|
run: |
|
||||||
|
make --no-print-directory -s pkg-utils pkg-kmod
|
||||||
|
- name: Install
|
||||||
|
run: |
|
||||||
|
sudo dpkg -i *.deb
|
||||||
|
# Update order of directories to search for modules, otherwise
|
||||||
|
# Ubuntu will load kernel-shipped ones.
|
||||||
|
sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf
|
||||||
|
sudo depmod
|
||||||
|
sudo modprobe zfs
|
||||||
|
- name: Tests
|
||||||
|
run: |
|
||||||
|
sudo mkdir -p $TEST_DIR
|
||||||
|
# run for 20 minutes to have a total runner time of 30 minutes
|
||||||
|
sudo /usr/share/zfs/zloop.sh -t 1200 -l -m1
|
||||||
|
- name: Prepare artifacts
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
sudo chmod +r -R $TEST_DIR/
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
if: failure()
|
||||||
|
with:
|
||||||
|
name: Logs
|
||||||
|
path: |
|
||||||
|
/var/tmp/zloop/*/
|
||||||
|
!/var/tmp/zloop/*/vdev/
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
if: failure()
|
||||||
|
with:
|
||||||
|
name: Pool files
|
||||||
|
path: |
|
||||||
|
/var/tmp/zloop/*/vdev/
|
||||||
|
if-no-files-found: ignore
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
Meta: 1
|
Meta: 1
|
||||||
Name: zfs
|
Name: zfs
|
||||||
Branch: 1.0
|
Branch: 1.0
|
||||||
Version: 2.0.0
|
Version: 2.0.5
|
||||||
Release: 1
|
Release: 1
|
||||||
Release-Tags: relext
|
Release-Tags: relext
|
||||||
License: CDDL
|
License: CDDL
|
||||||
Author: OpenZFS
|
Author: OpenZFS
|
||||||
Linux-Maximum: 5.9
|
Linux-Maximum: 5.12
|
||||||
Linux-Minimum: 3.10
|
Linux-Minimum: 3.10
|
||||||
|
|||||||
+7
-8
@@ -25,7 +25,6 @@ endif
|
|||||||
|
|
||||||
AUTOMAKE_OPTIONS = foreign
|
AUTOMAKE_OPTIONS = foreign
|
||||||
EXTRA_DIST = autogen.sh copy-builtin
|
EXTRA_DIST = autogen.sh copy-builtin
|
||||||
EXTRA_DIST += cppcheck-suppressions.txt
|
|
||||||
EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am
|
EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am
|
||||||
EXTRA_DIST += META AUTHORS COPYRIGHT LICENSE NEWS NOTICE README.md
|
EXTRA_DIST += META AUTHORS COPYRIGHT LICENSE NEWS NOTICE README.md
|
||||||
EXTRA_DIST += CODE_OF_CONDUCT.md
|
EXTRA_DIST += CODE_OF_CONDUCT.md
|
||||||
@@ -162,7 +161,7 @@ checkbashisms:
|
|||||||
-o -name '90zfs' -prune \
|
-o -name '90zfs' -prune \
|
||||||
-o -type f ! -name 'config*' \
|
-o -type f ! -name 'config*' \
|
||||||
! -name 'libtool' \
|
! -name 'libtool' \
|
||||||
-exec sh -c 'awk "NR==1 && /\#\!.*bin\/sh.*/ {print FILENAME;}" "{}"' \;); \
|
-exec sh -c 'awk "NR==1 && /#!.*bin\/sh.*/ {print FILENAME;}" "{}"' \;); \
|
||||||
else \
|
else \
|
||||||
echo "skipping checkbashisms because checkbashisms is not installed"; \
|
echo "skipping checkbashisms because checkbashisms is not installed"; \
|
||||||
fi
|
fi
|
||||||
@@ -204,13 +203,13 @@ vcscheck:
|
|||||||
PHONY += lint
|
PHONY += lint
|
||||||
lint: cppcheck paxcheck
|
lint: cppcheck paxcheck
|
||||||
|
|
||||||
|
CPPCHECKDIRS = cmd lib module
|
||||||
PHONY += cppcheck
|
PHONY += cppcheck
|
||||||
cppcheck:
|
cppcheck: $(CPPCHECKDIRS)
|
||||||
@if type cppcheck > /dev/null 2>&1; then \
|
@if test -n "$(CPPCHECK)"; then \
|
||||||
cppcheck --quiet --force --error-exitcode=2 --inline-suppr \
|
set -e ; for dir in $(CPPCHECKDIRS) ; do \
|
||||||
--suppressions-list=${top_srcdir}/cppcheck-suppressions.txt \
|
$(MAKE) -C $$dir cppcheck ; \
|
||||||
-UHAVE_SSE2 -UHAVE_AVX512F -UHAVE_UIO_ZEROCOPY \
|
done \
|
||||||
${top_srcdir}; \
|
|
||||||
else \
|
else \
|
||||||
echo "skipping cppcheck because cppcheck is not installed"; \
|
echo "skipping cppcheck because cppcheck is not installed"; \
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,10 +1,20 @@
|
|||||||
SUBDIRS = zfs zpool zdb zhack zinject zstream zstreamdump ztest
|
SUBDIRS = zfs zpool zdb zhack zinject zstream zstreamdump ztest
|
||||||
SUBDIRS += fsck_zfs vdev_id raidz_test zfs_ids_to_path
|
SUBDIRS += fsck_zfs vdev_id raidz_test zfs_ids_to_path
|
||||||
|
|
||||||
|
CPPCHECKDIRS = zfs zpool zdb zhack zinject zstream ztest
|
||||||
|
CPPCHECKDIRS += raidz_test zfs_ids_to_path
|
||||||
|
|
||||||
if USING_PYTHON
|
if USING_PYTHON
|
||||||
SUBDIRS += arcstat arc_summary dbufstat
|
SUBDIRS += arcstat arc_summary dbufstat
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if BUILD_LINUX
|
if BUILD_LINUX
|
||||||
SUBDIRS += mount_zfs zed zgenhostid zvol_id zvol_wait
|
SUBDIRS += mount_zfs zed zgenhostid zvol_id zvol_wait
|
||||||
|
CPPCHECKDIRS += mount_zfs zed zgenhostid zvol_id
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
PHONY = cppcheck
|
||||||
|
cppcheck: $(CPPCHECKDIRS)
|
||||||
|
set -e ; for dir in $(CPPCHECKDIRS) ; do \
|
||||||
|
$(MAKE) -C $$dir cppcheck ; \
|
||||||
|
done
|
||||||
|
|||||||
@@ -59,14 +59,20 @@ if sys.platform.startswith('freebsd'):
|
|||||||
# Requires py27-sysctl on FreeBSD
|
# Requires py27-sysctl on FreeBSD
|
||||||
import sysctl
|
import sysctl
|
||||||
|
|
||||||
|
def is_value(ctl):
|
||||||
|
return ctl.type != sysctl.CTLTYPE_NODE
|
||||||
|
|
||||||
def load_kstats(namespace):
|
def load_kstats(namespace):
|
||||||
"""Collect information on a specific subsystem of the ARC"""
|
"""Collect information on a specific subsystem of the ARC"""
|
||||||
|
|
||||||
base = 'kstat.zfs.misc.%s.' % namespace
|
base = 'kstat.zfs.misc.%s.' % namespace
|
||||||
return [(kstat.name, D(kstat.value)) for kstat in sysctl.filter(base)]
|
fmt = lambda kstat: (kstat.name, D(kstat.value))
|
||||||
|
kstats = sysctl.filter(base)
|
||||||
|
return [fmt(kstat) for kstat in kstats if is_value(kstat)]
|
||||||
|
|
||||||
def load_tunables():
|
def load_tunables():
|
||||||
return dict((ctl.name, ctl.value) for ctl in sysctl.filter('vfs.zfs'))
|
ctls = sysctl.filter('vfs.zfs')
|
||||||
|
return dict((ctl.name, ctl.value) for ctl in ctls if is_value(ctl))
|
||||||
|
|
||||||
elif sys.platform.startswith('linux'):
|
elif sys.platform.startswith('linux'):
|
||||||
|
|
||||||
|
|||||||
@@ -86,16 +86,24 @@ if sys.platform.startswith('freebsd'):
|
|||||||
|
|
||||||
VDEV_CACHE_SIZE = 'vdev.cache_size'
|
VDEV_CACHE_SIZE = 'vdev.cache_size'
|
||||||
|
|
||||||
|
def is_value(ctl):
|
||||||
|
return ctl.type != sysctl.CTLTYPE_NODE
|
||||||
|
|
||||||
|
def namefmt(ctl, base='vfs.zfs.'):
|
||||||
|
# base is removed from the name
|
||||||
|
cut = len(base)
|
||||||
|
return ctl.name[cut:]
|
||||||
|
|
||||||
def load_kstats(section):
|
def load_kstats(section):
|
||||||
base = 'kstat.zfs.misc.{section}.'.format(section=section)
|
base = 'kstat.zfs.misc.{section}.'.format(section=section)
|
||||||
# base is removed from the name
|
fmt = lambda kstat: '{name} : {value}'.format(name=namefmt(kstat, base),
|
||||||
fmt = lambda kstat: '{name} : {value}'.format(name=kstat.name[len(base):],
|
|
||||||
value=kstat.value)
|
value=kstat.value)
|
||||||
return [fmt(kstat) for kstat in sysctl.filter(base)]
|
kstats = sysctl.filter(base)
|
||||||
|
return [fmt(kstat) for kstat in kstats if is_value(kstat)]
|
||||||
|
|
||||||
def get_params(base):
|
def get_params(base):
|
||||||
cut = 8 # = len('vfs.zfs.')
|
ctls = sysctl.filter(base)
|
||||||
return {ctl.name[cut:]: str(ctl.value) for ctl in sysctl.filter(base)}
|
return {namefmt(ctl): str(ctl.value) for ctl in ctls if is_value(ctl)}
|
||||||
|
|
||||||
def get_tunable_params():
|
def get_tunable_params():
|
||||||
return get_params('vfs.zfs')
|
return get_params('vfs.zfs')
|
||||||
@@ -112,25 +120,8 @@ if sys.platform.startswith('freebsd'):
|
|||||||
return '{} version {}'.format(name, version)
|
return '{} version {}'.format(name, version)
|
||||||
|
|
||||||
def get_descriptions(_request):
|
def get_descriptions(_request):
|
||||||
# py-sysctl doesn't give descriptions, so we have to shell out.
|
ctls = sysctl.filter('vfs.zfs')
|
||||||
command = ['sysctl', '-d', 'vfs.zfs']
|
return {namefmt(ctl): ctl.description for ctl in ctls if is_value(ctl)}
|
||||||
|
|
||||||
# The recommended way to do this is with subprocess.run(). However,
|
|
||||||
# some installed versions of Python are < 3.5, so we offer them
|
|
||||||
# the option of doing it the old way (for now)
|
|
||||||
if 'run' in dir(subprocess):
|
|
||||||
info = subprocess.run(command, stdout=subprocess.PIPE,
|
|
||||||
universal_newlines=True)
|
|
||||||
lines = info.stdout.split('\n')
|
|
||||||
else:
|
|
||||||
info = subprocess.check_output(command, universal_newlines=True)
|
|
||||||
lines = info.split('\n')
|
|
||||||
|
|
||||||
def fmt(line):
|
|
||||||
name, desc = line.split(':', 1)
|
|
||||||
return (name.strip(), desc.strip())
|
|
||||||
|
|
||||||
return dict([fmt(line) for line in lines if len(line) > 0])
|
|
||||||
|
|
||||||
|
|
||||||
elif sys.platform.startswith('linux'):
|
elif sys.platform.startswith('linux'):
|
||||||
@@ -397,8 +388,12 @@ def format_raw_line(name, value):
|
|||||||
if ARGS.alt:
|
if ARGS.alt:
|
||||||
result = '{0}{1}={2}'.format(INDENT, name, value)
|
result = '{0}{1}={2}'.format(INDENT, name, value)
|
||||||
else:
|
else:
|
||||||
spc = LINE_LENGTH-(len(INDENT)+len(value))
|
# Right-align the value within the line length if it fits,
|
||||||
result = '{0}{1:<{spc}}{2}'.format(INDENT, name, value, spc=spc)
|
# otherwise just separate it from the name by a single space.
|
||||||
|
fit = LINE_LENGTH - len(INDENT) - len(name)
|
||||||
|
overflow = len(value) + 1
|
||||||
|
w = max(fit, overflow)
|
||||||
|
result = '{0}{1}{2:>{w}}'.format(INDENT, name, value, w=w)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|||||||
@@ -128,13 +128,14 @@ pretty_print = True
|
|||||||
|
|
||||||
|
|
||||||
if sys.platform.startswith('freebsd'):
|
if sys.platform.startswith('freebsd'):
|
||||||
# Requires py27-sysctl on FreeBSD
|
# Requires py-sysctl on FreeBSD
|
||||||
import sysctl
|
import sysctl
|
||||||
|
|
||||||
def kstat_update():
|
def kstat_update():
|
||||||
global kstat
|
global kstat
|
||||||
|
|
||||||
k = sysctl.filter('kstat.zfs.misc.arcstats')
|
k = [ctl for ctl in sysctl.filter('kstat.zfs.misc.arcstats')
|
||||||
|
if ctl.type != sysctl.CTLTYPE_NODE]
|
||||||
|
|
||||||
if not k:
|
if not k:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ elif sys.platform.startswith("linux"):
|
|||||||
def print_incompat_helper(incompat):
|
def print_incompat_helper(incompat):
|
||||||
cnt = 0
|
cnt = 0
|
||||||
for key in sorted(incompat):
|
for key in sorted(incompat):
|
||||||
if cnt is 0:
|
if cnt == 0:
|
||||||
sys.stderr.write("\t")
|
sys.stderr.write("\t")
|
||||||
elif cnt > 8:
|
elif cnt > 8:
|
||||||
sys.stderr.write(",\n\t")
|
sys.stderr.write(",\n\t")
|
||||||
@@ -662,7 +662,7 @@ def main():
|
|||||||
if not ifile:
|
if not ifile:
|
||||||
ifile = default_ifile()
|
ifile = default_ifile()
|
||||||
|
|
||||||
if ifile is not "-":
|
if ifile != "-":
|
||||||
try:
|
try:
|
||||||
tmp = open(ifile, "r")
|
tmp = open(ifile, "r")
|
||||||
sys.stdin = tmp
|
sys.stdin = tmp
|
||||||
|
|||||||
@@ -18,3 +18,5 @@ mount_zfs_LDADD = \
|
|||||||
$(abs_top_builddir)/lib/libnvpair/libnvpair.la
|
$(abs_top_builddir)/lib/libnvpair/libnvpair.la
|
||||||
|
|
||||||
mount_zfs_LDADD += $(LTLIBINTL)
|
mount_zfs_LDADD += $(LTLIBINTL)
|
||||||
|
|
||||||
|
include $(top_srcdir)/config/CppCheck.am
|
||||||
|
|||||||
+36
-44
@@ -43,53 +43,45 @@
|
|||||||
libzfs_handle_t *g_zfs;
|
libzfs_handle_t *g_zfs;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return the pool/dataset to mount given the name passed to mount. This
|
* Opportunistically convert a target string into a pool name. If the
|
||||||
* is expected to be of the form pool/dataset, however may also refer to
|
* string does not represent a block device with a valid zfs label
|
||||||
* a block device if that device contains a valid zfs label.
|
* then it is passed through without modification.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
parse_dataset(const char *target, char **dataset)
|
parse_dataset(const char *target, char **dataset)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* We expect a pool/dataset to be provided, however if we're
|
* Prior to util-linux 2.36.2, if a file or directory in the
|
||||||
* given a device which is a member of a zpool we attempt to
|
* current working directory was named 'dataset' then mount(8)
|
||||||
* extract the pool name stored in the label. Given the pool
|
* would prepend the current working directory to the dataset.
|
||||||
* name we can mount the root dataset.
|
* Check for it and strip the prepended path when it is added.
|
||||||
*/
|
|
||||||
int fd = open(target, O_RDONLY);
|
|
||||||
if (fd >= 0) {
|
|
||||||
nvlist_t *config = NULL;
|
|
||||||
if (zpool_read_label(fd, &config, NULL) != 0)
|
|
||||||
config = NULL;
|
|
||||||
if (close(fd))
|
|
||||||
perror("close");
|
|
||||||
|
|
||||||
if (config) {
|
|
||||||
char *name = NULL;
|
|
||||||
if (!nvlist_lookup_string(config,
|
|
||||||
ZPOOL_CONFIG_POOL_NAME, &name))
|
|
||||||
(void) strlcpy(*dataset, name, PATH_MAX);
|
|
||||||
nvlist_free(config);
|
|
||||||
if (name)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If a file or directory in your current working directory is
|
|
||||||
* named 'dataset' then mount(8) will prepend your current working
|
|
||||||
* directory to the dataset. There is no way to prevent this
|
|
||||||
* behavior so we simply check for it and strip the prepended
|
|
||||||
* patch when it is added.
|
|
||||||
*/
|
*/
|
||||||
char cwd[PATH_MAX];
|
char cwd[PATH_MAX];
|
||||||
if (getcwd(cwd, PATH_MAX) != NULL) {
|
if (getcwd(cwd, PATH_MAX) == NULL) {
|
||||||
int len = strlen(cwd);
|
perror("getcwd");
|
||||||
/* Do not add one when cwd already ends in a trailing '/' */
|
return;
|
||||||
if (strncmp(cwd, target, len) == 0)
|
|
||||||
target += len + (cwd[len-1] != '/');
|
|
||||||
}
|
}
|
||||||
|
int len = strlen(cwd);
|
||||||
|
if (strncmp(cwd, target, len) == 0)
|
||||||
|
target += len;
|
||||||
|
|
||||||
|
/* Assume pool/dataset is more likely */
|
||||||
strlcpy(*dataset, target, PATH_MAX);
|
strlcpy(*dataset, target, PATH_MAX);
|
||||||
|
|
||||||
|
int fd = open(target, O_RDONLY | O_CLOEXEC);
|
||||||
|
if (fd < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
nvlist_t *cfg = NULL;
|
||||||
|
if (zpool_read_label(fd, &cfg, NULL) == 0) {
|
||||||
|
char *nm = NULL;
|
||||||
|
if (!nvlist_lookup_string(cfg, ZPOOL_CONFIG_POOL_NAME, &nm))
|
||||||
|
strlcpy(*dataset, nm, PATH_MAX);
|
||||||
|
nvlist_free(cfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (close(fd))
|
||||||
|
perror("close");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -133,8 +125,8 @@ mtab_update(char *dataset, char *mntpoint, char *type, char *mntopts)
|
|||||||
if (!fp) {
|
if (!fp) {
|
||||||
(void) fprintf(stderr, gettext(
|
(void) fprintf(stderr, gettext(
|
||||||
"filesystem '%s' was mounted, but /etc/mtab "
|
"filesystem '%s' was mounted, but /etc/mtab "
|
||||||
"could not be opened due to error %d\n"),
|
"could not be opened due to error: %s\n"),
|
||||||
dataset, errno);
|
dataset, strerror(errno));
|
||||||
return (MOUNT_FILEIO);
|
return (MOUNT_FILEIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,8 +134,8 @@ mtab_update(char *dataset, char *mntpoint, char *type, char *mntopts)
|
|||||||
if (error) {
|
if (error) {
|
||||||
(void) fprintf(stderr, gettext(
|
(void) fprintf(stderr, gettext(
|
||||||
"filesystem '%s' was mounted, but /etc/mtab "
|
"filesystem '%s' was mounted, but /etc/mtab "
|
||||||
"could not be updated due to error %d\n"),
|
"could not be updated due to error: %s\n"),
|
||||||
dataset, errno);
|
dataset, strerror(errno));
|
||||||
return (MOUNT_FILEIO);
|
return (MOUNT_FILEIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,8 +215,8 @@ main(int argc, char **argv)
|
|||||||
/* canonicalize the mount point */
|
/* canonicalize the mount point */
|
||||||
if (realpath(argv[1], mntpoint) == NULL) {
|
if (realpath(argv[1], mntpoint) == NULL) {
|
||||||
(void) fprintf(stderr, gettext("filesystem '%s' cannot be "
|
(void) fprintf(stderr, gettext("filesystem '%s' cannot be "
|
||||||
"mounted at '%s' due to canonicalization error %d.\n"),
|
"mounted at '%s' due to canonicalization error: %s\n"),
|
||||||
dataset, argv[1], errno);
|
dataset, argv[1], strerror(errno));
|
||||||
return (MOUNT_SYSERR);
|
return (MOUNT_SYSERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,3 +18,5 @@ raidz_test_LDADD = \
|
|||||||
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la
|
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la
|
||||||
|
|
||||||
raidz_test_LDADD += -lm
|
raidz_test_LDADD += -lm
|
||||||
|
|
||||||
|
include $(top_srcdir)/config/CppCheck.am
|
||||||
|
|||||||
@@ -545,6 +545,7 @@ while getopts 'c:d:eg:mp:h' OPTION; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ ! -r $CONFIG ] ; then
|
if [ ! -r $CONFIG ] ; then
|
||||||
|
echo "Error: Config file \"$CONFIG\" not found"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -14,3 +14,5 @@ zdb_LDADD = \
|
|||||||
$(abs_top_builddir)/lib/libzpool/libzpool.la \
|
$(abs_top_builddir)/lib/libzpool/libzpool.la \
|
||||||
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
||||||
$(abs_top_builddir)/lib/libnvpair/libnvpair.la
|
$(abs_top_builddir)/lib/libnvpair/libnvpair.la
|
||||||
|
|
||||||
|
include $(top_srcdir)/config/CppCheck.am
|
||||||
|
|||||||
+18
-4
@@ -5840,7 +5840,8 @@ zdb_leak_init_prepare_indirect_vdevs(spa_t *spa, zdb_cb_t *zcb)
|
|||||||
*/
|
*/
|
||||||
VERIFY0(vdev_metaslab_init(vd, 0));
|
VERIFY0(vdev_metaslab_init(vd, 0));
|
||||||
|
|
||||||
vdev_indirect_mapping_t *vim = vd->vdev_indirect_mapping;
|
vdev_indirect_mapping_t *vim __maybe_unused =
|
||||||
|
vd->vdev_indirect_mapping;
|
||||||
uint64_t vim_idx = 0;
|
uint64_t vim_idx = 0;
|
||||||
for (uint64_t m = 0; m < vd->vdev_ms_count; m++) {
|
for (uint64_t m = 0; m < vd->vdev_ms_count; m++) {
|
||||||
|
|
||||||
@@ -6756,6 +6757,7 @@ import_checkpointed_state(char *target, nvlist_t *cfg, char **new_path)
|
|||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
char *poolname, *bogus_name = NULL;
|
char *poolname, *bogus_name = NULL;
|
||||||
|
boolean_t freecfg = B_FALSE;
|
||||||
|
|
||||||
/* If the target is not a pool, the extract the pool name */
|
/* If the target is not a pool, the extract the pool name */
|
||||||
char *path_start = strchr(target, '/');
|
char *path_start = strchr(target, '/');
|
||||||
@@ -6774,6 +6776,7 @@ import_checkpointed_state(char *target, nvlist_t *cfg, char **new_path)
|
|||||||
"spa_get_stats() failed with error %d\n",
|
"spa_get_stats() failed with error %d\n",
|
||||||
poolname, error);
|
poolname, error);
|
||||||
}
|
}
|
||||||
|
freecfg = B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (asprintf(&bogus_name, "%s%s", poolname, BOGUS_SUFFIX) == -1)
|
if (asprintf(&bogus_name, "%s%s", poolname, BOGUS_SUFFIX) == -1)
|
||||||
@@ -6783,6 +6786,8 @@ import_checkpointed_state(char *target, nvlist_t *cfg, char **new_path)
|
|||||||
error = spa_import(bogus_name, cfg, NULL,
|
error = spa_import(bogus_name, cfg, NULL,
|
||||||
ZFS_IMPORT_MISSING_LOG | ZFS_IMPORT_CHECKPOINT |
|
ZFS_IMPORT_MISSING_LOG | ZFS_IMPORT_CHECKPOINT |
|
||||||
ZFS_IMPORT_SKIP_MMP);
|
ZFS_IMPORT_SKIP_MMP);
|
||||||
|
if (freecfg)
|
||||||
|
nvlist_free(cfg);
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
fatal("Tried to import pool \"%s\" but spa_import() failed "
|
fatal("Tried to import pool \"%s\" but spa_import() failed "
|
||||||
"with error %d\n", bogus_name, error);
|
"with error %d\n", bogus_name, error);
|
||||||
@@ -6929,7 +6934,7 @@ verify_checkpoint_vdev_spacemaps(spa_t *checkpoint, spa_t *current)
|
|||||||
for (uint64_t c = ckpoint_rvd->vdev_children;
|
for (uint64_t c = ckpoint_rvd->vdev_children;
|
||||||
c < current_rvd->vdev_children; c++) {
|
c < current_rvd->vdev_children; c++) {
|
||||||
vdev_t *current_vd = current_rvd->vdev_child[c];
|
vdev_t *current_vd = current_rvd->vdev_child[c];
|
||||||
ASSERT3P(current_vd->vdev_checkpoint_sm, ==, NULL);
|
VERIFY3P(current_vd->vdev_checkpoint_sm, ==, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7011,7 +7016,6 @@ verify_checkpoint_blocks(spa_t *spa)
|
|||||||
|
|
||||||
spa_t *checkpoint_spa;
|
spa_t *checkpoint_spa;
|
||||||
char *checkpoint_pool;
|
char *checkpoint_pool;
|
||||||
nvlist_t *config = NULL;
|
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -7019,7 +7023,7 @@ verify_checkpoint_blocks(spa_t *spa)
|
|||||||
* name) so we can do verification on it against the current state
|
* name) so we can do verification on it against the current state
|
||||||
* of the pool.
|
* of the pool.
|
||||||
*/
|
*/
|
||||||
checkpoint_pool = import_checkpointed_state(spa->spa_name, config,
|
checkpoint_pool = import_checkpointed_state(spa->spa_name, NULL,
|
||||||
NULL);
|
NULL);
|
||||||
ASSERT(strcmp(spa->spa_name, checkpoint_pool) != 0);
|
ASSERT(strcmp(spa->spa_name, checkpoint_pool) != 0);
|
||||||
|
|
||||||
@@ -8429,6 +8433,11 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (searchdirs != NULL) {
|
||||||
|
umem_free(searchdirs, nsearch * sizeof (char *));
|
||||||
|
searchdirs = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* import_checkpointed_state makes the assumption that the
|
* import_checkpointed_state makes the assumption that the
|
||||||
* target pool that we pass it is already part of the spa
|
* target pool that we pass it is already part of the spa
|
||||||
@@ -8447,6 +8456,11 @@ main(int argc, char **argv)
|
|||||||
target = checkpoint_target;
|
target = checkpoint_target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cfg != NULL) {
|
||||||
|
nvlist_free(cfg);
|
||||||
|
cfg = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (target_pool != target)
|
if (target_pool != target)
|
||||||
free(target_pool);
|
free(target_pool);
|
||||||
|
|
||||||
|
|||||||
@@ -47,3 +47,5 @@ zed_LDADD += -lrt $(LIBUDEV_LIBS) $(LIBUUID_LIBS)
|
|||||||
zed_LDFLAGS = -pthread
|
zed_LDFLAGS = -pthread
|
||||||
|
|
||||||
EXTRA_DIST = agents/README.md
|
EXTRA_DIST = agents/README.md
|
||||||
|
|
||||||
|
include $(top_srcdir)/config/CppCheck.am
|
||||||
|
|||||||
@@ -181,6 +181,8 @@ zfs_agent_post_event(const char *class, const char *subclass, nvlist_t *nvl)
|
|||||||
* from the vdev_disk layer after a hot unplug. Fortunately we do
|
* from the vdev_disk layer after a hot unplug. Fortunately we do
|
||||||
* get an EC_DEV_REMOVE from our disk monitor and it is a suitable
|
* get an EC_DEV_REMOVE from our disk monitor and it is a suitable
|
||||||
* proxy so we remap it here for the benefit of the diagnosis engine.
|
* proxy so we remap it here for the benefit of the diagnosis engine.
|
||||||
|
* Starting in OpenZFS 2.0, we do get FM_RESOURCE_REMOVED from the spa
|
||||||
|
* layer. Processing multiple FM_RESOURCE_REMOVED events is not harmful.
|
||||||
*/
|
*/
|
||||||
if ((strcmp(class, EC_DEV_REMOVE) == 0) &&
|
if ((strcmp(class, EC_DEV_REMOVE) == 0) &&
|
||||||
(strcmp(subclass, ESC_DISK) == 0) &&
|
(strcmp(subclass, ESC_DISK) == 0) &&
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ FSLIST="${FSLIST_DIR}/${ZEVENT_POOL}"
|
|||||||
[ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc"
|
[ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc"
|
||||||
. "${ZED_ZEDLET_DIR}/zed-functions.sh"
|
. "${ZED_ZEDLET_DIR}/zed-functions.sh"
|
||||||
|
|
||||||
zed_exit_if_ignoring_this_event
|
[ "$ZEVENT_SUBCLASS" != "history_event" ] && exit 0
|
||||||
zed_check_cmd "${ZFS}" sort diff grep
|
zed_check_cmd "${ZFS}" sort diff grep
|
||||||
|
|
||||||
# If we are acting on a snapshot, we have nothing to do
|
# If we are acting on a snapshot, we have nothing to do
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ _zed_exec_fork_child(uint64_t eid, const char *dir, const char *prog,
|
|||||||
zed_log_msg(LOG_WARNING, "Killing hung \"%s\" pid=%d",
|
zed_log_msg(LOG_WARNING, "Killing hung \"%s\" pid=%d",
|
||||||
prog, pid);
|
prog, pid);
|
||||||
(void) kill(pid, SIGKILL);
|
(void) kill(pid, SIGKILL);
|
||||||
|
(void) waitpid(pid, &status, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,3 +21,5 @@ 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
|
||||||
|
|||||||
+1
-4
@@ -6790,9 +6790,6 @@ report_mount_progress(int current, int total)
|
|||||||
time_t now = time(NULL);
|
time_t now = time(NULL);
|
||||||
char info[32];
|
char info[32];
|
||||||
|
|
||||||
/* report 1..n instead of 0..n-1 */
|
|
||||||
++current;
|
|
||||||
|
|
||||||
/* display header if we're here for the first time */
|
/* display header if we're here for the first time */
|
||||||
if (current == 1) {
|
if (current == 1) {
|
||||||
set_progress_header(gettext("Mounting ZFS filesystems"));
|
set_progress_header(gettext("Mounting ZFS filesystems"));
|
||||||
@@ -8370,7 +8367,7 @@ zfs_do_wait(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
boolean_t enabled[ZFS_WAIT_NUM_ACTIVITIES];
|
boolean_t enabled[ZFS_WAIT_NUM_ACTIVITIES];
|
||||||
int error, i;
|
int error, i;
|
||||||
char c;
|
int c;
|
||||||
|
|
||||||
/* By default, wait for all types of activity. */
|
/* By default, wait for all types of activity. */
|
||||||
for (i = 0; i < ZFS_WAIT_NUM_ACTIVITIES; i++)
|
for (i = 0; i < ZFS_WAIT_NUM_ACTIVITIES; i++)
|
||||||
|
|||||||
@@ -7,3 +7,5 @@ zfs_ids_to_path_SOURCES = \
|
|||||||
|
|
||||||
zfs_ids_to_path_LDADD = \
|
zfs_ids_to_path_LDADD = \
|
||||||
$(abs_top_builddir)/lib/libzfs/libzfs.la
|
$(abs_top_builddir)/lib/libzfs/libzfs.la
|
||||||
|
|
||||||
|
include $(top_srcdir)/config/CppCheck.am
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ int
|
|||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
boolean_t verbose = B_FALSE;
|
boolean_t verbose = B_FALSE;
|
||||||
char c;
|
int c;
|
||||||
while ((c = getopt(argc, argv, "v")) != -1) {
|
while ((c = getopt(argc, argv, "v")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'v':
|
case 'v':
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
include $(top_srcdir)/config/Rules.am
|
||||||
|
|
||||||
bin_PROGRAMS = zgenhostid
|
sbin_PROGRAMS = zgenhostid
|
||||||
|
|
||||||
zgenhostid_SOURCES = zgenhostid.c
|
zgenhostid_SOURCES = zgenhostid.c
|
||||||
|
|
||||||
|
include $(top_srcdir)/config/CppCheck.am
|
||||||
|
|||||||
@@ -12,3 +12,5 @@ zhack_LDADD = \
|
|||||||
$(abs_top_builddir)/lib/libzpool/libzpool.la \
|
$(abs_top_builddir)/lib/libzpool/libzpool.la \
|
||||||
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
||||||
$(abs_top_builddir)/lib/libnvpair/libnvpair.la
|
$(abs_top_builddir)/lib/libnvpair/libnvpair.la
|
||||||
|
|
||||||
|
include $(top_srcdir)/config/CppCheck.am
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ zhack_import(char *target, boolean_t readonly)
|
|||||||
zfeature_checks_disable = B_TRUE;
|
zfeature_checks_disable = B_TRUE;
|
||||||
error = spa_import(target, config, props,
|
error = spa_import(target, config, props,
|
||||||
(readonly ? ZFS_IMPORT_SKIP_MMP : ZFS_IMPORT_NORMAL));
|
(readonly ? ZFS_IMPORT_SKIP_MMP : ZFS_IMPORT_NORMAL));
|
||||||
|
fnvlist_free(config);
|
||||||
zfeature_checks_disable = B_FALSE;
|
zfeature_checks_disable = B_FALSE;
|
||||||
if (error == EEXIST)
|
if (error == EEXIST)
|
||||||
error = 0;
|
error = 0;
|
||||||
|
|||||||
@@ -11,3 +11,5 @@ zinject_LDADD = \
|
|||||||
$(abs_top_builddir)/lib/libzfs/libzfs.la \
|
$(abs_top_builddir)/lib/libzfs/libzfs.la \
|
||||||
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
||||||
$(abs_top_builddir)/lib/libnvpair/libnvpair.la
|
$(abs_top_builddir)/lib/libnvpair/libnvpair.la
|
||||||
|
|
||||||
|
include $(top_srcdir)/config/CppCheck.am
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ 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
|
||||||
|
|
||||||
zpoolconfdir = $(sysconfdir)/zfs/zpool.d
|
zpoolconfdir = $(sysconfdir)/zfs/zpool.d
|
||||||
zpoolexecdir = $(zfsexecdir)/zpool.d
|
zpoolexecdir = $(zfsexecdir)/zpool.d
|
||||||
|
|
||||||
|
|||||||
+281
-134
@@ -669,9 +669,16 @@ print_vdev_tree(zpool_handle_t *zhp, const char *name, nvlist_t *nv, int indent,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (c = 0; c < children; c++) {
|
for (c = 0; c < children; c++) {
|
||||||
uint64_t is_log = B_FALSE;
|
uint64_t is_log = B_FALSE, is_hole = B_FALSE;
|
||||||
char *class = "";
|
char *class = "";
|
||||||
|
|
||||||
|
(void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_HOLE,
|
||||||
|
&is_hole);
|
||||||
|
|
||||||
|
if (is_hole == B_TRUE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
(void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
|
(void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
|
||||||
&is_log);
|
&is_log);
|
||||||
if (is_log)
|
if (is_log)
|
||||||
@@ -692,6 +699,54 @@ print_vdev_tree(zpool_handle_t *zhp, const char *name, nvlist_t *nv, int indent,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print the list of l2cache devices for dry runs.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
print_cache_list(nvlist_t *nv, int indent)
|
||||||
|
{
|
||||||
|
nvlist_t **child;
|
||||||
|
uint_t c, children;
|
||||||
|
|
||||||
|
if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_L2CACHE,
|
||||||
|
&child, &children) == 0 && children > 0) {
|
||||||
|
(void) printf("\t%*s%s\n", indent, "", "cache");
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (c = 0; c < children; c++) {
|
||||||
|
char *vname;
|
||||||
|
|
||||||
|
vname = zpool_vdev_name(g_zfs, NULL, child[c], 0);
|
||||||
|
(void) printf("\t%*s%s\n", indent + 2, "", vname);
|
||||||
|
free(vname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print the list of spares for dry runs.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
print_spare_list(nvlist_t *nv, int indent)
|
||||||
|
{
|
||||||
|
nvlist_t **child;
|
||||||
|
uint_t c, children;
|
||||||
|
|
||||||
|
if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_SPARES,
|
||||||
|
&child, &children) == 0 && children > 0) {
|
||||||
|
(void) printf("\t%*s%s\n", indent, "", "spares");
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (c = 0; c < children; c++) {
|
||||||
|
char *vname;
|
||||||
|
|
||||||
|
vname = zpool_vdev_name(g_zfs, NULL, child[c], 0);
|
||||||
|
(void) printf("\t%*s%s\n", indent + 2, "", vname);
|
||||||
|
free(vname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static boolean_t
|
static boolean_t
|
||||||
prop_list_contains_feature(nvlist_t *proplist)
|
prop_list_contains_feature(nvlist_t *proplist)
|
||||||
{
|
{
|
||||||
@@ -921,16 +976,16 @@ zpool_do_add(int argc, char **argv)
|
|||||||
|
|
||||||
if (dryrun) {
|
if (dryrun) {
|
||||||
nvlist_t *poolnvroot;
|
nvlist_t *poolnvroot;
|
||||||
nvlist_t **l2child;
|
nvlist_t **l2child, **sparechild;
|
||||||
uint_t l2children, c;
|
uint_t l2children, sparechildren, c;
|
||||||
char *vname;
|
char *vname;
|
||||||
boolean_t hadcache = B_FALSE;
|
boolean_t hadcache = B_FALSE, hadspare = B_FALSE;
|
||||||
|
|
||||||
verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
|
verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
|
||||||
&poolnvroot) == 0);
|
&poolnvroot) == 0);
|
||||||
|
|
||||||
(void) printf(gettext("would update '%s' to the following "
|
(void) printf(gettext("would update '%s' to the following "
|
||||||
"configuration:\n"), zpool_get_name(zhp));
|
"configuration:\n\n"), zpool_get_name(zhp));
|
||||||
|
|
||||||
/* print original main pool and new tree */
|
/* print original main pool and new tree */
|
||||||
print_vdev_tree(zhp, poolname, poolnvroot, 0, "",
|
print_vdev_tree(zhp, poolname, poolnvroot, 0, "",
|
||||||
@@ -991,6 +1046,29 @@ zpool_do_add(int argc, char **argv)
|
|||||||
free(vname);
|
free(vname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* And finaly the spares */
|
||||||
|
if (nvlist_lookup_nvlist_array(poolnvroot, ZPOOL_CONFIG_SPARES,
|
||||||
|
&sparechild, &sparechildren) == 0 && sparechildren > 0) {
|
||||||
|
hadspare = B_TRUE;
|
||||||
|
(void) printf(gettext("\tspares\n"));
|
||||||
|
for (c = 0; c < sparechildren; c++) {
|
||||||
|
vname = zpool_vdev_name(g_zfs, NULL,
|
||||||
|
sparechild[c], name_flags);
|
||||||
|
(void) printf("\t %s\n", vname);
|
||||||
|
free(vname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES,
|
||||||
|
&sparechild, &sparechildren) == 0 && sparechildren > 0) {
|
||||||
|
if (!hadspare)
|
||||||
|
(void) printf(gettext("\tspares\n"));
|
||||||
|
for (c = 0; c < sparechildren; c++) {
|
||||||
|
vname = zpool_vdev_name(g_zfs, NULL,
|
||||||
|
sparechild[c], name_flags);
|
||||||
|
(void) printf("\t %s\n", vname);
|
||||||
|
free(vname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
} else {
|
} else {
|
||||||
@@ -1548,6 +1626,8 @@ zpool_do_create(int argc, char **argv)
|
|||||||
VDEV_ALLOC_BIAS_SPECIAL, 0);
|
VDEV_ALLOC_BIAS_SPECIAL, 0);
|
||||||
print_vdev_tree(NULL, "logs", nvroot, 0,
|
print_vdev_tree(NULL, "logs", nvroot, 0,
|
||||||
VDEV_ALLOC_BIAS_LOG, 0);
|
VDEV_ALLOC_BIAS_LOG, 0);
|
||||||
|
print_cache_list(nvroot, 0);
|
||||||
|
print_spare_list(nvroot, 0);
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
} else {
|
} else {
|
||||||
@@ -2506,8 +2586,8 @@ print_class_vdevs(zpool_handle_t *zhp, status_cbdata_t *cb, nvlist_t *nv,
|
|||||||
/*
|
/*
|
||||||
* Display the status for the given pool.
|
* Display the status for the given pool.
|
||||||
*/
|
*/
|
||||||
static void
|
static int
|
||||||
show_import(nvlist_t *config)
|
show_import(nvlist_t *config, boolean_t report_error)
|
||||||
{
|
{
|
||||||
uint64_t pool_state;
|
uint64_t pool_state;
|
||||||
vdev_stat_t *vs;
|
vdev_stat_t *vs;
|
||||||
@@ -2539,6 +2619,13 @@ show_import(nvlist_t *config)
|
|||||||
|
|
||||||
reason = zpool_import_status(config, &msgid, &errata);
|
reason = zpool_import_status(config, &msgid, &errata);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If we're importing using a cachefile, then we won't report any
|
||||||
|
* errors unless we are in the scan phase of the import.
|
||||||
|
*/
|
||||||
|
if (reason != ZPOOL_STATUS_OK && !report_error)
|
||||||
|
return (reason);
|
||||||
|
|
||||||
(void) printf(gettext(" pool: %s\n"), name);
|
(void) printf(gettext(" pool: %s\n"), name);
|
||||||
(void) printf(gettext(" id: %llu\n"), (u_longlong_t)guid);
|
(void) printf(gettext(" id: %llu\n"), (u_longlong_t)guid);
|
||||||
(void) printf(gettext(" state: %s"), health);
|
(void) printf(gettext(" state: %s"), health);
|
||||||
@@ -2853,6 +2940,7 @@ show_import(nvlist_t *config)
|
|||||||
"be part of this pool, though their\n\texact "
|
"be part of this pool, though their\n\texact "
|
||||||
"configuration cannot be determined.\n"));
|
"configuration cannot be determined.\n"));
|
||||||
}
|
}
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean_t
|
static boolean_t
|
||||||
@@ -2991,6 +3079,121 @@ do_import(nvlist_t *config, const char *newname, const char *mntopts,
|
|||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
import_pools(nvlist_t *pools, nvlist_t *props, char *mntopts, int flags,
|
||||||
|
char *orig_name, char *new_name,
|
||||||
|
boolean_t do_destroyed, boolean_t pool_specified, boolean_t do_all,
|
||||||
|
importargs_t *import)
|
||||||
|
{
|
||||||
|
nvlist_t *config = NULL;
|
||||||
|
nvlist_t *found_config = NULL;
|
||||||
|
uint64_t pool_state;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* At this point we have a list of import candidate configs. Even if
|
||||||
|
* we were searching by pool name or guid, we still need to
|
||||||
|
* post-process the list to deal with pool state and possible
|
||||||
|
* duplicate names.
|
||||||
|
*/
|
||||||
|
int err = 0;
|
||||||
|
nvpair_t *elem = NULL;
|
||||||
|
boolean_t first = B_TRUE;
|
||||||
|
while ((elem = nvlist_next_nvpair(pools, elem)) != NULL) {
|
||||||
|
|
||||||
|
verify(nvpair_value_nvlist(elem, &config) == 0);
|
||||||
|
|
||||||
|
verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_STATE,
|
||||||
|
&pool_state) == 0);
|
||||||
|
if (!do_destroyed && pool_state == POOL_STATE_DESTROYED)
|
||||||
|
continue;
|
||||||
|
if (do_destroyed && pool_state != POOL_STATE_DESTROYED)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
verify(nvlist_add_nvlist(config, ZPOOL_LOAD_POLICY,
|
||||||
|
import->policy) == 0);
|
||||||
|
|
||||||
|
if (!pool_specified) {
|
||||||
|
if (first)
|
||||||
|
first = B_FALSE;
|
||||||
|
else if (!do_all)
|
||||||
|
(void) printf("\n");
|
||||||
|
|
||||||
|
if (do_all) {
|
||||||
|
err |= do_import(config, NULL, mntopts,
|
||||||
|
props, flags);
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
* If we're importing from cachefile, then
|
||||||
|
* we don't want to report errors until we
|
||||||
|
* are in the scan phase of the import. If
|
||||||
|
* we get an error, then we return that error
|
||||||
|
* to invoke the scan phase.
|
||||||
|
*/
|
||||||
|
if (import->cachefile && !import->scan)
|
||||||
|
err = show_import(config, B_FALSE);
|
||||||
|
else
|
||||||
|
(void) show_import(config, B_TRUE);
|
||||||
|
}
|
||||||
|
} else if (import->poolname != NULL) {
|
||||||
|
char *name;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We are searching for a pool based on name.
|
||||||
|
*/
|
||||||
|
verify(nvlist_lookup_string(config,
|
||||||
|
ZPOOL_CONFIG_POOL_NAME, &name) == 0);
|
||||||
|
|
||||||
|
if (strcmp(name, import->poolname) == 0) {
|
||||||
|
if (found_config != NULL) {
|
||||||
|
(void) fprintf(stderr, gettext(
|
||||||
|
"cannot import '%s': more than "
|
||||||
|
"one matching pool\n"),
|
||||||
|
import->poolname);
|
||||||
|
(void) fprintf(stderr, gettext(
|
||||||
|
"import by numeric ID instead\n"));
|
||||||
|
err = B_TRUE;
|
||||||
|
}
|
||||||
|
found_config = config;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uint64_t guid;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Search for a pool by guid.
|
||||||
|
*/
|
||||||
|
verify(nvlist_lookup_uint64(config,
|
||||||
|
ZPOOL_CONFIG_POOL_GUID, &guid) == 0);
|
||||||
|
|
||||||
|
if (guid == import->guid)
|
||||||
|
found_config = config;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If we were searching for a specific pool, verify that we found a
|
||||||
|
* pool, and then do the import.
|
||||||
|
*/
|
||||||
|
if (pool_specified && err == 0) {
|
||||||
|
if (found_config == NULL) {
|
||||||
|
(void) fprintf(stderr, gettext("cannot import '%s': "
|
||||||
|
"no such pool available\n"), orig_name);
|
||||||
|
err = B_TRUE;
|
||||||
|
} else {
|
||||||
|
err |= do_import(found_config, new_name,
|
||||||
|
mntopts, props, flags);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If we were just looking for pools, report an error if none were
|
||||||
|
* found.
|
||||||
|
*/
|
||||||
|
if (!pool_specified && first)
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
gettext("no pools available to import\n"));
|
||||||
|
return (err);
|
||||||
|
}
|
||||||
|
|
||||||
typedef struct target_exists_args {
|
typedef struct target_exists_args {
|
||||||
const char *poolname;
|
const char *poolname;
|
||||||
uint64_t poolguid;
|
uint64_t poolguid;
|
||||||
@@ -3118,51 +3321,54 @@ zpool_do_checkpoint(int argc, char **argv)
|
|||||||
/*
|
/*
|
||||||
* zpool import [-d dir] [-D]
|
* zpool import [-d dir] [-D]
|
||||||
* import [-o mntopts] [-o prop=value] ... [-R root] [-D] [-l]
|
* import [-o mntopts] [-o prop=value] ... [-R root] [-D] [-l]
|
||||||
* [-d dir | -c cachefile] [-f] -a
|
* [-d dir | -c cachefile | -s] [-f] -a
|
||||||
* import [-o mntopts] [-o prop=value] ... [-R root] [-D] [-l]
|
* import [-o mntopts] [-o prop=value] ... [-R root] [-D] [-l]
|
||||||
* [-d dir | -c cachefile] [-f] [-n] [-F] <pool | id> [newpool]
|
* [-d dir | -c cachefile | -s] [-f] [-n] [-F] <pool | id>
|
||||||
|
* [newpool]
|
||||||
*
|
*
|
||||||
* -c Read pool information from a cachefile instead of searching
|
* -c Read pool information from a cachefile instead of searching
|
||||||
* devices.
|
* devices. If importing from a cachefile config fails, then
|
||||||
|
* fallback to searching for devices only in the directories that
|
||||||
|
* exist in the cachefile.
|
||||||
*
|
*
|
||||||
* -d Scan in a specific directory, other than /dev/. More than
|
* -d Scan in a specific directory, other than /dev/. More than
|
||||||
* one directory can be specified using multiple '-d' options.
|
* one directory can be specified using multiple '-d' options.
|
||||||
*
|
*
|
||||||
* -D Scan for previously destroyed pools or import all or only
|
* -D Scan for previously destroyed pools or import all or only
|
||||||
* specified destroyed pools.
|
* specified destroyed pools.
|
||||||
*
|
*
|
||||||
* -R Temporarily import the pool, with all mountpoints relative to
|
* -R Temporarily import the pool, with all mountpoints relative to
|
||||||
* the given root. The pool will remain exported when the machine
|
* the given root. The pool will remain exported when the machine
|
||||||
* is rebooted.
|
* is rebooted.
|
||||||
*
|
*
|
||||||
* -V Import even in the presence of faulted vdevs. This is an
|
* -V Import even in the presence of faulted vdevs. This is an
|
||||||
* intentionally undocumented option for testing purposes, and
|
* intentionally undocumented option for testing purposes, and
|
||||||
* treats the pool configuration as complete, leaving any bad
|
* treats the pool configuration as complete, leaving any bad
|
||||||
* vdevs in the FAULTED state. In other words, it does verbatim
|
* vdevs in the FAULTED state. In other words, it does verbatim
|
||||||
* import.
|
* import.
|
||||||
*
|
*
|
||||||
* -f Force import, even if it appears that the pool is active.
|
* -f Force import, even if it appears that the pool is active.
|
||||||
*
|
*
|
||||||
* -F Attempt rewind if necessary.
|
* -F Attempt rewind if necessary.
|
||||||
*
|
*
|
||||||
* -n See if rewind would work, but don't actually rewind.
|
* -n See if rewind would work, but don't actually rewind.
|
||||||
*
|
*
|
||||||
* -N Import the pool but don't mount datasets.
|
* -N Import the pool but don't mount datasets.
|
||||||
*
|
*
|
||||||
* -T Specify a starting txg to use for import. This option is
|
* -T Specify a starting txg to use for import. This option is
|
||||||
* intentionally undocumented option for testing purposes.
|
* intentionally undocumented option for testing purposes.
|
||||||
*
|
*
|
||||||
* -a Import all pools found.
|
* -a Import all pools found.
|
||||||
*
|
*
|
||||||
* -l Load encryption keys while importing.
|
* -l Load encryption keys while importing.
|
||||||
*
|
*
|
||||||
* -o Set property=value and/or temporary mount options (without '=').
|
* -o Set property=value and/or temporary mount options (without '=').
|
||||||
*
|
*
|
||||||
* -s Scan using the default search path, the libblkid cache will
|
* -s Scan using the default search path, the libblkid cache will
|
||||||
* not be consulted.
|
* not be consulted.
|
||||||
*
|
*
|
||||||
* --rewind-to-checkpoint
|
* --rewind-to-checkpoint
|
||||||
* Import the pool and revert back to the checkpoint.
|
* Import the pool and revert back to the checkpoint.
|
||||||
*
|
*
|
||||||
* The import command scans for pools to import, and import pools based on pool
|
* The import command scans for pools to import, and import pools based on pool
|
||||||
* name and GUID. The pool can also be renamed as part of the import process.
|
* name and GUID. The pool can also be renamed as part of the import process.
|
||||||
@@ -3179,15 +3385,11 @@ zpool_do_import(int argc, char **argv)
|
|||||||
boolean_t do_all = B_FALSE;
|
boolean_t do_all = B_FALSE;
|
||||||
boolean_t do_destroyed = B_FALSE;
|
boolean_t do_destroyed = B_FALSE;
|
||||||
char *mntopts = NULL;
|
char *mntopts = NULL;
|
||||||
nvpair_t *elem;
|
|
||||||
nvlist_t *config;
|
|
||||||
uint64_t searchguid = 0;
|
uint64_t searchguid = 0;
|
||||||
char *searchname = NULL;
|
char *searchname = NULL;
|
||||||
char *propval;
|
char *propval;
|
||||||
nvlist_t *found_config;
|
|
||||||
nvlist_t *policy = NULL;
|
nvlist_t *policy = NULL;
|
||||||
nvlist_t *props = NULL;
|
nvlist_t *props = NULL;
|
||||||
boolean_t first;
|
|
||||||
int flags = ZFS_IMPORT_NORMAL;
|
int flags = ZFS_IMPORT_NORMAL;
|
||||||
uint32_t rewind_policy = ZPOOL_NO_REWIND;
|
uint32_t rewind_policy = ZPOOL_NO_REWIND;
|
||||||
boolean_t dryrun = B_FALSE;
|
boolean_t dryrun = B_FALSE;
|
||||||
@@ -3195,7 +3397,8 @@ zpool_do_import(int argc, char **argv)
|
|||||||
boolean_t xtreme_rewind = B_FALSE;
|
boolean_t xtreme_rewind = B_FALSE;
|
||||||
boolean_t do_scan = B_FALSE;
|
boolean_t do_scan = B_FALSE;
|
||||||
boolean_t pool_exists = B_FALSE;
|
boolean_t pool_exists = B_FALSE;
|
||||||
uint64_t pool_state, txg = -1ULL;
|
boolean_t pool_specified = B_FALSE;
|
||||||
|
uint64_t txg = -1ULL;
|
||||||
char *cachefile = NULL;
|
char *cachefile = NULL;
|
||||||
importargs_t idata = { 0 };
|
importargs_t idata = { 0 };
|
||||||
char *endptr;
|
char *endptr;
|
||||||
@@ -3317,6 +3520,11 @@ zpool_do_import(int argc, char **argv)
|
|||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cachefile && do_scan) {
|
||||||
|
(void) fprintf(stderr, gettext("-c is incompatible with -s\n"));
|
||||||
|
usage(B_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
if ((flags & ZFS_IMPORT_LOAD_KEYS) && (flags & ZFS_IMPORT_ONLY)) {
|
if ((flags & ZFS_IMPORT_LOAD_KEYS) && (flags & ZFS_IMPORT_ONLY)) {
|
||||||
(void) fprintf(stderr, gettext("-l is incompatible with -N\n"));
|
(void) fprintf(stderr, gettext("-l is incompatible with -N\n"));
|
||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
@@ -3397,7 +3605,7 @@ zpool_do_import(int argc, char **argv)
|
|||||||
searchname = argv[0];
|
searchname = argv[0];
|
||||||
searchguid = 0;
|
searchguid = 0;
|
||||||
}
|
}
|
||||||
found_config = NULL;
|
pool_specified = B_TRUE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* User specified a name or guid. Ensure it's unique.
|
* User specified a name or guid. Ensure it's unique.
|
||||||
@@ -3476,98 +3684,33 @@ zpool_do_import(int argc, char **argv)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = import_pools(pools, props, mntopts, flags, argv[0],
|
||||||
|
argc == 1 ? NULL : argv[1], do_destroyed, pool_specified,
|
||||||
|
do_all, &idata);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* At this point we have a list of import candidate configs. Even if
|
* If we're using the cachefile and we failed to import, then
|
||||||
* we were searching by pool name or guid, we still need to
|
* fallback to scanning the directory for pools that match
|
||||||
* post-process the list to deal with pool state and possible
|
* those in the cachefile.
|
||||||
* duplicate names.
|
|
||||||
*/
|
*/
|
||||||
err = 0;
|
if (err != 0 && cachefile != NULL) {
|
||||||
elem = NULL;
|
(void) printf(gettext("cachefile import failed, retrying\n"));
|
||||||
first = B_TRUE;
|
|
||||||
while ((elem = nvlist_next_nvpair(pools, elem)) != NULL) {
|
|
||||||
|
|
||||||
verify(nvpair_value_nvlist(elem, &config) == 0);
|
/*
|
||||||
|
* We use the scan flag to gather the directories that exist
|
||||||
|
* in the cachefile. If we need to fallback to searching for
|
||||||
|
* the pool config, we will only search devices in these
|
||||||
|
* directories.
|
||||||
|
*/
|
||||||
|
idata.scan = B_TRUE;
|
||||||
|
nvlist_free(pools);
|
||||||
|
pools = zpool_search_import(g_zfs, &idata, &libzfs_config_ops);
|
||||||
|
|
||||||
verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_STATE,
|
err = import_pools(pools, props, mntopts, flags, argv[0],
|
||||||
&pool_state) == 0);
|
argc == 1 ? NULL : argv[1], do_destroyed, pool_specified,
|
||||||
if (!do_destroyed && pool_state == POOL_STATE_DESTROYED)
|
do_all, &idata);
|
||||||
continue;
|
|
||||||
if (do_destroyed && pool_state != POOL_STATE_DESTROYED)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
verify(nvlist_add_nvlist(config, ZPOOL_LOAD_POLICY,
|
|
||||||
policy) == 0);
|
|
||||||
|
|
||||||
if (argc == 0) {
|
|
||||||
if (first)
|
|
||||||
first = B_FALSE;
|
|
||||||
else if (!do_all)
|
|
||||||
(void) printf("\n");
|
|
||||||
|
|
||||||
if (do_all) {
|
|
||||||
err |= do_import(config, NULL, mntopts,
|
|
||||||
props, flags);
|
|
||||||
} else {
|
|
||||||
show_import(config);
|
|
||||||
}
|
|
||||||
} else if (searchname != NULL) {
|
|
||||||
char *name;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* We are searching for a pool based on name.
|
|
||||||
*/
|
|
||||||
verify(nvlist_lookup_string(config,
|
|
||||||
ZPOOL_CONFIG_POOL_NAME, &name) == 0);
|
|
||||||
|
|
||||||
if (strcmp(name, searchname) == 0) {
|
|
||||||
if (found_config != NULL) {
|
|
||||||
(void) fprintf(stderr, gettext(
|
|
||||||
"cannot import '%s': more than "
|
|
||||||
"one matching pool\n"), searchname);
|
|
||||||
(void) fprintf(stderr, gettext(
|
|
||||||
"import by numeric ID instead\n"));
|
|
||||||
err = B_TRUE;
|
|
||||||
}
|
|
||||||
found_config = config;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
uint64_t guid;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Search for a pool by guid.
|
|
||||||
*/
|
|
||||||
verify(nvlist_lookup_uint64(config,
|
|
||||||
ZPOOL_CONFIG_POOL_GUID, &guid) == 0);
|
|
||||||
|
|
||||||
if (guid == searchguid)
|
|
||||||
found_config = config;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* If we were searching for a specific pool, verify that we found a
|
|
||||||
* pool, and then do the import.
|
|
||||||
*/
|
|
||||||
if (argc != 0 && err == 0) {
|
|
||||||
if (found_config == NULL) {
|
|
||||||
(void) fprintf(stderr, gettext("cannot import '%s': "
|
|
||||||
"no such pool available\n"), argv[0]);
|
|
||||||
err = B_TRUE;
|
|
||||||
} else {
|
|
||||||
err |= do_import(found_config, argc == 1 ? NULL :
|
|
||||||
argv[1], mntopts, props, flags);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If we were just looking for pools, report an error if none were
|
|
||||||
* found.
|
|
||||||
*/
|
|
||||||
if (argc == 0 && first)
|
|
||||||
(void) fprintf(stderr,
|
|
||||||
gettext("no pools available to import\n"));
|
|
||||||
|
|
||||||
error:
|
error:
|
||||||
nvlist_free(props);
|
nvlist_free(props);
|
||||||
nvlist_free(pools);
|
nvlist_free(pools);
|
||||||
@@ -4772,8 +4915,8 @@ get_interval_count(int *argcp, char **argv, float *iv,
|
|||||||
|
|
||||||
if (*end == '\0' && errno == 0) {
|
if (*end == '\0' && errno == 0) {
|
||||||
if (interval == 0) {
|
if (interval == 0) {
|
||||||
(void) fprintf(stderr, gettext("interval "
|
(void) fprintf(stderr, gettext(
|
||||||
"cannot be zero\n"));
|
"interval cannot be zero\n"));
|
||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -4803,8 +4946,8 @@ get_interval_count(int *argcp, char **argv, float *iv,
|
|||||||
|
|
||||||
if (*end == '\0' && errno == 0) {
|
if (*end == '\0' && errno == 0) {
|
||||||
if (interval == 0) {
|
if (interval == 0) {
|
||||||
(void) fprintf(stderr, gettext("interval "
|
(void) fprintf(stderr, gettext(
|
||||||
"cannot be zero\n"));
|
"interval cannot be zero\n"));
|
||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5807,7 +5950,7 @@ print_one_column(zpool_prop_t prop, uint64_t value, const char *str,
|
|||||||
break;
|
break;
|
||||||
case ZPOOL_PROP_HEALTH:
|
case ZPOOL_PROP_HEALTH:
|
||||||
width = 8;
|
width = 8;
|
||||||
snprintf(propval, sizeof (propval), "%-*s", (int)width, str);
|
(void) strlcpy(propval, str, sizeof (propval));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
zfs_nicenum_format(value, propval, sizeof (propval), format);
|
zfs_nicenum_format(value, propval, sizeof (propval), format);
|
||||||
@@ -6515,6 +6658,10 @@ zpool_do_split(int argc, char **argv)
|
|||||||
"following layout:\n\n"), newpool);
|
"following layout:\n\n"), newpool);
|
||||||
print_vdev_tree(NULL, newpool, config, 0, "",
|
print_vdev_tree(NULL, newpool, config, 0, "",
|
||||||
flags.name_flags);
|
flags.name_flags);
|
||||||
|
print_vdev_tree(NULL, "dedup", config, 0,
|
||||||
|
VDEV_ALLOC_BIAS_DEDUP, 0);
|
||||||
|
print_vdev_tree(NULL, "special", config, 0,
|
||||||
|
VDEV_ALLOC_BIAS_SPECIAL, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7595,7 +7742,7 @@ print_removal_status(zpool_handle_t *zhp, pool_removal_stat_t *prs)
|
|||||||
vdev_name = zpool_vdev_name(g_zfs, zhp,
|
vdev_name = zpool_vdev_name(g_zfs, zhp,
|
||||||
child[prs->prs_removing_vdev], B_TRUE);
|
child[prs->prs_removing_vdev], B_TRUE);
|
||||||
|
|
||||||
(void) printf(gettext("remove: "));
|
printf_color(ANSI_BOLD, gettext("remove: "));
|
||||||
|
|
||||||
start = prs->prs_start_time;
|
start = prs->prs_start_time;
|
||||||
end = prs->prs_end_time;
|
end = prs->prs_end_time;
|
||||||
@@ -7651,8 +7798,8 @@ print_removal_status(zpool_handle_t *zhp, pool_removal_stat_t *prs)
|
|||||||
* do not print estimated time if hours_left is more than
|
* do not print estimated time if hours_left is more than
|
||||||
* 30 days
|
* 30 days
|
||||||
*/
|
*/
|
||||||
(void) printf(gettext(" %s copied out of %s at %s/s, "
|
(void) printf(gettext(
|
||||||
"%.2f%% done"),
|
"\t%s copied out of %s at %s/s, %.2f%% done"),
|
||||||
examined_buf, total_buf, rate_buf, 100 * fraction_done);
|
examined_buf, total_buf, rate_buf, 100 * fraction_done);
|
||||||
if (hours_left < (30 * 24)) {
|
if (hours_left < (30 * 24)) {
|
||||||
(void) printf(gettext(", %lluh%um to go\n"),
|
(void) printf(gettext(", %lluh%um to go\n"),
|
||||||
@@ -7667,8 +7814,8 @@ print_removal_status(zpool_handle_t *zhp, pool_removal_stat_t *prs)
|
|||||||
if (prs->prs_mapping_memory > 0) {
|
if (prs->prs_mapping_memory > 0) {
|
||||||
char mem_buf[7];
|
char mem_buf[7];
|
||||||
zfs_nicenum(prs->prs_mapping_memory, mem_buf, sizeof (mem_buf));
|
zfs_nicenum(prs->prs_mapping_memory, mem_buf, sizeof (mem_buf));
|
||||||
(void) printf(gettext(" %s memory used for "
|
(void) printf(gettext(
|
||||||
"removed device mappings\n"),
|
"\t%s memory used for removed device mappings\n"),
|
||||||
mem_buf);
|
mem_buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10062,7 +10209,7 @@ int
|
|||||||
zpool_do_wait(int argc, char **argv)
|
zpool_do_wait(int argc, char **argv)
|
||||||
{
|
{
|
||||||
boolean_t verbose = B_FALSE;
|
boolean_t verbose = B_FALSE;
|
||||||
char c;
|
int c;
|
||||||
char *value;
|
char *value;
|
||||||
int i;
|
int i;
|
||||||
unsigned long count;
|
unsigned long count;
|
||||||
|
|||||||
@@ -13,3 +13,5 @@ zstream_LDADD = \
|
|||||||
$(abs_top_builddir)/lib/libzfs/libzfs.la \
|
$(abs_top_builddir)/lib/libzfs/libzfs.la \
|
||||||
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
||||||
$(abs_top_builddir)/lib/libnvpair/libnvpair.la
|
$(abs_top_builddir)/lib/libnvpair/libnvpair.la
|
||||||
|
|
||||||
|
include $(top_srcdir)/config/CppCheck.am
|
||||||
|
|||||||
@@ -248,6 +248,7 @@ zfs_redup_stream(int infd, int outfd, boolean_t verbose)
|
|||||||
fflags = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo);
|
fflags = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo);
|
||||||
fflags &= ~(DMU_BACKUP_FEATURE_DEDUP |
|
fflags &= ~(DMU_BACKUP_FEATURE_DEDUP |
|
||||||
DMU_BACKUP_FEATURE_DEDUPPROPS);
|
DMU_BACKUP_FEATURE_DEDUPPROPS);
|
||||||
|
/* cppcheck-suppress syntaxError */
|
||||||
DMU_SET_FEATUREFLAGS(drrb->drr_versioninfo, fflags);
|
DMU_SET_FEATUREFLAGS(drrb->drr_versioninfo, fflags);
|
||||||
|
|
||||||
int sz = drr->drr_payloadlen;
|
int sz = drr->drr_payloadlen;
|
||||||
@@ -421,7 +422,7 @@ int
|
|||||||
zstream_do_redup(int argc, char *argv[])
|
zstream_do_redup(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
boolean_t verbose = B_FALSE;
|
boolean_t verbose = B_FALSE;
|
||||||
char c;
|
int c;
|
||||||
|
|
||||||
while ((c = getopt(argc, argv, "v")) != -1) {
|
while ((c = getopt(argc, argv, "v")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
|||||||
@@ -21,3 +21,5 @@ ztest_LDADD = \
|
|||||||
|
|
||||||
ztest_LDADD += -lm
|
ztest_LDADD += -lm
|
||||||
ztest_LDFLAGS = -pthread
|
ztest_LDFLAGS = -pthread
|
||||||
|
|
||||||
|
include $(top_srcdir)/config/CppCheck.am
|
||||||
|
|||||||
+11
-7
@@ -132,7 +132,7 @@
|
|||||||
#include <libnvpair.h>
|
#include <libnvpair.h>
|
||||||
#include <libzutil.h>
|
#include <libzutil.h>
|
||||||
#include <sys/crypto/icp.h>
|
#include <sys/crypto/icp.h>
|
||||||
#ifdef __GLIBC__
|
#if (__GLIBC__ && !__UCLIBC__)
|
||||||
#include <execinfo.h> /* for backtrace() */
|
#include <execinfo.h> /* for backtrace() */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -556,7 +556,7 @@ dump_debug_buffer(void)
|
|||||||
static void sig_handler(int signo)
|
static void sig_handler(int signo)
|
||||||
{
|
{
|
||||||
struct sigaction action;
|
struct sigaction action;
|
||||||
#ifdef __GLIBC__ /* backtrace() is a GNU extension */
|
#if (__GLIBC__ && !__UCLIBC__) /* backtrace() is a GNU extension */
|
||||||
int nptrs;
|
int nptrs;
|
||||||
void *buffer[BACKTRACE_SZ];
|
void *buffer[BACKTRACE_SZ];
|
||||||
|
|
||||||
@@ -1332,7 +1332,11 @@ ztest_dmu_objset_own(const char *name, dmu_objset_type_t type,
|
|||||||
VERIFY0(dsl_crypto_params_create_nvlist(DCP_CMD_NONE, NULL,
|
VERIFY0(dsl_crypto_params_create_nvlist(DCP_CMD_NONE, NULL,
|
||||||
crypto_args, &dcp));
|
crypto_args, &dcp));
|
||||||
err = spa_keystore_load_wkey(ddname, dcp, B_FALSE);
|
err = spa_keystore_load_wkey(ddname, dcp, B_FALSE);
|
||||||
dsl_crypto_params_free(dcp, B_FALSE);
|
/*
|
||||||
|
* Note: if there was an error loading, the wkey was not
|
||||||
|
* consumed, and needs to be freed.
|
||||||
|
*/
|
||||||
|
dsl_crypto_params_free(dcp, (err != 0));
|
||||||
fnvlist_free(crypto_args);
|
fnvlist_free(crypto_args);
|
||||||
|
|
||||||
if (err == EINVAL) {
|
if (err == EINVAL) {
|
||||||
@@ -2159,8 +2163,8 @@ ztest_get_done(zgd_t *zgd, int error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ztest_get_data(void *arg, lr_write_t *lr, char *buf, struct lwb *lwb,
|
ztest_get_data(void *arg, uint64_t arg2, lr_write_t *lr, char *buf,
|
||||||
zio_t *zio)
|
struct lwb *lwb, zio_t *zio)
|
||||||
{
|
{
|
||||||
ztest_ds_t *zd = arg;
|
ztest_ds_t *zd = arg;
|
||||||
objset_t *os = zd->zd_os;
|
objset_t *os = zd->zd_os;
|
||||||
@@ -3365,8 +3369,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
|
|||||||
*/
|
*/
|
||||||
if (ztest_device_removal_active) {
|
if (ztest_device_removal_active) {
|
||||||
spa_config_exit(spa, SCL_ALL, FTAG);
|
spa_config_exit(spa, SCL_ALL, FTAG);
|
||||||
mutex_exit(&ztest_vdev_lock);
|
goto out;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -7016,6 +7019,7 @@ ztest_import_impl(ztest_shared_t *zs)
|
|||||||
VERIFY0(zpool_find_config(NULL, ztest_opts.zo_pool, &cfg, &args,
|
VERIFY0(zpool_find_config(NULL, ztest_opts.zo_pool, &cfg, &args,
|
||||||
&libzpool_config_ops));
|
&libzpool_config_ops));
|
||||||
VERIFY0(spa_import(ztest_opts.zo_pool, cfg, NULL, flags));
|
VERIFY0(spa_import(ztest_opts.zo_pool, cfg, NULL, flags));
|
||||||
|
fnvlist_free(cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -8,3 +8,5 @@ udev_PROGRAMS = zvol_id
|
|||||||
|
|
||||||
zvol_id_SOURCES = \
|
zvol_id_SOURCES = \
|
||||||
zvol_id_main.c
|
zvol_id_main.c
|
||||||
|
|
||||||
|
include $(top_srcdir)/config/CppCheck.am
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
#
|
||||||
|
# Default rules for running cppcheck against the the user space components.
|
||||||
|
#
|
||||||
|
|
||||||
|
PHONY += cppcheck
|
||||||
|
|
||||||
|
CPPCHECKFLAGS = --std=c99 --quiet --max-configs=1 --error-exitcode=2
|
||||||
|
CPPCHECKFLAGS += --inline-suppr -U_KERNEL
|
||||||
|
|
||||||
|
cppcheck:
|
||||||
|
$(CPPCHECK) -j$(CPU_COUNT) $(CPPCHECKFLAGS) $(DEFAULT_INCLUDES) $(SOURCES)
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
# should include these rules and override or extend them as needed.
|
# should include these rules and override or extend them as needed.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
PHONY =
|
||||||
DEFAULT_INCLUDES = \
|
DEFAULT_INCLUDES = \
|
||||||
-include $(top_builddir)/zfs_config.h \
|
-include $(top_builddir)/zfs_config.h \
|
||||||
-I$(top_builddir)/include \
|
-I$(top_builddir)/include \
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Check if cppcheck is available.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CPPCHECK], [
|
||||||
|
AC_CHECK_PROG([CPPCHECK], [cppcheck], [cppcheck])
|
||||||
|
])
|
||||||
@@ -7,7 +7,7 @@ dnl # set the PYTHON environment variable accordingly.
|
|||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYTHON], [
|
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYTHON], [
|
||||||
AC_ARG_WITH([python],
|
AC_ARG_WITH([python],
|
||||||
AC_HELP_STRING([--with-python[=VERSION]],
|
AS_HELP_STRING([--with-python[=VERSION]],
|
||||||
[default system python version @<:@default=check@:>@]),
|
[default system python version @<:@default=check@:>@]),
|
||||||
[with_python=$withval],
|
[with_python=$withval],
|
||||||
[with_python=check])
|
[with_python=check])
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ dnl # Determines if pyzfs can be built, requires Python 2.7 or later.
|
|||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYZFS], [
|
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYZFS], [
|
||||||
AC_ARG_ENABLE([pyzfs],
|
AC_ARG_ENABLE([pyzfs],
|
||||||
AC_HELP_STRING([--enable-pyzfs],
|
AS_HELP_STRING([--enable-pyzfs],
|
||||||
[install libzfs_core python bindings @<:@default=check@:>@]),
|
[install libzfs_core python bindings @<:@default=check@:>@]),
|
||||||
[enable_pyzfs=$enableval],
|
[enable_pyzfs=$enableval],
|
||||||
[enable_pyzfs=check])
|
[enable_pyzfs=check])
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ dnl #
|
|||||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_SED], [
|
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_SED], [
|
||||||
AC_REQUIRE([AC_PROG_SED])dnl
|
AC_REQUIRE([AC_PROG_SED])dnl
|
||||||
AC_CACHE_CHECK([for sed --in-place], [ac_cv_inplace], [
|
AC_CACHE_CHECK([for sed --in-place], [ac_cv_inplace], [
|
||||||
tmpfile=$(mktemp conftest.XXX)
|
tmpfile=$(mktemp conftest.XXXXXX)
|
||||||
echo foo >$tmpfile
|
echo foo >$tmpfile
|
||||||
AS_IF([$SED --in-place 's#foo#bar#' $tmpfile 2>/dev/null],
|
AS_IF([$SED --in-place 's#foo#bar#' $tmpfile 2>/dev/null],
|
||||||
[ac_cv_inplace="--in-place"],
|
[ac_cv_inplace="--in-place"],
|
||||||
|
|||||||
@@ -0,0 +1,101 @@
|
|||||||
|
# ===========================================================================
|
||||||
|
# https://www.gnu.org/software/autoconf-archive/ax_count_cpus.html
|
||||||
|
# ===========================================================================
|
||||||
|
#
|
||||||
|
# SYNOPSIS
|
||||||
|
#
|
||||||
|
# AX_COUNT_CPUS([ACTION-IF-DETECTED],[ACTION-IF-NOT-DETECTED])
|
||||||
|
#
|
||||||
|
# DESCRIPTION
|
||||||
|
#
|
||||||
|
# Attempt to count the number of logical processor cores (including
|
||||||
|
# virtual and HT cores) currently available to use on the machine and
|
||||||
|
# place detected value in CPU_COUNT variable.
|
||||||
|
#
|
||||||
|
# On successful detection, ACTION-IF-DETECTED is executed if present. If
|
||||||
|
# the detection fails, then ACTION-IF-NOT-DETECTED is triggered. The
|
||||||
|
# default ACTION-IF-NOT-DETECTED is to set CPU_COUNT to 1.
|
||||||
|
#
|
||||||
|
# LICENSE
|
||||||
|
#
|
||||||
|
# Copyright (c) 2014,2016 Karlson2k (Evgeny Grin) <k2k@narod.ru>
|
||||||
|
# Copyright (c) 2012 Brian Aker <brian@tangent.org>
|
||||||
|
# Copyright (c) 2008 Michael Paul Bailey <jinxidoru@byu.net>
|
||||||
|
# Copyright (c) 2008 Christophe Tournayre <turn3r@users.sourceforge.net>
|
||||||
|
#
|
||||||
|
# Copying and distribution of this file, with or without modification, are
|
||||||
|
# permitted in any medium without royalty provided the copyright notice
|
||||||
|
# and this notice are preserved. This file is offered as-is, without any
|
||||||
|
# warranty.
|
||||||
|
|
||||||
|
#serial 22
|
||||||
|
|
||||||
|
AC_DEFUN([AX_COUNT_CPUS],[dnl
|
||||||
|
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||||
|
AC_REQUIRE([AC_PROG_EGREP])dnl
|
||||||
|
AC_MSG_CHECKING([the number of available CPUs])
|
||||||
|
CPU_COUNT="0"
|
||||||
|
|
||||||
|
# Try generic methods
|
||||||
|
|
||||||
|
# 'getconf' is POSIX utility, but '_NPROCESSORS_ONLN' and
|
||||||
|
# 'NPROCESSORS_ONLN' are platform-specific
|
||||||
|
command -v getconf >/dev/null 2>&1 && \
|
||||||
|
CPU_COUNT=`getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null` || CPU_COUNT="0"
|
||||||
|
AS_IF([[test "$CPU_COUNT" -gt "0" 2>/dev/null || ! command -v nproc >/dev/null 2>&1]],[[: # empty]],[dnl
|
||||||
|
# 'nproc' is part of GNU Coreutils and is widely available
|
||||||
|
CPU_COUNT=`OMP_NUM_THREADS='' nproc 2>/dev/null` || CPU_COUNT=`nproc 2>/dev/null` || CPU_COUNT="0"
|
||||||
|
])dnl
|
||||||
|
|
||||||
|
AS_IF([[test "$CPU_COUNT" -gt "0" 2>/dev/null]],[[: # empty]],[dnl
|
||||||
|
# Try platform-specific preferred methods
|
||||||
|
AS_CASE([[$host_os]],dnl
|
||||||
|
[[*linux*]],[[CPU_COUNT=`lscpu -p 2>/dev/null | $EGREP -e '^@<:@0-9@:>@+,' -c` || CPU_COUNT="0"]],dnl
|
||||||
|
[[*darwin*]],[[CPU_COUNT=`sysctl -n hw.logicalcpu 2>/dev/null` || CPU_COUNT="0"]],dnl
|
||||||
|
[[freebsd*]],[[command -v sysctl >/dev/null 2>&1 && CPU_COUNT=`sysctl -n kern.smp.cpus 2>/dev/null` || CPU_COUNT="0"]],dnl
|
||||||
|
[[netbsd*]], [[command -v sysctl >/dev/null 2>&1 && CPU_COUNT=`sysctl -n hw.ncpuonline 2>/dev/null` || CPU_COUNT="0"]],dnl
|
||||||
|
[[solaris*]],[[command -v psrinfo >/dev/null 2>&1 && CPU_COUNT=`psrinfo 2>/dev/null | $EGREP -e '^@<:@0-9@:>@.*on-line' -c 2>/dev/null` || CPU_COUNT="0"]],dnl
|
||||||
|
[[mingw*]],[[CPU_COUNT=`ls -qpU1 /proc/registry/HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/CentralProcessor/ 2>/dev/null | $EGREP -e '^@<:@0-9@:>@+/' -c` || CPU_COUNT="0"]],dnl
|
||||||
|
[[msys*]],[[CPU_COUNT=`ls -qpU1 /proc/registry/HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/CentralProcessor/ 2>/dev/null | $EGREP -e '^@<:@0-9@:>@+/' -c` || CPU_COUNT="0"]],dnl
|
||||||
|
[[cygwin*]],[[CPU_COUNT=`ls -qpU1 /proc/registry/HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/CentralProcessor/ 2>/dev/null | $EGREP -e '^@<:@0-9@:>@+/' -c` || CPU_COUNT="0"]]dnl
|
||||||
|
)dnl
|
||||||
|
])dnl
|
||||||
|
|
||||||
|
AS_IF([[test "$CPU_COUNT" -gt "0" 2>/dev/null || ! command -v sysctl >/dev/null 2>&1]],[[: # empty]],[dnl
|
||||||
|
# Try less preferred generic method
|
||||||
|
# 'hw.ncpu' exist on many platforms, but not on GNU/Linux
|
||||||
|
CPU_COUNT=`sysctl -n hw.ncpu 2>/dev/null` || CPU_COUNT="0"
|
||||||
|
])dnl
|
||||||
|
|
||||||
|
AS_IF([[test "$CPU_COUNT" -gt "0" 2>/dev/null]],[[: # empty]],[dnl
|
||||||
|
# Try platform-specific fallback methods
|
||||||
|
# They can be less accurate and slower then preferred methods
|
||||||
|
AS_CASE([[$host_os]],dnl
|
||||||
|
[[*linux*]],[[CPU_COUNT=`$EGREP -e '^processor' -c /proc/cpuinfo 2>/dev/null` || CPU_COUNT="0"]],dnl
|
||||||
|
[[*darwin*]],[[CPU_COUNT=`system_profiler SPHardwareDataType 2>/dev/null | $EGREP -i -e 'number of cores:'|cut -d : -f 2 -s|tr -d ' '` || CPU_COUNT="0"]],dnl
|
||||||
|
[[freebsd*]],[[CPU_COUNT=`dmesg 2>/dev/null| $EGREP -e '^cpu@<:@0-9@:>@+: '|sort -u|$EGREP -e '^' -c` || CPU_COUNT="0"]],dnl
|
||||||
|
[[netbsd*]], [[CPU_COUNT=`command -v cpuctl >/dev/null 2>&1 && cpuctl list 2>/dev/null| $EGREP -e '^@<:@0-9@:>@+ .* online ' -c` || \
|
||||||
|
CPU_COUNT=`dmesg 2>/dev/null| $EGREP -e '^cpu@<:@0-9@:>@+ at'|sort -u|$EGREP -e '^' -c` || CPU_COUNT="0"]],dnl
|
||||||
|
[[solaris*]],[[command -v kstat >/dev/null 2>&1 && CPU_COUNT=`kstat -m cpu_info -s state -p 2>/dev/null | $EGREP -c -e 'on-line'` || \
|
||||||
|
CPU_COUNT=`kstat -m cpu_info 2>/dev/null | $EGREP -c -e 'module: cpu_info'` || CPU_COUNT="0"]],dnl
|
||||||
|
[[mingw*]],[AS_IF([[CPU_COUNT=`reg query 'HKLM\\Hardware\\Description\\System\\CentralProcessor' 2>/dev/null | $EGREP -e '\\\\@<:@0-9@:>@+$' -c`]],dnl
|
||||||
|
[[: # empty]],[[test "$NUMBER_OF_PROCESSORS" -gt "0" 2>/dev/null && CPU_COUNT="$NUMBER_OF_PROCESSORS"]])],dnl
|
||||||
|
[[msys*]],[[test "$NUMBER_OF_PROCESSORS" -gt "0" 2>/dev/null && CPU_COUNT="$NUMBER_OF_PROCESSORS"]],dnl
|
||||||
|
[[cygwin*]],[[test "$NUMBER_OF_PROCESSORS" -gt "0" 2>/dev/null && CPU_COUNT="$NUMBER_OF_PROCESSORS"]]dnl
|
||||||
|
)dnl
|
||||||
|
])dnl
|
||||||
|
|
||||||
|
AS_IF([[test "x$CPU_COUNT" != "x0" && test "$CPU_COUNT" -gt 0 2>/dev/null]],[dnl
|
||||||
|
AC_MSG_RESULT([[$CPU_COUNT]])
|
||||||
|
m4_ifvaln([$1],[$1],)dnl
|
||||||
|
],[dnl
|
||||||
|
m4_ifval([$2],[dnl
|
||||||
|
AS_UNSET([[CPU_COUNT]])
|
||||||
|
AC_MSG_RESULT([[unable to detect]])
|
||||||
|
$2
|
||||||
|
], [dnl
|
||||||
|
CPU_COUNT="1"
|
||||||
|
AC_MSG_RESULT([[unable to detect (assuming 1)]])
|
||||||
|
])dnl
|
||||||
|
])dnl
|
||||||
|
])dnl
|
||||||
+1
-1
@@ -53,7 +53,7 @@ deb-utils: deb-local rpm-utils-initramfs
|
|||||||
## 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.
|
||||||
path_prepend=`mktemp -d /tmp/intercept.XXX`; \
|
path_prepend=`mktemp -d /tmp/intercept.XXXXXX`; \
|
||||||
echo "#$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
|
echo "#$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
|
||||||
echo "`which dh_shlibdeps` -- \
|
echo "`which dh_shlibdeps` -- \
|
||||||
-xlibuutil3linux -xlibnvpair3linux -xlibzfs4linux -xlibzpool4linux" \
|
-xlibuutil3linux -xlibnvpair3linux -xlibzfs4linux -xlibzpool4linux" \
|
||||||
|
|||||||
+25
-4
@@ -11,7 +11,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_RELEASE], [
|
|||||||
], [
|
], [
|
||||||
struct posix_acl *tmp = posix_acl_alloc(1, 0);
|
struct posix_acl *tmp = posix_acl_alloc(1, 0);
|
||||||
posix_acl_release(tmp);
|
posix_acl_release(tmp);
|
||||||
], [], [$ZFS_META_LICENSE])
|
], [], [ZFS_META_LICENSE])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_RELEASE], [
|
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_RELEASE], [
|
||||||
@@ -50,7 +50,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_SET_CACHED_ACL_USABLE], [
|
|||||||
struct posix_acl *acl = posix_acl_alloc(1, 0);
|
struct posix_acl *acl = posix_acl_alloc(1, 0);
|
||||||
set_cached_acl(ip, ACL_TYPE_ACCESS, acl);
|
set_cached_acl(ip, ACL_TYPE_ACCESS, acl);
|
||||||
forget_cached_acl(ip, ACL_TYPE_ACCESS);
|
forget_cached_acl(ip, ACL_TYPE_ACCESS);
|
||||||
], [], [$ZFS_META_LICENSE])
|
], [], [ZFS_META_LICENSE])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE], [
|
||||||
@@ -189,7 +189,22 @@ dnl #
|
|||||||
dnl # 3.14 API change,
|
dnl # 3.14 API change,
|
||||||
dnl # Check if inode_operations contains the function set_acl
|
dnl # Check if inode_operations contains the function set_acl
|
||||||
dnl #
|
dnl #
|
||||||
|
dnl # 5.12 API change,
|
||||||
|
dnl # set_acl() added a user_namespace* parameter first
|
||||||
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_operations_set_acl_userns], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
|
||||||
|
int set_acl_fn(struct user_namespace *userns,
|
||||||
|
struct inode *inode, struct posix_acl *acl,
|
||||||
|
int type) { return 0; }
|
||||||
|
|
||||||
|
static const struct inode_operations
|
||||||
|
iops __attribute__ ((unused)) = {
|
||||||
|
.set_acl = set_acl_fn,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
ZFS_LINUX_TEST_SRC([inode_operations_set_acl], [
|
ZFS_LINUX_TEST_SRC([inode_operations_set_acl], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
@@ -205,11 +220,17 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [
|
|||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL], [
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL], [
|
||||||
AC_MSG_CHECKING([whether iops->set_acl() exists])
|
AC_MSG_CHECKING([whether iops->set_acl() exists])
|
||||||
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl], [
|
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_userns], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
|
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
|
||||||
|
AC_DEFINE(HAVE_SET_ACL_USERNS, 1, [iops->set_acl() takes 4 args])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists, takes 3 args])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
+31
-2
@@ -188,7 +188,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_SET_DEV], [
|
|||||||
struct block_device *bdev = NULL;
|
struct block_device *bdev = NULL;
|
||||||
struct bio *bio = NULL;
|
struct bio *bio = NULL;
|
||||||
bio_set_dev(bio, bdev);
|
bio_set_dev(bio, bdev);
|
||||||
], [], [$ZFS_META_LICENSE])
|
], [], [ZFS_META_LICENSE])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV], [
|
AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV], [
|
||||||
@@ -347,7 +347,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKG_TRYGET], [
|
|||||||
struct blkcg_gq blkg __attribute__ ((unused)) = {};
|
struct blkcg_gq blkg __attribute__ ((unused)) = {};
|
||||||
bool rc __attribute__ ((unused));
|
bool rc __attribute__ ((unused));
|
||||||
rc = blkg_tryget(&blkg);
|
rc = blkg_tryget(&blkg);
|
||||||
], [], [$ZFS_META_LICENSE])
|
], [], [ZFS_META_LICENSE])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLKG_TRYGET], [
|
AC_DEFUN([ZFS_AC_KERNEL_BLKG_TRYGET], [
|
||||||
@@ -369,6 +369,33 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKG_TRYGET], [
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Linux 5.12 API,
|
||||||
|
dnl #
|
||||||
|
dnl # The Linux 5.12 kernel updated struct bio to create a new bi_bdev member
|
||||||
|
dnl # and bio->bi_disk was moved to bio->bi_bdev->bd_disk
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_BDEV_DISK], [
|
||||||
|
ZFS_LINUX_TEST_SRC([bio_bdev_disk], [
|
||||||
|
#include <linux/blk_types.h>
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
],[
|
||||||
|
struct bio *b = NULL;
|
||||||
|
struct gendisk *d = b->bi_bdev->bd_disk;
|
||||||
|
blk_register_queue(d);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BIO_BDEV_DISK], [
|
||||||
|
AC_MSG_CHECKING([whether bio->bi_bdev->bd_disk exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([bio_bdev_disk], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_BIO_BDEV_DISK, 1, [bio->bi_bdev->bd_disk exists])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO], [
|
||||||
ZFS_AC_KERNEL_SRC_REQ
|
ZFS_AC_KERNEL_SRC_REQ
|
||||||
ZFS_AC_KERNEL_SRC_BIO_OPS
|
ZFS_AC_KERNEL_SRC_BIO_OPS
|
||||||
@@ -379,6 +406,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO], [
|
|||||||
ZFS_AC_KERNEL_SRC_BIO_SUBMIT_BIO
|
ZFS_AC_KERNEL_SRC_BIO_SUBMIT_BIO
|
||||||
ZFS_AC_KERNEL_SRC_BIO_CURRENT_BIO_LIST
|
ZFS_AC_KERNEL_SRC_BIO_CURRENT_BIO_LIST
|
||||||
ZFS_AC_KERNEL_SRC_BLKG_TRYGET
|
ZFS_AC_KERNEL_SRC_BLKG_TRYGET
|
||||||
|
ZFS_AC_KERNEL_SRC_BIO_BDEV_DISK
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BIO], [
|
AC_DEFUN([ZFS_AC_KERNEL_BIO], [
|
||||||
@@ -400,4 +428,5 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO], [
|
|||||||
ZFS_AC_KERNEL_BIO_SUBMIT_BIO
|
ZFS_AC_KERNEL_BIO_SUBMIT_BIO
|
||||||
ZFS_AC_KERNEL_BIO_CURRENT_BIO_LIST
|
ZFS_AC_KERNEL_BIO_CURRENT_BIO_LIST
|
||||||
ZFS_AC_KERNEL_BLKG_TRYGET
|
ZFS_AC_KERNEL_BLKG_TRYGET
|
||||||
|
ZFS_AC_KERNEL_BIO_BDEV_DISK
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # 5.12 API change removes BIO_MAX_PAGES in favor of bio_max_segs()
|
||||||
|
dnl # which will handle the logic of setting the upper-bound to a
|
||||||
|
dnl # BIO_MAX_PAGES, internally.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_MAX_SEGS], [
|
||||||
|
ZFS_LINUX_TEST_SRC([bio_max_segs], [
|
||||||
|
#include <linux/bio.h>
|
||||||
|
],[
|
||||||
|
bio_max_segs(1);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BIO_MAX_SEGS], [
|
||||||
|
AC_MSG_CHECKING([whether bio_max_segs() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([bio_max_segs], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
|
||||||
|
AC_DEFINE([HAVE_BIO_MAX_SEGS], 1, [bio_max_segs() is implemented])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
@@ -179,7 +179,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLUSH], [
|
|||||||
], [
|
], [
|
||||||
struct request_queue *q = NULL;
|
struct request_queue *q = NULL;
|
||||||
(void) blk_queue_flush(q, REQ_FLUSH);
|
(void) blk_queue_flush(q, REQ_FLUSH);
|
||||||
], [$NO_UNUSED_BUT_SET_VARIABLE], [$ZFS_META_LICENSE])
|
], [$NO_UNUSED_BUT_SET_VARIABLE], [ZFS_META_LICENSE])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([blk_queue_write_cache], [
|
ZFS_LINUX_TEST_SRC([blk_queue_write_cache], [
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
@@ -187,7 +187,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLUSH], [
|
|||||||
], [
|
], [
|
||||||
struct request_queue *q = NULL;
|
struct request_queue *q = NULL;
|
||||||
blk_queue_write_cache(q, true, true);
|
blk_queue_write_cache(q, true, true);
|
||||||
], [$NO_UNUSED_BUT_SET_VARIABLE], [$ZFS_META_LICENSE])
|
], [$NO_UNUSED_BUT_SET_VARIABLE], [ZFS_META_LICENSE])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLUSH], [
|
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLUSH], [
|
||||||
|
|||||||
+66
-14
@@ -154,42 +154,69 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_INVALIDATE_BDEV], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 2.6.27, lookup_bdev() was exported.
|
dnl # 5.11 API, lookup_bdev() takes dev_t argument.
|
||||||
dnl # 4.4.0-6.21 - lookup_bdev() takes 2 arguments.
|
dnl # 2.6.27 API, lookup_bdev() was first exported.
|
||||||
|
dnl # 4.4.0-6.21 API, lookup_bdev() on Ubuntu takes mode argument.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_LOOKUP_BDEV], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_LOOKUP_BDEV], [
|
||||||
|
ZFS_LINUX_TEST_SRC([lookup_bdev_devt], [
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
], [
|
||||||
|
int error __attribute__ ((unused));
|
||||||
|
const char path[] = "/example/path";
|
||||||
|
dev_t dev;
|
||||||
|
|
||||||
|
error = lookup_bdev(path, &dev);
|
||||||
|
])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([lookup_bdev_1arg], [
|
ZFS_LINUX_TEST_SRC([lookup_bdev_1arg], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
], [
|
], [
|
||||||
lookup_bdev(NULL);
|
struct block_device *bdev __attribute__ ((unused));
|
||||||
|
const char path[] = "/example/path";
|
||||||
|
|
||||||
|
bdev = lookup_bdev(path);
|
||||||
])
|
])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([lookup_bdev_2args], [
|
ZFS_LINUX_TEST_SRC([lookup_bdev_mode], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
], [
|
], [
|
||||||
lookup_bdev(NULL, FMODE_READ);
|
struct block_device *bdev __attribute__ ((unused));
|
||||||
|
const char path[] = "/example/path";
|
||||||
|
|
||||||
|
bdev = lookup_bdev(path, FMODE_READ);
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_LOOKUP_BDEV], [
|
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_LOOKUP_BDEV], [
|
||||||
AC_MSG_CHECKING([whether lookup_bdev() wants 1 arg])
|
AC_MSG_CHECKING([whether lookup_bdev() wants dev_t arg])
|
||||||
ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_1arg],
|
ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_devt],
|
||||||
[lookup_bdev], [fs/block_dev.c], [
|
[lookup_bdev], [fs/block_dev.c], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_1ARG_LOOKUP_BDEV, 1,
|
AC_DEFINE(HAVE_DEVT_LOOKUP_BDEV, 1,
|
||||||
[lookup_bdev() wants 1 arg])
|
[lookup_bdev() wants dev_t arg])
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether lookup_bdev() wants 2 args])
|
AC_MSG_CHECKING([whether lookup_bdev() wants 1 arg])
|
||||||
ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_2args],
|
ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_1arg],
|
||||||
[lookup_bdev], [fs/block_dev.c], [
|
[lookup_bdev], [fs/block_dev.c], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_2ARGS_LOOKUP_BDEV, 1,
|
AC_DEFINE(HAVE_1ARG_LOOKUP_BDEV, 1,
|
||||||
[lookup_bdev() wants 2 args])
|
[lookup_bdev() wants 1 arg])
|
||||||
], [
|
], [
|
||||||
ZFS_LINUX_TEST_ERROR([lookup_bdev()])
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether lookup_bdev() wants mode arg])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_mode],
|
||||||
|
[lookup_bdev], [fs/block_dev.c], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_MODE_LOOKUP_BDEV, 1,
|
||||||
|
[lookup_bdev() wants mode arg])
|
||||||
|
], [
|
||||||
|
ZFS_LINUX_TEST_ERROR([lookup_bdev()])
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
@@ -244,6 +271,29 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_BDEV_LOGICAL_BLOCK_SIZE], [
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 5.11 API change
|
||||||
|
dnl # Added bdev_whole() helper.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_WHOLE], [
|
||||||
|
ZFS_LINUX_TEST_SRC([bdev_whole], [
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
],[
|
||||||
|
struct block_device *bdev = NULL;
|
||||||
|
bdev = bdev_whole(bdev);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_BDEV_WHOLE], [
|
||||||
|
AC_MSG_CHECKING([whether bdev_whole() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([bdev_whole], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_BDEV_WHOLE, 1, [bdev_whole() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV], [
|
||||||
ZFS_AC_KERNEL_SRC_BLKDEV_GET_BY_PATH
|
ZFS_AC_KERNEL_SRC_BLKDEV_GET_BY_PATH
|
||||||
ZFS_AC_KERNEL_SRC_BLKDEV_PUT
|
ZFS_AC_KERNEL_SRC_BLKDEV_PUT
|
||||||
@@ -254,6 +304,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV], [
|
|||||||
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_PHYSICAL_BLOCK_SIZE
|
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_PHYSICAL_BLOCK_SIZE
|
||||||
ZFS_AC_KERNEL_SRC_BLKDEV_CHECK_DISK_CHANGE
|
ZFS_AC_KERNEL_SRC_BLKDEV_CHECK_DISK_CHANGE
|
||||||
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_CHECK_MEDIA_CHANGE
|
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_CHECK_MEDIA_CHANGE
|
||||||
|
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_WHOLE
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV], [
|
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV], [
|
||||||
@@ -266,4 +317,5 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV], [
|
|||||||
ZFS_AC_KERNEL_BLKDEV_BDEV_PHYSICAL_BLOCK_SIZE
|
ZFS_AC_KERNEL_BLKDEV_BDEV_PHYSICAL_BLOCK_SIZE
|
||||||
ZFS_AC_KERNEL_BLKDEV_CHECK_DISK_CHANGE
|
ZFS_AC_KERNEL_BLKDEV_CHECK_DISK_CHANGE
|
||||||
ZFS_AC_KERNEL_BLKDEV_BDEV_CHECK_MEDIA_CHANGE
|
ZFS_AC_KERNEL_BLKDEV_BDEV_CHECK_MEDIA_CHANGE
|
||||||
|
ZFS_AC_KERNEL_BLKDEV_BDEV_WHOLE
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -52,12 +52,44 @@ AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 5.13 API change
|
||||||
|
dnl # block_device_operations->revalidate_disk() was removed
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK], [
|
||||||
|
ZFS_LINUX_TEST_SRC([block_device_operations_revalidate_disk], [
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
|
||||||
|
int blk_revalidate_disk(struct gendisk *disk) {
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct block_device_operations
|
||||||
|
bops __attribute__ ((unused)) = {
|
||||||
|
.revalidate_disk = blk_revalidate_disk,
|
||||||
|
};
|
||||||
|
], [], [$NO_UNUSED_BUT_SET_VARIABLE])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK], [
|
||||||
|
AC_MSG_CHECKING([whether bops->revalidate_disk() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([block_device_operations_revalidate_disk], [
|
||||||
|
AC_DEFINE([HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK], [1],
|
||||||
|
[Define if revalidate_disk() in block_device_operations])
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS], [
|
||||||
ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS
|
ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS
|
||||||
ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
|
ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
|
||||||
|
ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS], [
|
AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS], [
|
||||||
ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS
|
ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS
|
||||||
ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
|
ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
|
||||||
|
ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_CONFIG_DEBUG_LOCK_ALLOC], [
|
|||||||
mutex_init(&lock);
|
mutex_init(&lock);
|
||||||
mutex_lock(&lock);
|
mutex_lock(&lock);
|
||||||
mutex_unlock(&lock);
|
mutex_unlock(&lock);
|
||||||
], [], [$ZFS_META_LICENSE])
|
], [], [ZFS_META_LICENSE])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC], [
|
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC], [
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_FPU], [
|
|||||||
], [
|
], [
|
||||||
kernel_fpu_begin();
|
kernel_fpu_begin();
|
||||||
kernel_fpu_end();
|
kernel_fpu_end();
|
||||||
], [], [$ZFS_META_LICENSE])
|
], [], [ZFS_META_LICENSE])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([__kernel_fpu], [
|
ZFS_LINUX_TEST_SRC([__kernel_fpu], [
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
@@ -55,7 +55,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_FPU], [
|
|||||||
], [
|
], [
|
||||||
__kernel_fpu_begin();
|
__kernel_fpu_begin();
|
||||||
__kernel_fpu_end();
|
__kernel_fpu_end();
|
||||||
], [], [$ZFS_META_LICENSE])
|
], [], [ZFS_META_LICENSE])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([fpu_internal], [
|
ZFS_LINUX_TEST_SRC([fpu_internal], [
|
||||||
#if defined(__x86_64) || defined(__x86_64__) || \
|
#if defined(__x86_64) || defined(__x86_64__) || \
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # 5.12 API
|
||||||
|
dnl #
|
||||||
|
dnl # generic_fillattr in linux/fs.h now requires a struct user_namespace*
|
||||||
|
dnl # as the first arg, to support idmapped mounts.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_FILLATTR_USERNS], [
|
||||||
|
ZFS_LINUX_TEST_SRC([generic_fillattr_userns], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
],[
|
||||||
|
struct user_namespace *userns = NULL;
|
||||||
|
struct inode *in = NULL;
|
||||||
|
struct kstat *k = NULL;
|
||||||
|
generic_fillattr(userns, in, k);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_GENERIC_FILLATTR_USERNS], [
|
||||||
|
AC_MSG_CHECKING([whether generic_fillattr requres struct user_namespace*])
|
||||||
|
ZFS_LINUX_TEST_RESULT([generic_fillattr_userns], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE(HAVE_GENERIC_FILLATTR_USERNS, 1,
|
||||||
|
[generic_fillattr requires struct user_namespace*])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
@@ -2,6 +2,27 @@ dnl #
|
|||||||
dnl # Check for generic io accounting interface.
|
dnl # Check for generic io accounting interface.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
|
||||||
|
ZFS_LINUX_TEST_SRC([disk_io_acct], [
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
], [
|
||||||
|
struct gendisk *disk = NULL;
|
||||||
|
struct bio *bio = NULL;
|
||||||
|
unsigned long start_time;
|
||||||
|
|
||||||
|
start_time = disk_start_io_acct(disk, bio_sectors(bio), bio_op(bio));
|
||||||
|
disk_end_io_acct(disk, bio_op(bio), start_time);
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([bio_io_acct], [
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
], [
|
||||||
|
struct bio *bio = NULL;
|
||||||
|
unsigned long start_time;
|
||||||
|
|
||||||
|
start_time = bio_start_io_acct(bio);
|
||||||
|
bio_end_io_acct(bio, start_time);
|
||||||
|
])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([generic_acct_3args], [
|
ZFS_LINUX_TEST_SRC([generic_acct_3args], [
|
||||||
#include <linux/bio.h>
|
#include <linux/bio.h>
|
||||||
|
|
||||||
@@ -29,36 +50,63 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
|
|||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [
|
AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 3.19 API addition
|
dnl # 5.12 API,
|
||||||
dnl #
|
dnl #
|
||||||
dnl # torvalds/linux@394ffa50 allows us to increment iostat
|
dnl # bio_start_io_acct() and bio_end_io_acct() became GPL-exported
|
||||||
dnl # counters without generic_make_request().
|
dnl # so use disk_start_io_acct() and disk_end_io_acct() instead
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_CHECKING([whether generic IO accounting wants 3 args])
|
AC_MSG_CHECKING([whether generic disk_*_io_acct() are available])
|
||||||
ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_3args],
|
ZFS_LINUX_TEST_RESULT([disk_io_acct], [
|
||||||
[generic_start_io_acct], [block/bio.c], [
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1,
|
AC_DEFINE(HAVE_DISK_IO_ACCT, 1, [disk_*_io_acct() available])
|
||||||
[generic_start_io_acct()/generic_end_io_acct() available])
|
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # Linux 4.14 API,
|
dnl # 5.7 API,
|
||||||
dnl #
|
dnl #
|
||||||
dnl # generic_start_io_acct/generic_end_io_acct now require
|
dnl # Added bio_start_io_acct() and bio_end_io_acct() helpers.
|
||||||
dnl # request_queue to be provided. No functional changes,
|
|
||||||
dnl # but preparation for inflight accounting.
|
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_CHECKING([whether generic IO accounting wants 4 args])
|
AC_MSG_CHECKING([whether generic bio_*_io_acct() are available])
|
||||||
ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_4args],
|
ZFS_LINUX_TEST_RESULT([bio_io_acct], [
|
||||||
[generic_start_io_acct], [block/bio.c], [
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_GENERIC_IO_ACCT_4ARG, 1,
|
AC_DEFINE(HAVE_BIO_IO_ACCT, 1, [bio_*_io_acct() available])
|
||||||
[generic_start_io_acct()/generic_end_io_acct() ]
|
|
||||||
[4 arg available])
|
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 4.14 API,
|
||||||
|
dnl #
|
||||||
|
dnl # generic_start_io_acct/generic_end_io_acct now require
|
||||||
|
dnl # request_queue to be provided. No functional changes,
|
||||||
|
dnl # but preparation for inflight accounting.
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([whether generic_*_io_acct wants 4 args])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_4args],
|
||||||
|
[generic_start_io_acct], [block/bio.c], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_GENERIC_IO_ACCT_4ARG, 1,
|
||||||
|
[generic_*_io_acct() 4 arg available])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 3.19 API addition
|
||||||
|
dnl #
|
||||||
|
dnl # torvalds/linux@394ffa50 allows us to increment
|
||||||
|
dnl # iostat counters without generic_make_request().
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING(
|
||||||
|
[whether generic_*_io_acct wants 3 args])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_3args],
|
||||||
|
[generic_start_io_acct], [block/bio.c], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1,
|
||||||
|
[generic_*_io_acct() 3 arg available])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
dnl #
|
|
||||||
dnl # 4.16 API change
|
|
||||||
dnl # Verify if get_disk_and_module() symbol is available.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_DISK_AND_MODULE], [
|
|
||||||
ZFS_LINUX_TEST_SRC([get_disk_and_module], [
|
|
||||||
#include <linux/genhd.h>
|
|
||||||
], [
|
|
||||||
struct gendisk *disk = NULL;
|
|
||||||
(void) get_disk_and_module(disk);
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_GET_DISK_AND_MODULE], [
|
|
||||||
AC_MSG_CHECKING([whether get_disk_and_module() is available])
|
|
||||||
ZFS_LINUX_TEST_RESULT_SYMBOL([get_disk_and_module],
|
|
||||||
[get_disk_and_module], [block/genhd.c], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_GET_DISK_AND_MODULE,
|
|
||||||
1, [get_disk_and_module() is available])
|
|
||||||
], [
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
])
|
|
||||||
])
|
|
||||||
@@ -1,7 +1,25 @@
|
|||||||
dnl #
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_CREATE], [
|
||||||
dnl # 3.6 API change
|
dnl #
|
||||||
dnl #
|
dnl # 5.12 API change that added the struct user_namespace* arg
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_CREATE_FLAGS], [
|
dnl # to the front of this function type's arg list.
|
||||||
|
dnl #
|
||||||
|
ZFS_LINUX_TEST_SRC([create_userns], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/sched.h>
|
||||||
|
|
||||||
|
int inode_create(struct user_namespace *userns,
|
||||||
|
struct inode *inode ,struct dentry *dentry,
|
||||||
|
umode_t umode, bool flag) { return 0; }
|
||||||
|
|
||||||
|
static const struct inode_operations
|
||||||
|
iops __attribute__ ((unused)) = {
|
||||||
|
.create = inode_create,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 3.6 API change
|
||||||
|
dnl #
|
||||||
ZFS_LINUX_TEST_SRC([create_flags], [
|
ZFS_LINUX_TEST_SRC([create_flags], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
@@ -16,11 +34,20 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_CREATE_FLAGS], [
|
|||||||
],[])
|
],[])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_CREATE_FLAGS], [
|
AC_DEFUN([ZFS_AC_KERNEL_CREATE], [
|
||||||
AC_MSG_CHECKING([whether iops->create() passes flags])
|
AC_MSG_CHECKING([whether iops->create() takes struct user_namespace*])
|
||||||
ZFS_LINUX_TEST_RESULT([create_flags], [
|
ZFS_LINUX_TEST_RESULT([create_userns], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOPS_CREATE_USERNS, 1,
|
||||||
|
[iops->create() takes struct user_namespace*])
|
||||||
],[
|
],[
|
||||||
ZFS_LINUX_TEST_ERROR([iops->create()])
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether iops->create() passes flags])
|
||||||
|
ZFS_LINUX_TEST_RESULT([create_flags], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
],[
|
||||||
|
ZFS_LINUX_TEST_ERROR([iops->create()])
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,8 +1,29 @@
|
|||||||
dnl #
|
|
||||||
dnl # Linux 4.11 API
|
|
||||||
dnl # See torvalds/linux@a528d35
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GETATTR], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GETATTR], [
|
||||||
|
dnl #
|
||||||
|
dnl # Linux 5.12 API
|
||||||
|
dnl # The getattr I/O operations handler type was extended to require
|
||||||
|
dnl # a struct user_namespace* as its first arg, to support idmapped
|
||||||
|
dnl # mounts.
|
||||||
|
dnl #
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_operations_getattr_userns], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
|
||||||
|
int test_getattr(
|
||||||
|
struct user_namespace *userns,
|
||||||
|
const struct path *p, struct kstat *k,
|
||||||
|
u32 request_mask, unsigned int query_flags)
|
||||||
|
{ return 0; }
|
||||||
|
|
||||||
|
static const struct inode_operations
|
||||||
|
iops __attribute__ ((unused)) = {
|
||||||
|
.getattr = test_getattr,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Linux 4.11 API
|
||||||
|
dnl # See torvalds/linux@a528d35
|
||||||
|
dnl #
|
||||||
ZFS_LINUX_TEST_SRC([inode_operations_getattr_path], [
|
ZFS_LINUX_TEST_SRC([inode_operations_getattr_path], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
@@ -33,21 +54,39 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GETATTR], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_GETATTR], [
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_GETATTR], [
|
||||||
AC_MSG_CHECKING([whether iops->getattr() takes a path])
|
dnl #
|
||||||
ZFS_LINUX_TEST_RESULT([inode_operations_getattr_path], [
|
dnl # Kernel 5.12 test
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([whether iops->getattr() takes user_namespace])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_operations_getattr_userns], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_PATH_IOPS_GETATTR, 1,
|
AC_DEFINE(HAVE_USERNS_IOPS_GETATTR, 1,
|
||||||
[iops->getattr() takes a path])
|
[iops->getattr() takes struct user_namespace*])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether iops->getattr() takes a vfsmount])
|
dnl #
|
||||||
ZFS_LINUX_TEST_RESULT([inode_operations_getattr_vfsmount], [
|
dnl # Kernel 4.11 test
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([whether iops->getattr() takes a path])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_operations_getattr_path], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_VFSMOUNT_IOPS_GETATTR, 1,
|
AC_DEFINE(HAVE_PATH_IOPS_GETATTR, 1,
|
||||||
[iops->getattr() takes a vfsmount])
|
[iops->getattr() takes a path])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Kernel < 4.11 test
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([whether iops->getattr() takes a vfsmount])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_operations_getattr_vfsmount], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_VFSMOUNT_IOPS_GETATTR, 1,
|
||||||
|
[iops->getattr() takes a vfsmount])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -11,13 +11,32 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OWNER_OR_CAPABLE], [
|
|||||||
struct inode *ip = NULL;
|
struct inode *ip = NULL;
|
||||||
(void) inode_owner_or_capable(ip);
|
(void) inode_owner_or_capable(ip);
|
||||||
])
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_owner_or_capable_idmapped], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
],[
|
||||||
|
struct inode *ip = NULL;
|
||||||
|
(void) inode_owner_or_capable(&init_user_ns, ip);
|
||||||
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_OWNER_OR_CAPABLE], [
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_OWNER_OR_CAPABLE], [
|
||||||
AC_MSG_CHECKING([whether inode_owner_or_capable() exists])
|
AC_MSG_CHECKING([whether inode_owner_or_capable() exists])
|
||||||
ZFS_LINUX_TEST_RESULT([inode_owner_or_capable], [
|
ZFS_LINUX_TEST_RESULT([inode_owner_or_capable], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
],[
|
AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1,
|
||||||
ZFS_LINUX_TEST_ERROR([capability])
|
[inode_owner_or_capable() exists])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(
|
||||||
|
[whether inode_owner_or_capable() takes user_ns])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_owner_or_capable_idmapped], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE_IDMAPPED, 1,
|
||||||
|
[inode_owner_or_capable() takes user_ns])
|
||||||
|
],[
|
||||||
|
ZFS_LINUX_TEST_ERROR([capability])
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -27,6 +27,15 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN], [
|
|||||||
q = blk_alloc_queue(make_request, NUMA_NO_NODE);
|
q = blk_alloc_queue(make_request, NUMA_NO_NODE);
|
||||||
])
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([blk_alloc_queue_request_fn_rh], [
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
blk_qc_t make_request(struct request_queue *q,
|
||||||
|
struct bio *bio) { return (BLK_QC_T_NONE); }
|
||||||
|
],[
|
||||||
|
struct request_queue *q __attribute__ ((unused));
|
||||||
|
q = blk_alloc_queue_rh(make_request, NUMA_NO_NODE);
|
||||||
|
])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([block_device_operations_submit_bio], [
|
ZFS_LINUX_TEST_SRC([block_device_operations_submit_bio], [
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
@@ -47,7 +56,9 @@ AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
|
|||||||
|
|
||||||
AC_DEFINE(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS, 1,
|
AC_DEFINE(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS, 1,
|
||||||
[submit_bio is member of struct block_device_operations])
|
[submit_bio is member of struct block_device_operations])
|
||||||
],[
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
dnl # Checked as part of the blk_alloc_queue_request_fn test
|
dnl # Checked as part of the blk_alloc_queue_request_fn test
|
||||||
dnl #
|
dnl #
|
||||||
dnl # Linux 5.7 API Change
|
dnl # Linux 5.7 API Change
|
||||||
@@ -55,6 +66,9 @@ AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
|
|||||||
dnl #
|
dnl #
|
||||||
AC_MSG_CHECKING([whether blk_alloc_queue() expects request function])
|
AC_MSG_CHECKING([whether blk_alloc_queue() expects request function])
|
||||||
ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn], [
|
ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
|
||||||
|
dnl # This is currently always the case.
|
||||||
AC_MSG_CHECKING([whether make_request_fn() returns blk_qc_t])
|
AC_MSG_CHECKING([whether make_request_fn() returns blk_qc_t])
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
|
|
||||||
@@ -66,34 +80,59 @@ AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
|
|||||||
[Noting that make_request_fn() returns blk_qc_t])
|
[Noting that make_request_fn() returns blk_qc_t])
|
||||||
],[
|
],[
|
||||||
dnl #
|
dnl #
|
||||||
dnl # Linux 3.2 API Change
|
dnl # CentOS Stream 4.18.0-257 API Change
|
||||||
dnl # make_request_fn returns void.
|
dnl # The Linux 5.7 blk_alloc_queue() change was back-
|
||||||
|
dnl # ported and the symbol renamed blk_alloc_queue_rh().
|
||||||
|
dnl # As of this kernel version they're not providing
|
||||||
|
dnl # any compatibility code in the kernel for this.
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_CHECKING([whether make_request_fn() returns void])
|
ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn_rh], [
|
||||||
ZFS_LINUX_TEST_RESULT([make_request_fn_void], [
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(MAKE_REQUEST_FN_RET, void,
|
|
||||||
|
dnl # This is currently always the case.
|
||||||
|
AC_MSG_CHECKING([whether make_request_fn_rh() returns blk_qc_t])
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
|
||||||
|
AC_DEFINE(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH, 1,
|
||||||
|
[blk_alloc_queue_rh() expects request function])
|
||||||
|
AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
|
||||||
[make_request_fn() return type])
|
[make_request_fn() return type])
|
||||||
AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_VOID, 1,
|
AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
|
||||||
[Noting that make_request_fn() returns void])
|
[Noting that make_request_fn() returns blk_qc_t])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # Linux 4.4 API Change
|
dnl # Linux 3.2 API Change
|
||||||
dnl # make_request_fn returns blk_qc_t.
|
dnl # make_request_fn returns void.
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_CHECKING(
|
AC_MSG_CHECKING(
|
||||||
[whether make_request_fn() returns blk_qc_t])
|
[whether make_request_fn() returns void])
|
||||||
ZFS_LINUX_TEST_RESULT([make_request_fn_blk_qc_t], [
|
ZFS_LINUX_TEST_RESULT([make_request_fn_void], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
|
AC_DEFINE(MAKE_REQUEST_FN_RET, void,
|
||||||
[make_request_fn() return type])
|
[make_request_fn() return type])
|
||||||
AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
|
AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_VOID, 1,
|
||||||
[Noting that make_request_fn() ]
|
[Noting that make_request_fn() returns void])
|
||||||
[returns blk_qc_t])
|
|
||||||
],[
|
],[
|
||||||
ZFS_LINUX_TEST_ERROR([make_request_fn])
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Linux 4.4 API Change
|
||||||
|
dnl # make_request_fn returns blk_qc_t.
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING(
|
||||||
|
[whether make_request_fn() returns blk_qc_t])
|
||||||
|
ZFS_LINUX_TEST_RESULT([make_request_fn_blk_qc_t], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
|
||||||
|
[make_request_fn() return type])
|
||||||
|
AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
|
||||||
|
[Noting that make_request_fn() ]
|
||||||
|
[returns blk_qc_t])
|
||||||
|
],[
|
||||||
|
ZFS_LINUX_TEST_ERROR([make_request_fn])
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
dnl #
|
|
||||||
dnl # 3.3 API change
|
|
||||||
dnl # The VFS .create, .mkdir and .mknod callbacks were updated to take a
|
|
||||||
dnl # umode_t type rather than an int. The expectation is that any backport
|
|
||||||
dnl # would also change all three prototypes. However, if it turns out that
|
|
||||||
dnl # some distribution doesn't backport the whole thing this could be
|
|
||||||
dnl # broken apart into three separate checks.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_MKDIR_UMODE_T], [
|
|
||||||
ZFS_LINUX_TEST_SRC([inode_operations_mkdir], [
|
|
||||||
#include <linux/fs.h>
|
|
||||||
|
|
||||||
int mkdir(struct inode *inode, struct dentry *dentry,
|
|
||||||
umode_t umode) { return 0; }
|
|
||||||
|
|
||||||
static const struct inode_operations
|
|
||||||
iops __attribute__ ((unused)) = {
|
|
||||||
.mkdir = mkdir,
|
|
||||||
};
|
|
||||||
],[])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_MKDIR_UMODE_T], [
|
|
||||||
AC_MSG_CHECKING([whether iops->create()/mkdir()/mknod() take umode_t])
|
|
||||||
ZFS_LINUX_TEST_RESULT([inode_operations_mkdir], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_MKDIR_UMODE_T, 1,
|
|
||||||
[iops->create()/mkdir()/mknod() take umode_t])
|
|
||||||
],[
|
|
||||||
ZFS_LINUX_TEST_ERROR([mkdir()])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Supported mkdir() interfaces checked newest to oldest.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_MKDIR], [
|
||||||
|
dnl #
|
||||||
|
dnl # 5.12 API change
|
||||||
|
dnl # The struct user_namespace arg was added as the first argument to
|
||||||
|
dnl # mkdir()
|
||||||
|
dnl #
|
||||||
|
ZFS_LINUX_TEST_SRC([mkdir_user_namespace], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
|
||||||
|
int mkdir(struct user_namespace *userns,
|
||||||
|
struct inode *inode, struct dentry *dentry,
|
||||||
|
umode_t umode) { return 0; }
|
||||||
|
|
||||||
|
static const struct inode_operations
|
||||||
|
iops __attribute__ ((unused)) = {
|
||||||
|
.mkdir = mkdir,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 3.3 API change
|
||||||
|
dnl # The VFS .create, .mkdir and .mknod callbacks were updated to take a
|
||||||
|
dnl # umode_t type rather than an int. The expectation is that any backport
|
||||||
|
dnl # would also change all three prototypes. However, if it turns out that
|
||||||
|
dnl # some distribution doesn't backport the whole thing this could be
|
||||||
|
dnl # broken apart into three separate checks.
|
||||||
|
dnl #
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_operations_mkdir], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
|
||||||
|
int mkdir(struct inode *inode, struct dentry *dentry,
|
||||||
|
umode_t umode) { return 0; }
|
||||||
|
|
||||||
|
static const struct inode_operations
|
||||||
|
iops __attribute__ ((unused)) = {
|
||||||
|
.mkdir = mkdir,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_MKDIR], [
|
||||||
|
dnl #
|
||||||
|
dnl # 5.12 API change
|
||||||
|
dnl # The struct user_namespace arg was added as the first argument to
|
||||||
|
dnl # mkdir() of the iops structure.
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([whether iops->mkdir() takes struct user_namespace*])
|
||||||
|
ZFS_LINUX_TEST_RESULT([mkdir_user_namespace], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOPS_MKDIR_USERNS, 1,
|
||||||
|
[iops->mkdir() takes struct user_namespace*])
|
||||||
|
],[
|
||||||
|
AC_MSG_CHECKING([whether iops->mkdir() takes umode_t])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_operations_mkdir], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_MKDIR_UMODE_T, 1,
|
||||||
|
[iops->mkdir() takes umode_t])
|
||||||
|
],[
|
||||||
|
ZFS_LINUX_TEST_ERROR([mkdir()])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
])
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_MKNOD], [
|
||||||
|
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([mknod_userns], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/sched.h>
|
||||||
|
|
||||||
|
int tmp_mknod(struct user_namespace *userns,
|
||||||
|
struct inode *inode ,struct dentry *dentry,
|
||||||
|
umode_t u, dev_t d) { return 0; }
|
||||||
|
|
||||||
|
static const struct inode_operations
|
||||||
|
iops __attribute__ ((unused)) = {
|
||||||
|
.mknod = tmp_mknod,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_MKNOD], [
|
||||||
|
AC_MSG_CHECKING([whether iops->mknod() takes struct user_namespace*])
|
||||||
|
ZFS_LINUX_TEST_RESULT([mknod_userns], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOPS_MKNOD_USERNS, 1,
|
||||||
|
[iops->mknod() takes struct user_namespace*])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
+38
-12
@@ -1,10 +1,10 @@
|
|||||||
dnl #
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_RENAME], [
|
||||||
dnl # 4.9 API change,
|
dnl #
|
||||||
dnl # iops->rename2() merged into iops->rename(), and iops->rename() now wants
|
dnl # 4.9 API change,
|
||||||
dnl # flags.
|
dnl # iops->rename2() merged into iops->rename(), and iops->rename() now wants
|
||||||
dnl #
|
dnl # flags.
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_RENAME_WANTS_FLAGS], [
|
dnl #
|
||||||
ZFS_LINUX_TEST_SRC([inode_operations_rename], [
|
ZFS_LINUX_TEST_SRC([inode_operations_rename_flags], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
int rename_fn(struct inode *sip, struct dentry *sdp,
|
int rename_fn(struct inode *sip, struct dentry *sdp,
|
||||||
struct inode *tip, struct dentry *tdp,
|
struct inode *tip, struct dentry *tdp,
|
||||||
@@ -15,15 +15,41 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_RENAME_WANTS_FLAGS], [
|
|||||||
.rename = rename_fn,
|
.rename = rename_fn,
|
||||||
};
|
};
|
||||||
],[])
|
],[])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 5.12 API change,
|
||||||
|
dnl #
|
||||||
|
dnl # Linux 5.12 introduced passing struct user_namespace* as the first argument
|
||||||
|
dnl # of the rename() and other inode_operations members.
|
||||||
|
dnl #
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_operations_rename_userns], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
int rename_fn(struct user_namespace *user_ns, struct inode *sip,
|
||||||
|
struct dentry *sdp, struct inode *tip, struct dentry *tdp,
|
||||||
|
unsigned int flags) { return 0; }
|
||||||
|
|
||||||
|
static const struct inode_operations
|
||||||
|
iops __attribute__ ((unused)) = {
|
||||||
|
.rename = rename_fn,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_RENAME_WANTS_FLAGS], [
|
AC_DEFUN([ZFS_AC_KERNEL_RENAME], [
|
||||||
AC_MSG_CHECKING([whether iops->rename() wants flags])
|
AC_MSG_CHECKING([whether iops->rename() takes struct user_namespace*])
|
||||||
ZFS_LINUX_TEST_RESULT([inode_operations_rename], [
|
ZFS_LINUX_TEST_RESULT([inode_operations_rename_userns], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_RENAME_WANTS_FLAGS, 1,
|
AC_DEFINE(HAVE_IOPS_RENAME_USERNS, 1,
|
||||||
[iops->rename() wants flags])
|
[iops->rename() takes struct user_namespace*])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_operations_rename_flags], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_RENAME_WANTS_FLAGS, 1,
|
||||||
|
[iops->rename() wants flags])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,24 +1,46 @@
|
|||||||
dnl #
|
dnl #
|
||||||
|
dnl # 5.11 API change
|
||||||
|
dnl # revalidate_disk_size() has been removed entirely.
|
||||||
|
dnl #
|
||||||
dnl # 5.10 API change
|
dnl # 5.10 API change
|
||||||
dnl # revalidate_disk() was replaced by revalidate_disk_size()
|
dnl # revalidate_disk() was replaced by revalidate_disk_size()
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_REVALIDATE_DISK_SIZE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_REVALIDATE_DISK], [
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([revalidate_disk_size], [
|
ZFS_LINUX_TEST_SRC([revalidate_disk_size], [
|
||||||
#include <linux/genhd.h>
|
#include <linux/genhd.h>
|
||||||
], [
|
], [
|
||||||
struct gendisk *disk = NULL;
|
struct gendisk *disk = NULL;
|
||||||
(void) revalidate_disk_size(disk, false);
|
(void) revalidate_disk_size(disk, false);
|
||||||
])
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([revalidate_disk], [
|
||||||
|
#include <linux/genhd.h>
|
||||||
|
], [
|
||||||
|
struct gendisk *disk = NULL;
|
||||||
|
(void) revalidate_disk(disk);
|
||||||
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_REVALIDATE_DISK_SIZE], [
|
AC_DEFUN([ZFS_AC_KERNEL_REVALIDATE_DISK], [
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether revalidate_disk_size() is available])
|
AC_MSG_CHECKING([whether revalidate_disk_size() is available])
|
||||||
ZFS_LINUX_TEST_RESULT_SYMBOL([revalidate_disk_size],
|
ZFS_LINUX_TEST_RESULT_SYMBOL([revalidate_disk_size],
|
||||||
[revalidate_disk_size], [block/genhd.c], [
|
[revalidate_disk_size], [block/genhd.c], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_REVALIDATE_DISK_SIZE, 1,
|
AC_DEFINE(HAVE_REVALIDATE_DISK_SIZE, 1,
|
||||||
[revalidate_disk_size() is available])
|
[revalidate_disk_size() is available])
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether revalidate_disk() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([revalidate_disk],
|
||||||
|
[revalidate_disk], [block/genhd.c], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_REVALIDATE_DISK, 1,
|
||||||
|
[revalidate_disk() is available])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,29 +1,3 @@
|
|||||||
dnl #
|
|
||||||
dnl # 3.1 API Change
|
|
||||||
dnl #
|
|
||||||
dnl # The rw_semaphore.wait_lock member was changed from spinlock_t to
|
|
||||||
dnl # raw_spinlock_t at commit ddb6c9b58a19edcfac93ac670b066c836ff729f1.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM_SPINLOCK_IS_RAW], [
|
|
||||||
ZFS_LINUX_TEST_SRC([rwsem_spinlock_is_raw], [
|
|
||||||
#include <linux/rwsem.h>
|
|
||||||
],[
|
|
||||||
struct rw_semaphore dummy_semaphore __attribute__ ((unused));
|
|
||||||
raw_spinlock_t dummy_lock __attribute__ ((unused)) =
|
|
||||||
__RAW_SPIN_LOCK_INITIALIZER(dummy_lock);
|
|
||||||
dummy_semaphore.wait_lock = dummy_lock;
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_RWSEM_SPINLOCK_IS_RAW], [
|
|
||||||
AC_MSG_CHECKING([whether struct rw_semaphore member wait_lock is raw])
|
|
||||||
ZFS_LINUX_TEST_RESULT([rwsem_spinlock_is_raw], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
],[
|
|
||||||
ZFS_LINUX_TEST_ERROR([rwsem_spinlock_is_raw])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 3.16 API Change
|
dnl # 3.16 API Change
|
||||||
dnl #
|
dnl #
|
||||||
@@ -76,13 +50,11 @@ AC_DEFUN([ZFS_AC_KERNEL_RWSEM_ATOMIC_LONG_COUNT], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM], [
|
||||||
ZFS_AC_KERNEL_SRC_RWSEM_SPINLOCK_IS_RAW
|
|
||||||
ZFS_AC_KERNEL_SRC_RWSEM_ACTIVITY
|
ZFS_AC_KERNEL_SRC_RWSEM_ACTIVITY
|
||||||
ZFS_AC_KERNEL_SRC_RWSEM_ATOMIC_LONG_COUNT
|
ZFS_AC_KERNEL_SRC_RWSEM_ATOMIC_LONG_COUNT
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_RWSEM], [
|
AC_DEFUN([ZFS_AC_KERNEL_RWSEM], [
|
||||||
ZFS_AC_KERNEL_RWSEM_SPINLOCK_IS_RAW
|
|
||||||
ZFS_AC_KERNEL_RWSEM_ACTIVITY
|
ZFS_AC_KERNEL_RWSEM_ACTIVITY
|
||||||
ZFS_AC_KERNEL_RWSEM_ATOMIC_LONG_COUNT
|
ZFS_AC_KERNEL_RWSEM_ATOMIC_LONG_COUNT
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,27 +1,52 @@
|
|||||||
dnl #
|
|
||||||
dnl # 4.9 API change
|
|
||||||
dnl # The inode_change_ok() function has been renamed setattr_prepare()
|
|
||||||
dnl # and updated to take a dentry rather than an inode.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_SETATTR_PREPARE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_SETATTR_PREPARE], [
|
||||||
|
dnl #
|
||||||
|
dnl # 4.9 API change
|
||||||
|
dnl # The inode_change_ok() function has been renamed setattr_prepare()
|
||||||
|
dnl # and updated to take a dentry rather than an inode.
|
||||||
|
dnl #
|
||||||
ZFS_LINUX_TEST_SRC([setattr_prepare], [
|
ZFS_LINUX_TEST_SRC([setattr_prepare], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
], [
|
], [
|
||||||
struct dentry *dentry = NULL;
|
struct dentry *dentry = NULL;
|
||||||
struct iattr *attr = NULL;
|
struct iattr *attr = NULL;
|
||||||
int error __attribute__ ((unused)) =
|
int error __attribute__ ((unused)) =
|
||||||
setattr_prepare(dentry, attr);
|
setattr_prepare(dentry, attr);
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 5.12 API change
|
||||||
|
dnl # The setattr_prepare() function has been changed to accept a new argument
|
||||||
|
dnl # for struct user_namespace*
|
||||||
|
dnl #
|
||||||
|
ZFS_LINUX_TEST_SRC([setattr_prepare_userns], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
], [
|
||||||
|
struct dentry *dentry = NULL;
|
||||||
|
struct iattr *attr = NULL;
|
||||||
|
struct user_namespace *userns = NULL;
|
||||||
|
int error __attribute__ ((unused)) =
|
||||||
|
setattr_prepare(userns, dentry, attr);
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SETATTR_PREPARE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SETATTR_PREPARE], [
|
||||||
AC_MSG_CHECKING([whether setattr_prepare() is available])
|
AC_MSG_CHECKING([whether setattr_prepare() is available and accepts struct user_namespace*])
|
||||||
ZFS_LINUX_TEST_RESULT_SYMBOL([setattr_prepare],
|
ZFS_LINUX_TEST_RESULT_SYMBOL([setattr_prepare_userns],
|
||||||
[setattr_prepare], [fs/attr.c], [
|
[setattr_prepare], [fs/attr.c], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_SETATTR_PREPARE, 1,
|
AC_DEFINE(HAVE_SETATTR_PREPARE_USERNS, 1,
|
||||||
[setattr_prepare() is available])
|
[setattr_prepare() accepts user_namespace])
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether setattr_prepare() is available, doesn't accept user_namespace])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([setattr_prepare],
|
||||||
|
[setattr_prepare], [fs/attr.c], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_SETATTR_PREPARE_NO_USERNS, 1,
|
||||||
|
[setattr_prepare() is available, doesn't accept user_namespace])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_SYMLINK], [
|
||||||
|
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([symlink_userns], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/sched.h>
|
||||||
|
|
||||||
|
int tmp_symlink(struct user_namespace *userns,
|
||||||
|
struct inode *inode ,struct dentry *dentry,
|
||||||
|
const char *path) { return 0; }
|
||||||
|
|
||||||
|
static const struct inode_operations
|
||||||
|
iops __attribute__ ((unused)) = {
|
||||||
|
.symlink = tmp_symlink,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SYMLINK], [
|
||||||
|
AC_MSG_CHECKING([whether iops->symlink() takes struct user_namespace*])
|
||||||
|
ZFS_LINUX_TEST_RESULT([symlink_userns], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOPS_SYMLINK_USERNS, 1,
|
||||||
|
[iops->symlink() takes struct user_namespace*])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
@@ -3,23 +3,43 @@ dnl # 3.11 API change
|
|||||||
dnl # Add support for i_op->tmpfile
|
dnl # Add support for i_op->tmpfile
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_TMPFILE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_TMPFILE], [
|
||||||
ZFS_LINUX_TEST_SRC([inode_operations_tmpfile], [
|
dnl #
|
||||||
|
dnl # 5.11 API change
|
||||||
|
dnl # add support for userns parameter to tmpfile
|
||||||
|
dnl #
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_operations_tmpfile_userns], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
int tmpfile(struct inode *inode, struct dentry *dentry,
|
int tmpfile(struct user_namespace *userns,
|
||||||
|
struct inode *inode, struct dentry *dentry,
|
||||||
umode_t mode) { return 0; }
|
umode_t mode) { return 0; }
|
||||||
static struct inode_operations
|
static struct inode_operations
|
||||||
iops __attribute__ ((unused)) = {
|
iops __attribute__ ((unused)) = {
|
||||||
.tmpfile = tmpfile,
|
.tmpfile = tmpfile,
|
||||||
};
|
};
|
||||||
],[])
|
],[])
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_operations_tmpfile], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
int tmpfile(struct inode *inode, struct dentry *dentry,
|
||||||
|
umode_t mode) { return 0; }
|
||||||
|
static struct inode_operations
|
||||||
|
iops __attribute__ ((unused)) = {
|
||||||
|
.tmpfile = tmpfile,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_TMPFILE], [
|
AC_DEFUN([ZFS_AC_KERNEL_TMPFILE], [
|
||||||
AC_MSG_CHECKING([whether i_op->tmpfile() exists])
|
AC_MSG_CHECKING([whether i_op->tmpfile() exists])
|
||||||
ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile], [
|
ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_userns], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
|
AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
|
||||||
|
AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -0,0 +1,206 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Check for available iov_iter functionality.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_IOV_ITER], [
|
||||||
|
ZFS_LINUX_TEST_SRC([iov_iter_types], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
int type __attribute__ ((unused)) =
|
||||||
|
ITER_IOVEC | ITER_KVEC | ITER_BVEC | ITER_PIPE;
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([iov_iter_init], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
struct iov_iter iter = { 0 };
|
||||||
|
struct iovec iov;
|
||||||
|
unsigned long nr_segs = 1;
|
||||||
|
size_t count = 1024;
|
||||||
|
|
||||||
|
iov_iter_init(&iter, WRITE, &iov, nr_segs, count);
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([iov_iter_init_legacy], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
struct iov_iter iter = { 0 };
|
||||||
|
struct iovec iov;
|
||||||
|
unsigned long nr_segs = 1;
|
||||||
|
size_t count = 1024;
|
||||||
|
size_t written = 0;
|
||||||
|
|
||||||
|
iov_iter_init(&iter, &iov, nr_segs, count, written);
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([iov_iter_advance], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
struct iov_iter iter = { 0 };
|
||||||
|
size_t advance = 512;
|
||||||
|
|
||||||
|
iov_iter_advance(&iter, advance);
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([iov_iter_revert], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
struct iov_iter iter = { 0 };
|
||||||
|
size_t revert = 512;
|
||||||
|
|
||||||
|
iov_iter_revert(&iter, revert);
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([iov_iter_fault_in_readable], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
struct iov_iter iter = { 0 };
|
||||||
|
size_t size = 512;
|
||||||
|
int error __attribute__ ((unused));
|
||||||
|
|
||||||
|
error = iov_iter_fault_in_readable(&iter, size);
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([iov_iter_count], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
struct iov_iter iter = { 0 };
|
||||||
|
size_t bytes __attribute__ ((unused));
|
||||||
|
|
||||||
|
bytes = iov_iter_count(&iter);
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([copy_to_iter], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
struct iov_iter iter = { 0 };
|
||||||
|
char buf[512] = { 0 };
|
||||||
|
size_t size = 512;
|
||||||
|
size_t bytes __attribute__ ((unused));
|
||||||
|
|
||||||
|
bytes = copy_to_iter((const void *)&buf, size, &iter);
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([copy_from_iter], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
struct iov_iter iter = { 0 };
|
||||||
|
char buf[512] = { 0 };
|
||||||
|
size_t size = 512;
|
||||||
|
size_t bytes __attribute__ ((unused));
|
||||||
|
|
||||||
|
bytes = copy_from_iter((void *)&buf, size, &iter);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_VFS_IOV_ITER], [
|
||||||
|
enable_vfs_iov_iter="yes"
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether iov_iter types are available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([iov_iter_types], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOV_ITER_TYPES, 1,
|
||||||
|
[iov_iter types are available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
enable_vfs_iov_iter="no"
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 'iov_iter_init' available in Linux 3.16 and newer.
|
||||||
|
dnl # 'iov_iter_init_legacy' available in Linux 3.15 and older.
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([whether iov_iter_init() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([iov_iter_init], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOV_ITER_INIT, 1,
|
||||||
|
[iov_iter_init() is available])
|
||||||
|
],[
|
||||||
|
ZFS_LINUX_TEST_RESULT([iov_iter_init_legacy], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOV_ITER_INIT_LEGACY, 1,
|
||||||
|
[iov_iter_init() is available])
|
||||||
|
],[
|
||||||
|
ZFS_LINUX_TEST_ERROR([iov_iter_init()])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether iov_iter_advance() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([iov_iter_advance], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOV_ITER_ADVANCE, 1,
|
||||||
|
[iov_iter_advance() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
enable_vfs_iov_iter="no"
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether iov_iter_revert() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([iov_iter_revert], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOV_ITER_REVERT, 1,
|
||||||
|
[iov_iter_revert() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
enable_vfs_iov_iter="no"
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether iov_iter_fault_in_readable() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([iov_iter_fault_in_readable], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOV_ITER_FAULT_IN_READABLE, 1,
|
||||||
|
[iov_iter_fault_in_readable() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
enable_vfs_iov_iter="no"
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether iov_iter_count() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([iov_iter_count], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOV_ITER_COUNT, 1,
|
||||||
|
[iov_iter_count() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
enable_vfs_iov_iter="no"
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether copy_to_iter() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([copy_to_iter], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_COPY_TO_ITER, 1,
|
||||||
|
[copy_to_iter() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
enable_vfs_iov_iter="no"
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether copy_from_iter() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([copy_from_iter], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_COPY_FROM_ITER, 1,
|
||||||
|
[copy_from_iter() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
enable_vfs_iov_iter="no"
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # As of the 4.9 kernel support is provided for iovecs, kvecs,
|
||||||
|
dnl # bvecs and pipes in the iov_iter structure. As long as the
|
||||||
|
dnl # other support interfaces are all available the iov_iter can
|
||||||
|
dnl # be correctly used in the uio structure.
|
||||||
|
dnl #
|
||||||
|
AS_IF([test "x$enable_vfs_iov_iter" = "xyes"], [
|
||||||
|
AC_DEFINE(HAVE_VFS_IOV_ITER, 1,
|
||||||
|
[All required iov_iter interfaces are available])
|
||||||
|
])
|
||||||
|
])
|
||||||
@@ -152,6 +152,21 @@ dnl #
|
|||||||
dnl # Supported xattr handler set() interfaces checked newest to oldest.
|
dnl # Supported xattr handler set() interfaces checked newest to oldest.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_SET], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_SET], [
|
||||||
|
ZFS_LINUX_TEST_SRC([xattr_handler_set_userns], [
|
||||||
|
#include <linux/xattr.h>
|
||||||
|
|
||||||
|
int set(const struct xattr_handler *handler,
|
||||||
|
struct user_namespace *mnt_userns,
|
||||||
|
struct dentry *dentry, struct inode *inode,
|
||||||
|
const char *name, const void *buffer,
|
||||||
|
size_t size, int flags)
|
||||||
|
{ return 0; }
|
||||||
|
static const struct xattr_handler
|
||||||
|
xops __attribute__ ((unused)) = {
|
||||||
|
.set = set,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([xattr_handler_set_dentry_inode], [
|
ZFS_LINUX_TEST_SRC([xattr_handler_set_dentry_inode], [
|
||||||
#include <linux/xattr.h>
|
#include <linux/xattr.h>
|
||||||
|
|
||||||
@@ -194,45 +209,58 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_SET], [
|
|||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
|
AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 4.7 API change,
|
dnl # 5.12 API change,
|
||||||
dnl # The xattr_handler->set() callback was changed to take both
|
dnl # The xattr_handler->set() callback was changed to 8 arguments, and
|
||||||
dnl # dentry and inode.
|
dnl # struct user_namespace* was inserted as arg #2
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_CHECKING([whether xattr_handler->set() wants dentry and inode])
|
AC_MSG_CHECKING([whether xattr_handler->set() wants dentry, inode, and user_namespace])
|
||||||
ZFS_LINUX_TEST_RESULT([xattr_handler_set_dentry_inode], [
|
ZFS_LINUX_TEST_RESULT([xattr_handler_set_userns], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_XATTR_SET_DENTRY_INODE, 1,
|
AC_DEFINE(HAVE_XATTR_SET_USERNS, 1,
|
||||||
[xattr_handler->set() wants both dentry and inode])
|
[xattr_handler->set() takes user_namespace])
|
||||||
],[
|
],[
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 4.4 API change,
|
dnl # 4.7 API change,
|
||||||
dnl # The xattr_handler->set() callback was changed to take a
|
dnl # The xattr_handler->set() callback was changed to take both
|
||||||
dnl # xattr_handler, and handler_flags argument was removed and
|
dnl # dentry and inode.
|
||||||
dnl # should be accessed by handler->flags.
|
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
AC_MSG_CHECKING(
|
AC_MSG_CHECKING([whether xattr_handler->set() wants dentry and inode])
|
||||||
[whether xattr_handler->set() wants xattr_handler])
|
ZFS_LINUX_TEST_RESULT([xattr_handler_set_dentry_inode], [
|
||||||
ZFS_LINUX_TEST_RESULT([xattr_handler_set_xattr_handler], [
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_XATTR_SET_HANDLER, 1,
|
AC_DEFINE(HAVE_XATTR_SET_DENTRY_INODE, 1,
|
||||||
[xattr_handler->set() wants xattr_handler])
|
[xattr_handler->set() wants both dentry and inode])
|
||||||
],[
|
],[
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 2.6.33 API change,
|
dnl # 4.4 API change,
|
||||||
dnl # The xattr_handler->set() callback was changed
|
dnl # The xattr_handler->set() callback was changed to take a
|
||||||
dnl # to take a dentry instead of an inode, and a
|
dnl # xattr_handler, and handler_flags argument was removed and
|
||||||
dnl # handler_flags argument was added.
|
dnl # should be accessed by handler->flags.
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
AC_MSG_CHECKING(
|
AC_MSG_CHECKING(
|
||||||
[whether xattr_handler->set() wants dentry])
|
[whether xattr_handler->set() wants xattr_handler])
|
||||||
ZFS_LINUX_TEST_RESULT([xattr_handler_set_dentry], [
|
ZFS_LINUX_TEST_RESULT([xattr_handler_set_xattr_handler], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_XATTR_SET_DENTRY, 1,
|
AC_DEFINE(HAVE_XATTR_SET_HANDLER, 1,
|
||||||
[xattr_handler->set() wants dentry])
|
[xattr_handler->set() wants xattr_handler])
|
||||||
],[
|
],[
|
||||||
ZFS_LINUX_TEST_ERROR([xattr set()])
|
dnl #
|
||||||
|
dnl # 2.6.33 API change,
|
||||||
|
dnl # The xattr_handler->set() callback was changed
|
||||||
|
dnl # to take a dentry instead of an inode, and a
|
||||||
|
dnl # handler_flags argument was added.
|
||||||
|
dnl #
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
AC_MSG_CHECKING(
|
||||||
|
[whether xattr_handler->set() wants dentry])
|
||||||
|
ZFS_LINUX_TEST_RESULT([xattr_handler_set_dentry], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_XATTR_SET_DENTRY, 1,
|
||||||
|
[xattr_handler->set() wants dentry])
|
||||||
|
],[
|
||||||
|
ZFS_LINUX_TEST_ERROR([xattr set()])
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
+42
-27
@@ -61,8 +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_GET_DISK_AND_MODULE
|
ZFS_AC_KERNEL_SRC_REVALIDATE_DISK
|
||||||
ZFS_AC_KERNEL_SRC_REVALIDATE_DISK_SIZE
|
|
||||||
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
|
||||||
ZFS_AC_KERNEL_SRC_DISCARD_GRANULARITY
|
ZFS_AC_KERNEL_SRC_DISCARD_GRANULARITY
|
||||||
@@ -80,9 +79,9 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_EVICT_INODE
|
ZFS_AC_KERNEL_SRC_EVICT_INODE
|
||||||
ZFS_AC_KERNEL_SRC_DIRTY_INODE
|
ZFS_AC_KERNEL_SRC_DIRTY_INODE
|
||||||
ZFS_AC_KERNEL_SRC_SHRINKER
|
ZFS_AC_KERNEL_SRC_SHRINKER
|
||||||
ZFS_AC_KERNEL_SRC_MKDIR_UMODE_T
|
ZFS_AC_KERNEL_SRC_MKDIR
|
||||||
ZFS_AC_KERNEL_SRC_LOOKUP_FLAGS
|
ZFS_AC_KERNEL_SRC_LOOKUP_FLAGS
|
||||||
ZFS_AC_KERNEL_SRC_CREATE_FLAGS
|
ZFS_AC_KERNEL_SRC_CREATE
|
||||||
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
|
||||||
@@ -106,6 +105,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_VFS_DIRECT_IO
|
ZFS_AC_KERNEL_SRC_VFS_DIRECT_IO
|
||||||
ZFS_AC_KERNEL_SRC_VFS_RW_ITERATE
|
ZFS_AC_KERNEL_SRC_VFS_RW_ITERATE
|
||||||
ZFS_AC_KERNEL_SRC_VFS_GENERIC_WRITE_CHECKS
|
ZFS_AC_KERNEL_SRC_VFS_GENERIC_WRITE_CHECKS
|
||||||
|
ZFS_AC_KERNEL_SRC_VFS_IOV_ITER
|
||||||
ZFS_AC_KERNEL_SRC_KMAP_ATOMIC_ARGS
|
ZFS_AC_KERNEL_SRC_KMAP_ATOMIC_ARGS
|
||||||
ZFS_AC_KERNEL_SRC_FOLLOW_DOWN_ONE
|
ZFS_AC_KERNEL_SRC_FOLLOW_DOWN_ONE
|
||||||
ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN
|
ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN
|
||||||
@@ -115,7 +115,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_KUIDGID_T
|
ZFS_AC_KERNEL_SRC_KUIDGID_T
|
||||||
ZFS_AC_KERNEL_SRC_KUID_HELPERS
|
ZFS_AC_KERNEL_SRC_KUID_HELPERS
|
||||||
ZFS_AC_KERNEL_SRC_MODULE_PARAM_CALL_CONST
|
ZFS_AC_KERNEL_SRC_MODULE_PARAM_CALL_CONST
|
||||||
ZFS_AC_KERNEL_SRC_RENAME_WANTS_FLAGS
|
ZFS_AC_KERNEL_SRC_RENAME
|
||||||
ZFS_AC_KERNEL_SRC_CURRENT_TIME
|
ZFS_AC_KERNEL_SRC_CURRENT_TIME
|
||||||
ZFS_AC_KERNEL_SRC_USERNS_CAPABILITIES
|
ZFS_AC_KERNEL_SRC_USERNS_CAPABILITIES
|
||||||
ZFS_AC_KERNEL_SRC_IN_COMPAT_SYSCALL
|
ZFS_AC_KERNEL_SRC_IN_COMPAT_SYSCALL
|
||||||
@@ -124,6 +124,10 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_TOTALHIGH_PAGES
|
ZFS_AC_KERNEL_SRC_TOTALHIGH_PAGES
|
||||||
ZFS_AC_KERNEL_SRC_KSTRTOUL
|
ZFS_AC_KERNEL_SRC_KSTRTOUL
|
||||||
ZFS_AC_KERNEL_SRC_PERCPU
|
ZFS_AC_KERNEL_SRC_PERCPU
|
||||||
|
ZFS_AC_KERNEL_SRC_GENERIC_FILLATTR_USERNS
|
||||||
|
ZFS_AC_KERNEL_SRC_MKNOD
|
||||||
|
ZFS_AC_KERNEL_SRC_SYMLINK
|
||||||
|
ZFS_AC_KERNEL_SRC_BIO_MAX_SEGS
|
||||||
|
|
||||||
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])
|
||||||
@@ -158,8 +162,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_GET_DISK_AND_MODULE
|
ZFS_AC_KERNEL_REVALIDATE_DISK
|
||||||
ZFS_AC_KERNEL_REVALIDATE_DISK_SIZE
|
|
||||||
ZFS_AC_KERNEL_GET_DISK_RO
|
ZFS_AC_KERNEL_GET_DISK_RO
|
||||||
ZFS_AC_KERNEL_GENERIC_READLINK_GLOBAL
|
ZFS_AC_KERNEL_GENERIC_READLINK_GLOBAL
|
||||||
ZFS_AC_KERNEL_DISCARD_GRANULARITY
|
ZFS_AC_KERNEL_DISCARD_GRANULARITY
|
||||||
@@ -177,9 +180,9 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_EVICT_INODE
|
ZFS_AC_KERNEL_EVICT_INODE
|
||||||
ZFS_AC_KERNEL_DIRTY_INODE
|
ZFS_AC_KERNEL_DIRTY_INODE
|
||||||
ZFS_AC_KERNEL_SHRINKER
|
ZFS_AC_KERNEL_SHRINKER
|
||||||
ZFS_AC_KERNEL_MKDIR_UMODE_T
|
ZFS_AC_KERNEL_MKDIR
|
||||||
ZFS_AC_KERNEL_LOOKUP_FLAGS
|
ZFS_AC_KERNEL_LOOKUP_FLAGS
|
||||||
ZFS_AC_KERNEL_CREATE_FLAGS
|
ZFS_AC_KERNEL_CREATE
|
||||||
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
|
||||||
@@ -203,6 +206,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_VFS_DIRECT_IO
|
ZFS_AC_KERNEL_VFS_DIRECT_IO
|
||||||
ZFS_AC_KERNEL_VFS_RW_ITERATE
|
ZFS_AC_KERNEL_VFS_RW_ITERATE
|
||||||
ZFS_AC_KERNEL_VFS_GENERIC_WRITE_CHECKS
|
ZFS_AC_KERNEL_VFS_GENERIC_WRITE_CHECKS
|
||||||
|
ZFS_AC_KERNEL_VFS_IOV_ITER
|
||||||
ZFS_AC_KERNEL_KMAP_ATOMIC_ARGS
|
ZFS_AC_KERNEL_KMAP_ATOMIC_ARGS
|
||||||
ZFS_AC_KERNEL_FOLLOW_DOWN_ONE
|
ZFS_AC_KERNEL_FOLLOW_DOWN_ONE
|
||||||
ZFS_AC_KERNEL_MAKE_REQUEST_FN
|
ZFS_AC_KERNEL_MAKE_REQUEST_FN
|
||||||
@@ -212,7 +216,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_KUIDGID_T
|
ZFS_AC_KERNEL_KUIDGID_T
|
||||||
ZFS_AC_KERNEL_KUID_HELPERS
|
ZFS_AC_KERNEL_KUID_HELPERS
|
||||||
ZFS_AC_KERNEL_MODULE_PARAM_CALL_CONST
|
ZFS_AC_KERNEL_MODULE_PARAM_CALL_CONST
|
||||||
ZFS_AC_KERNEL_RENAME_WANTS_FLAGS
|
ZFS_AC_KERNEL_RENAME
|
||||||
ZFS_AC_KERNEL_CURRENT_TIME
|
ZFS_AC_KERNEL_CURRENT_TIME
|
||||||
ZFS_AC_KERNEL_USERNS_CAPABILITIES
|
ZFS_AC_KERNEL_USERNS_CAPABILITIES
|
||||||
ZFS_AC_KERNEL_IN_COMPAT_SYSCALL
|
ZFS_AC_KERNEL_IN_COMPAT_SYSCALL
|
||||||
@@ -221,6 +225,10 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_TOTALHIGH_PAGES
|
ZFS_AC_KERNEL_TOTALHIGH_PAGES
|
||||||
ZFS_AC_KERNEL_KSTRTOUL
|
ZFS_AC_KERNEL_KSTRTOUL
|
||||||
ZFS_AC_KERNEL_PERCPU
|
ZFS_AC_KERNEL_PERCPU
|
||||||
|
ZFS_AC_KERNEL_GENERIC_FILLATTR_USERNS
|
||||||
|
ZFS_AC_KERNEL_MKNOD
|
||||||
|
ZFS_AC_KERNEL_SYMLINK
|
||||||
|
ZFS_AC_KERNEL_BIO_MAX_SEGS
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
@@ -320,19 +328,15 @@ AC_DEFUN([ZFS_AC_KERNEL], [
|
|||||||
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 && fgrep -q UTS_RELEASE $utsrelease1], [
|
||||||
utsrelease=linux/version.h
|
utsrelease=$utsrelease1
|
||||||
], [test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2], [
|
], [test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2], [
|
||||||
utsrelease=linux/utsrelease.h
|
utsrelease=$utsrelease2
|
||||||
], [test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3], [
|
], [test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3], [
|
||||||
utsrelease=generated/utsrelease.h
|
utsrelease=$utsrelease3
|
||||||
])
|
])
|
||||||
|
|
||||||
AS_IF([test "$utsrelease"], [
|
AS_IF([test -n "$utsrelease"], [
|
||||||
kernsrcver=`(echo "#include <$utsrelease>";
|
kernsrcver=$($AWK '/UTS_RELEASE/ { gsub(/"/, "", $[3]); print $[3] }' $utsrelease)
|
||||||
echo "kernsrcver=UTS_RELEASE") |
|
|
||||||
${CPP} -I $kernelbuild/include - |
|
|
||||||
grep "^kernsrcver=" | cut -d \" -f 2`
|
|
||||||
|
|
||||||
AS_IF([test -z "$kernsrcver"], [
|
AS_IF([test -z "$kernsrcver"], [
|
||||||
AC_MSG_RESULT([Not found])
|
AC_MSG_RESULT([Not found])
|
||||||
AC_MSG_ERROR([
|
AC_MSG_ERROR([
|
||||||
@@ -539,7 +543,9 @@ dnl #
|
|||||||
dnl # ZFS_LINUX_TEST_PROGRAM(C)([PROLOGUE], [BODY])
|
dnl # ZFS_LINUX_TEST_PROGRAM(C)([PROLOGUE], [BODY])
|
||||||
dnl #
|
dnl #
|
||||||
m4_define([ZFS_LINUX_TEST_PROGRAM], [
|
m4_define([ZFS_LINUX_TEST_PROGRAM], [
|
||||||
|
#include <linux/module.h>
|
||||||
$1
|
$1
|
||||||
|
|
||||||
int
|
int
|
||||||
main (void)
|
main (void)
|
||||||
{
|
{
|
||||||
@@ -547,6 +553,11 @@ $2
|
|||||||
;
|
;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MODULE_DESCRIPTION("conftest");
|
||||||
|
MODULE_AUTHOR(ZFS_META_AUTHOR);
|
||||||
|
MODULE_VERSION(ZFS_META_VERSION "-" ZFS_META_RELEASE);
|
||||||
|
MODULE_LICENSE($3);
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
@@ -686,19 +697,21 @@ dnl # $3 - source
|
|||||||
dnl # $4 - extra cflags
|
dnl # $4 - extra cflags
|
||||||
dnl # $5 - check license-compatibility
|
dnl # $5 - check license-compatibility
|
||||||
dnl #
|
dnl #
|
||||||
|
dnl # Check if the test source is buildable at all and then if it is
|
||||||
|
dnl # license compatible.
|
||||||
|
dnl #
|
||||||
dnl # N.B because all of the test cases are compiled in parallel they
|
dnl # N.B because all of the test cases are compiled in parallel they
|
||||||
dnl # must never depend on the results of previous tests. Each test
|
dnl # must never depend on the results of previous tests. Each test
|
||||||
dnl # needs to be entirely independent.
|
dnl # needs to be entirely independent.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_LINUX_TEST_SRC], [
|
AC_DEFUN([ZFS_LINUX_TEST_SRC], [
|
||||||
ZFS_LINUX_CONFTEST_C([ZFS_LINUX_TEST_PROGRAM([[$2]], [[$3]])], [$1])
|
ZFS_LINUX_CONFTEST_C([ZFS_LINUX_TEST_PROGRAM([[$2]], [[$3]],
|
||||||
|
[["Dual BSD/GPL"]])], [$1])
|
||||||
ZFS_LINUX_CONFTEST_MAKEFILE([$1], [yes], [$4])
|
ZFS_LINUX_CONFTEST_MAKEFILE([$1], [yes], [$4])
|
||||||
|
|
||||||
AS_IF([ test -n "$5" ], [
|
AS_IF([ test -n "$5" ], [
|
||||||
ZFS_LINUX_CONFTEST_C([ZFS_LINUX_TEST_PROGRAM([[
|
ZFS_LINUX_CONFTEST_C([ZFS_LINUX_TEST_PROGRAM(
|
||||||
#include <linux/module.h>
|
[[$2]], [[$3]], [[$5]])], [$1_license])
|
||||||
MODULE_LICENSE("$5");
|
|
||||||
$2]], [[$3]])], [$1_license])
|
|
||||||
ZFS_LINUX_CONFTEST_MAKEFILE([$1_license], [yes], [$4])
|
ZFS_LINUX_CONFTEST_MAKEFILE([$1_license], [yes], [$4])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
@@ -788,11 +801,13 @@ dnl #
|
|||||||
AC_DEFUN([ZFS_LINUX_TRY_COMPILE], [
|
AC_DEFUN([ZFS_LINUX_TRY_COMPILE], [
|
||||||
AS_IF([test "x$enable_linux_builtin" = "xyes"], [
|
AS_IF([test "x$enable_linux_builtin" = "xyes"], [
|
||||||
ZFS_LINUX_COMPILE_IFELSE(
|
ZFS_LINUX_COMPILE_IFELSE(
|
||||||
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]])],
|
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]],
|
||||||
|
[[ZFS_META_LICENSE]])],
|
||||||
[test -f build/conftest/conftest.o], [$3], [$4])
|
[test -f build/conftest/conftest.o], [$3], [$4])
|
||||||
], [
|
], [
|
||||||
ZFS_LINUX_COMPILE_IFELSE(
|
ZFS_LINUX_COMPILE_IFELSE(
|
||||||
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]])],
|
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]],
|
||||||
|
[[ZFS_META_LICENSE]])],
|
||||||
[test -f build/conftest/conftest.ko], [$3], [$4])
|
[test -f build/conftest/conftest.ko], [$3], [$4])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
@@ -858,7 +873,7 @@ dnl # provided via the fifth parameter
|
|||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_LINUX_TRY_COMPILE_HEADER], [
|
AC_DEFUN([ZFS_LINUX_TRY_COMPILE_HEADER], [
|
||||||
ZFS_LINUX_COMPILE_IFELSE(
|
ZFS_LINUX_COMPILE_IFELSE(
|
||||||
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]])],
|
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]], [[ZFS_META_LICENSE]])],
|
||||||
[test -f build/conftest/conftest.ko],
|
[test -f build/conftest/conftest.ko],
|
||||||
[$3], [$4], [$5])
|
[$3], [$4], [$5])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
AC_DEFUN([ZFS_AC_CONFIG_USER_MOUNT_HELPER], [
|
AC_DEFUN([ZFS_AC_CONFIG_USER_MOUNT_HELPER], [
|
||||||
AC_ARG_WITH(mounthelperdir,
|
AC_ARG_WITH(mounthelperdir,
|
||||||
AC_HELP_STRING([--with-mounthelperdir=DIR],
|
AS_HELP_STRING([--with-mounthelperdir=DIR],
|
||||||
[install mount.zfs in dir [[/sbin]]]),
|
[install mount.zfs in dir [[/sbin]]]),
|
||||||
mounthelperdir=$withval,mounthelperdir=/sbin)
|
mounthelperdir=$withval,mounthelperdir=/sbin)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
AC_DEFUN([ZFS_AC_CONFIG_USER_DRACUT], [
|
AC_DEFUN([ZFS_AC_CONFIG_USER_DRACUT], [
|
||||||
AC_MSG_CHECKING(for dracut directory)
|
AC_MSG_CHECKING(for dracut directory)
|
||||||
AC_ARG_WITH([dracutdir],
|
AC_ARG_WITH([dracutdir],
|
||||||
AC_HELP_STRING([--with-dracutdir=DIR],
|
AS_HELP_STRING([--with-dracutdir=DIR],
|
||||||
[install dracut helpers @<:@default=check@:>@]),
|
[install dracut helpers @<:@default=check@:>@]),
|
||||||
[dracutdir=$withval],
|
[dracutdir=$withval],
|
||||||
[dracutdir=check])
|
[dracutdir=check])
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
AC_DEFUN([ZFS_AC_CONFIG_USER_ZFSEXEC], [
|
AC_DEFUN([ZFS_AC_CONFIG_USER_ZFSEXEC], [
|
||||||
AC_ARG_WITH(zfsexecdir,
|
AC_ARG_WITH(zfsexecdir,
|
||||||
AC_HELP_STRING([--with-zfsexecdir=DIR],
|
AS_HELP_STRING([--with-zfsexecdir=DIR],
|
||||||
[install scripts [[@<:@libexecdir@:>@/zfs]]]),
|
[install scripts [[@<:@libexecdir@:>@/zfs]]]),
|
||||||
[zfsexecdir=$withval],
|
[zfsexecdir=$withval],
|
||||||
[zfsexecdir="${libexecdir}/zfs"])
|
[zfsexecdir="${libexecdir}/zfs"])
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ dnl # glibc 2.25
|
|||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_USER_MAKEDEV_IN_SYSMACROS], [
|
AC_DEFUN([ZFS_AC_CONFIG_USER_MAKEDEV_IN_SYSMACROS], [
|
||||||
AC_MSG_CHECKING([makedev() is declared in sys/sysmacros.h])
|
AC_MSG_CHECKING([makedev() is declared in sys/sysmacros.h])
|
||||||
AC_TRY_COMPILE(
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||||
[
|
|
||||||
#include <sys/sysmacros.h>
|
#include <sys/sysmacros.h>
|
||||||
],[
|
]], [[
|
||||||
int k;
|
int k;
|
||||||
k = makedev(0,0);
|
k = makedev(0,0);
|
||||||
],[
|
]])],[
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_MAKEDEV_IN_SYSMACROS, 1,
|
AC_DEFINE(HAVE_MAKEDEV_IN_SYSMACROS, 1,
|
||||||
[makedev() is declared in sys/sysmacros.h])
|
[makedev() is declared in sys/sysmacros.h])
|
||||||
@@ -23,13 +22,12 @@ dnl # glibc X < Y < 2.25
|
|||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_USER_MAKEDEV_IN_MKDEV], [
|
AC_DEFUN([ZFS_AC_CONFIG_USER_MAKEDEV_IN_MKDEV], [
|
||||||
AC_MSG_CHECKING([makedev() is declared in sys/mkdev.h])
|
AC_MSG_CHECKING([makedev() is declared in sys/mkdev.h])
|
||||||
AC_TRY_COMPILE(
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||||
[
|
|
||||||
#include <sys/mkdev.h>
|
#include <sys/mkdev.h>
|
||||||
],[
|
]], [[
|
||||||
int k;
|
int k;
|
||||||
k = makedev(0,0);
|
k = makedev(0,0);
|
||||||
],[
|
]])],[
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_MAKEDEV_IN_MKDEV, 1,
|
AC_DEFINE(HAVE_MAKEDEV_IN_MKDEV, 1,
|
||||||
[makedev() is declared in sys/mkdev.h])
|
[makedev() is declared in sys/mkdev.h])
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
AC_DEFUN([ZFS_AC_CONFIG_USER_SYSTEMD], [
|
AC_DEFUN([ZFS_AC_CONFIG_USER_SYSTEMD], [
|
||||||
AC_ARG_ENABLE(systemd,
|
AC_ARG_ENABLE(systemd,
|
||||||
AC_HELP_STRING([--enable-systemd],
|
AS_HELP_STRING([--enable-systemd],
|
||||||
[install systemd unit/preset files [[default: yes]]]),
|
[install systemd unit/preset files [[default: yes]]]),
|
||||||
[enable_systemd=$enableval],
|
[enable_systemd=$enableval],
|
||||||
[enable_systemd=check])
|
[enable_systemd=check])
|
||||||
|
|
||||||
AC_ARG_WITH(systemdunitdir,
|
AC_ARG_WITH(systemdunitdir,
|
||||||
AC_HELP_STRING([--with-systemdunitdir=DIR],
|
AS_HELP_STRING([--with-systemdunitdir=DIR],
|
||||||
[install systemd unit files in dir [[/usr/lib/systemd/system]]]),
|
[install systemd unit files in dir [[/usr/lib/systemd/system]]]),
|
||||||
systemdunitdir=$withval,systemdunitdir=/usr/lib/systemd/system)
|
systemdunitdir=$withval,systemdunitdir=/usr/lib/systemd/system)
|
||||||
|
|
||||||
AC_ARG_WITH(systemdpresetdir,
|
AC_ARG_WITH(systemdpresetdir,
|
||||||
AC_HELP_STRING([--with-systemdpresetdir=DIR],
|
AS_HELP_STRING([--with-systemdpresetdir=DIR],
|
||||||
[install systemd preset files in dir [[/usr/lib/systemd/system-preset]]]),
|
[install systemd preset files in dir [[/usr/lib/systemd/system-preset]]]),
|
||||||
systemdpresetdir=$withval,systemdpresetdir=/usr/lib/systemd/system-preset)
|
systemdpresetdir=$withval,systemdpresetdir=/usr/lib/systemd/system-preset)
|
||||||
|
|
||||||
AC_ARG_WITH(systemdmodulesloaddir,
|
AC_ARG_WITH(systemdmodulesloaddir,
|
||||||
AC_HELP_STRING([--with-systemdmodulesloaddir=DIR],
|
AS_HELP_STRING([--with-systemdmodulesloaddir=DIR],
|
||||||
[install systemd module load files into dir [[/usr/lib/modules-load.d]]]),
|
[install systemd module load files into dir [[/usr/lib/modules-load.d]]]),
|
||||||
systemdmodulesloaddir=$withval,systemdmodulesloaddir=/usr/lib/modules-load.d)
|
systemdmodulesloaddir=$withval,systemdmodulesloaddir=/usr/lib/modules-load.d)
|
||||||
|
|
||||||
AC_ARG_WITH(systemdgeneratordir,
|
AC_ARG_WITH(systemdgeneratordir,
|
||||||
AC_HELP_STRING([--with-systemdgeneratordir=DIR],
|
AS_HELP_STRING([--with-systemdgeneratordir=DIR],
|
||||||
[install systemd generators in dir [[/usr/lib/systemd/system-generators]]]),
|
[install systemd generators in dir [[/usr/lib/systemd/system-generators]]]),
|
||||||
systemdgeneratordir=$withval,systemdgeneratordir=/usr/lib/systemd/system-generators)
|
systemdgeneratordir=$withval,systemdgeneratordir=/usr/lib/systemd/system-generators)
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
AC_DEFUN([ZFS_AC_CONFIG_USER_SYSVINIT], [
|
AC_DEFUN([ZFS_AC_CONFIG_USER_SYSVINIT], [
|
||||||
AC_ARG_ENABLE(sysvinit,
|
AC_ARG_ENABLE(sysvinit,
|
||||||
AC_HELP_STRING([--enable-sysvinit],
|
AS_HELP_STRING([--enable-sysvinit],
|
||||||
[install SysV init scripts [default: yes]]),
|
[install SysV init scripts [default: yes]]),
|
||||||
[],enable_sysvinit=yes)
|
[],enable_sysvinit=yes)
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
AC_DEFUN([ZFS_AC_CONFIG_USER_UDEV], [
|
AC_DEFUN([ZFS_AC_CONFIG_USER_UDEV], [
|
||||||
AC_MSG_CHECKING(for udev directories)
|
AC_MSG_CHECKING(for udev directories)
|
||||||
AC_ARG_WITH(udevdir,
|
AC_ARG_WITH(udevdir,
|
||||||
AC_HELP_STRING([--with-udevdir=DIR],
|
AS_HELP_STRING([--with-udevdir=DIR],
|
||||||
[install udev helpers @<:@default=check@:>@]),
|
[install udev helpers @<:@default=check@:>@]),
|
||||||
[udevdir=$withval],
|
[udevdir=$withval],
|
||||||
[udevdir=check])
|
[udevdir=check])
|
||||||
@@ -18,7 +18,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_UDEV], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
AC_ARG_WITH(udevruledir,
|
AC_ARG_WITH(udevruledir,
|
||||||
AC_HELP_STRING([--with-udevruledir=DIR],
|
AS_HELP_STRING([--with-udevruledir=DIR],
|
||||||
[install udev rules [[UDEVDIR/rules.d]]]),
|
[install udev rules [[UDEVDIR/rules.d]]]),
|
||||||
[udevruledir=$withval],
|
[udevruledir=$withval],
|
||||||
[udevruledir="${udevdir}/rules.d"])
|
[udevruledir="${udevdir}/rules.d"])
|
||||||
|
|||||||
+7
-5
@@ -153,6 +153,9 @@ AC_DEFUN([ZFS_AC_DEBUG_KMEM_TRACKING], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
|
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
|
||||||
|
AX_COUNT_CPUS([])
|
||||||
|
AC_SUBST(CPU_COUNT)
|
||||||
|
|
||||||
ZFS_AC_CONFIG_ALWAYS_CC_NO_UNUSED_BUT_SET_VARIABLE
|
ZFS_AC_CONFIG_ALWAYS_CC_NO_UNUSED_BUT_SET_VARIABLE
|
||||||
ZFS_AC_CONFIG_ALWAYS_CC_NO_BOOL_COMPARE
|
ZFS_AC_CONFIG_ALWAYS_CC_NO_BOOL_COMPARE
|
||||||
ZFS_AC_CONFIG_ALWAYS_CC_FRAME_LARGER_THAN
|
ZFS_AC_CONFIG_ALWAYS_CC_FRAME_LARGER_THAN
|
||||||
@@ -167,6 +170,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
|
|||||||
ZFS_AC_CONFIG_ALWAYS_PYTHON
|
ZFS_AC_CONFIG_ALWAYS_PYTHON
|
||||||
ZFS_AC_CONFIG_ALWAYS_PYZFS
|
ZFS_AC_CONFIG_ALWAYS_PYZFS
|
||||||
ZFS_AC_CONFIG_ALWAYS_SED
|
ZFS_AC_CONFIG_ALWAYS_SED
|
||||||
|
ZFS_AC_CONFIG_ALWAYS_CPPCHECK
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_CONFIG], [
|
AC_DEFUN([ZFS_AC_CONFIG], [
|
||||||
@@ -180,7 +184,7 @@ AC_DEFUN([ZFS_AC_CONFIG], [
|
|||||||
[Config file 'kernel|user|all|srpm']),
|
[Config file 'kernel|user|all|srpm']),
|
||||||
[ZFS_CONFIG="$withval"])
|
[ZFS_CONFIG="$withval"])
|
||||||
AC_ARG_ENABLE([linux-builtin],
|
AC_ARG_ENABLE([linux-builtin],
|
||||||
[AC_HELP_STRING([--enable-linux-builtin],
|
[AS_HELP_STRING([--enable-linux-builtin],
|
||||||
[Configure for builtin in-tree kernel modules @<:@default=no@:>@])],
|
[Configure for builtin in-tree kernel modules @<:@default=no@:>@])],
|
||||||
[],
|
[],
|
||||||
[enable_linux_builtin=no])
|
[enable_linux_builtin=no])
|
||||||
@@ -191,12 +195,10 @@ AC_DEFUN([ZFS_AC_CONFIG], [
|
|||||||
|
|
||||||
ZFS_AC_CONFIG_ALWAYS
|
ZFS_AC_CONFIG_ALWAYS
|
||||||
|
|
||||||
|
|
||||||
AM_COND_IF([BUILD_LINUX], [
|
AM_COND_IF([BUILD_LINUX], [
|
||||||
AC_ARG_VAR([TEST_JOBS],
|
AC_ARG_VAR([TEST_JOBS], [simultaneous jobs during configure])
|
||||||
[simultaneous jobs during configure (defaults to $(nproc))])
|
|
||||||
if test "x$ac_cv_env_TEST_JOBS_set" != "xset"; then
|
if test "x$ac_cv_env_TEST_JOBS_set" != "xset"; then
|
||||||
TEST_JOBS=$(nproc)
|
TEST_JOBS=$CPU_COUNT
|
||||||
fi
|
fi
|
||||||
AC_SUBST(TEST_JOBS)
|
AC_SUBST(TEST_JOBS)
|
||||||
])
|
])
|
||||||
|
|||||||
+4
-2
@@ -36,7 +36,7 @@ AC_LANG(C)
|
|||||||
ZFS_AC_META
|
ZFS_AC_META
|
||||||
AC_CONFIG_AUX_DIR([config])
|
AC_CONFIG_AUX_DIR([config])
|
||||||
AC_CONFIG_MACRO_DIR([config])
|
AC_CONFIG_MACRO_DIR([config])
|
||||||
AC_CANONICAL_SYSTEM
|
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])
|
||||||
@@ -45,9 +45,9 @@ AC_CONFIG_HEADERS([zfs_config.h], [
|
|||||||
awk -f ${ac_srcdir}/config/config.awk zfs_config.h.tmp >zfs_config.h &&
|
awk -f ${ac_srcdir}/config/config.awk zfs_config.h.tmp >zfs_config.h &&
|
||||||
rm zfs_config.h.tmp) || exit 1])
|
rm zfs_config.h.tmp) || exit 1])
|
||||||
|
|
||||||
|
LT_INIT
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_LIBTOOL
|
|
||||||
PKG_PROG_PKG_CONFIG
|
PKG_PROG_PKG_CONFIG
|
||||||
AM_PROG_AS
|
AM_PROG_AS
|
||||||
AM_PROG_CC_C_O
|
AM_PROG_CC_C_O
|
||||||
@@ -228,6 +228,7 @@ AC_CONFIG_FILES([
|
|||||||
tests/zfs-tests/cmd/readmmap/Makefile
|
tests/zfs-tests/cmd/readmmap/Makefile
|
||||||
tests/zfs-tests/cmd/rename_dir/Makefile
|
tests/zfs-tests/cmd/rename_dir/Makefile
|
||||||
tests/zfs-tests/cmd/rm_lnkcnt_zero_file/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/stride_dd/Makefile
|
||||||
tests/zfs-tests/cmd/threadsappend/Makefile
|
tests/zfs-tests/cmd/threadsappend/Makefile
|
||||||
tests/zfs-tests/cmd/user_ns_exec/Makefile
|
tests/zfs-tests/cmd/user_ns_exec/Makefile
|
||||||
@@ -236,6 +237,7 @@ AC_CONFIG_FILES([
|
|||||||
tests/zfs-tests/tests/Makefile
|
tests/zfs-tests/tests/Makefile
|
||||||
tests/zfs-tests/tests/functional/Makefile
|
tests/zfs-tests/tests/functional/Makefile
|
||||||
tests/zfs-tests/tests/functional/acl/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/Makefile
|
||||||
tests/zfs-tests/tests/functional/acl/posix-sa/Makefile
|
tests/zfs-tests/tests/functional/acl/posix-sa/Makefile
|
||||||
tests/zfs-tests/tests/functional/alloc_class/Makefile
|
tests/zfs-tests/tests/functional/alloc_class/Makefile
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ check() {
|
|||||||
[ "${1}" = "-d" ] && return 0
|
[ "${1}" = "-d" ] && return 0
|
||||||
|
|
||||||
# Verify the zfs tool chain
|
# Verify the zfs tool chain
|
||||||
for tool in "@bindir@/zgenhostid" "@sbindir@/zpool" "@sbindir@/zfs" "@mounthelperdir@/mount.zfs" ; do
|
for tool in "@sbindir@/zgenhostid" "@sbindir@/zpool" "@sbindir@/zfs" "@mounthelperdir@/mount.zfs" ; do
|
||||||
test -x "$tool" || return 1
|
test -x "$tool" || return 1
|
||||||
done
|
done
|
||||||
# Verify grep exists
|
# Verify grep exists
|
||||||
@@ -38,7 +38,7 @@ install() {
|
|||||||
inst_rules @udevruledir@/60-zvol.rules
|
inst_rules @udevruledir@/60-zvol.rules
|
||||||
dracut_install hostid
|
dracut_install hostid
|
||||||
dracut_install grep
|
dracut_install grep
|
||||||
dracut_install @bindir@/zgenhostid
|
dracut_install @sbindir@/zgenhostid
|
||||||
dracut_install @sbindir@/zfs
|
dracut_install @sbindir@/zfs
|
||||||
dracut_install @sbindir@/zpool
|
dracut_install @sbindir@/zpool
|
||||||
# Workaround for https://github.com/openzfs/zfs/issues/4749 by
|
# Workaround for https://github.com/openzfs/zfs/issues/4749 by
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Before=zfs-import.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/bin/sh -c "/bin/systemctl set-environment BOOTFS=$(@sbindir@/zpool list -H -o bootfs | grep -m1 -v '^-$')"
|
ExecStart=/bin/sh -c "systemctl set-environment BOOTFS=$(@sbindir@/zpool list -H -o bootfs | grep -m1 -v '^-$')"
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=zfs-import.target
|
WantedBy=zfs-import.target
|
||||||
|
|||||||
@@ -59,4 +59,12 @@ echo "zfs-generator: writing extension for sysroot.mount to $GENERATOR_DIR"/sysr
|
|||||||
[ -d "$GENERATOR_DIR"/initrd-root-fs.target.requires ] || mkdir -p "$GENERATOR_DIR"/initrd-root-fs.target.requires
|
[ -d "$GENERATOR_DIR"/initrd-root-fs.target.requires ] || mkdir -p "$GENERATOR_DIR"/initrd-root-fs.target.requires
|
||||||
ln -s ../sysroot.mount "$GENERATOR_DIR"/initrd-root-fs.target.requires/sysroot.mount
|
ln -s ../sysroot.mount "$GENERATOR_DIR"/initrd-root-fs.target.requires/sysroot.mount
|
||||||
|
|
||||||
|
|
||||||
|
[ -d "$GENERATOR_DIR"/dracut-pre-mount.service.d ] || mkdir "$GENERATOR_DIR"/dracut-pre-mount.service.d
|
||||||
|
|
||||||
|
{
|
||||||
|
echo "[Unit]"
|
||||||
|
echo "After=zfs-import.target"
|
||||||
|
} > "$GENERATOR_DIR"/dracut-pre-mount.service.d/zfs-enhancement.conf
|
||||||
|
|
||||||
echo "zfs-generator: finished" >> /dev/kmsg
|
echo "zfs-generator: finished" >> /dev/kmsg
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# only run this on systemd systems, we handle the decrypt in mount-zfs.sh in the mount hook otherwise
|
# only run this on systemd systems, we handle the decrypt in mount-zfs.sh in the mount hook otherwise
|
||||||
[ -e /bin/systemctl ] || return 0
|
[ -e /bin/systemctl ] || [ -e /usr/bin/systemctl ] || return 0
|
||||||
|
|
||||||
# This script only gets executed on systemd systems, see mount-zfs.sh for non-systemd systems
|
# This script only gets executed on systemd systems, see mount-zfs.sh for non-systemd systems
|
||||||
|
|
||||||
|
|||||||
@@ -154,8 +154,8 @@ def os_open(name, mode):
|
|||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def dev_null():
|
def dev_null():
|
||||||
with os_open('/dev/null', os.O_WRONLY) as fd:
|
with tempfile.TemporaryFile(suffix='.zstream') as fd:
|
||||||
yield fd
|
yield fd.fileno()
|
||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
preprocessorErrorDirective:./module/zfs/vdev_raidz_math_avx512f.c:243
|
|
||||||
preprocessorErrorDirective:./module/zfs/vdev_raidz_math_sse2.c:266
|
|
||||||
uninitvar:module/os/freebsd/zfs/vdev_geom.c
|
|
||||||
uninitvar:module/os/freebsd/zfs/zfs_vfsops.c
|
|
||||||
uninitvar:module/os/freebsd/spl/spl_zone.c
|
|
||||||
uninitvar:lib/libzutil/os/freebsd/zutil_import_os.c
|
|
||||||
*:module/zstd/lib/zstd.c
|
|
||||||
*:module/zstd/lib/zstd.h
|
|
||||||
@@ -8,7 +8,7 @@ After=cryptsetup.target
|
|||||||
After=multipathd.target
|
After=multipathd.target
|
||||||
After=systemd-remount-fs.service
|
After=systemd-remount-fs.service
|
||||||
Before=zfs-import.target
|
Before=zfs-import.target
|
||||||
ConditionPathExists=@sysconfdir@/zfs/zpool.cache
|
ConditionFileNotEmpty=@sysconfdir@/zfs/zpool.cache
|
||||||
ConditionPathIsDirectory=/sys/module/zfs
|
ConditionPathIsDirectory=/sys/module/zfs
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ After=systemd-udev-settle.service
|
|||||||
After=cryptsetup.target
|
After=cryptsetup.target
|
||||||
After=multipathd.target
|
After=multipathd.target
|
||||||
Before=zfs-import.target
|
Before=zfs-import.target
|
||||||
ConditionPathExists=!@sysconfdir@/zfs/zpool.cache
|
ConditionFileNotEmpty=!@sysconfdir@/zfs/zpool.cache
|
||||||
ConditionPathIsDirectory=/sys/module/zfs
|
ConditionPathIsDirectory=/sys/module/zfs
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ KERNEL_H = \
|
|||||||
atomic.h \
|
atomic.h \
|
||||||
byteorder.h \
|
byteorder.h \
|
||||||
callb.h \
|
callb.h \
|
||||||
|
ccompat.h \
|
||||||
ccompile.h \
|
ccompile.h \
|
||||||
cmn_err.h \
|
cmn_err.h \
|
||||||
condvar.h \
|
condvar.h \
|
||||||
@@ -15,11 +16,14 @@ KERNEL_H = \
|
|||||||
disp.h \
|
disp.h \
|
||||||
dkio.h \
|
dkio.h \
|
||||||
extdirent.h \
|
extdirent.h \
|
||||||
|
fcntl.h \
|
||||||
file.h \
|
file.h \
|
||||||
freebsd_rwlock.h \
|
freebsd_rwlock.h \
|
||||||
|
idmap.h \
|
||||||
inttypes.h \
|
inttypes.h \
|
||||||
isa_defs.h \
|
isa_defs.h \
|
||||||
kmem_cache.h \
|
kmem_cache.h \
|
||||||
|
kidmap.h \
|
||||||
kmem.h \
|
kmem.h \
|
||||||
kstat.h \
|
kstat.h \
|
||||||
list_impl.h \
|
list_impl.h \
|
||||||
|
|||||||
@@ -166,10 +166,6 @@ extern "C" {
|
|||||||
#define ECHRNG ENXIO
|
#define ECHRNG ENXIO
|
||||||
#define ETIME ETIMEDOUT
|
#define ETIME ETIMEDOUT
|
||||||
|
|
||||||
#define O_LARGEFILE 0
|
|
||||||
#define O_RSYNC 0
|
|
||||||
#define O_DSYNC 0
|
|
||||||
|
|
||||||
#ifndef LOCORE
|
#ifndef LOCORE
|
||||||
#ifndef HAVE_RPC_TYPES
|
#ifndef HAVE_RPC_TYPES
|
||||||
typedef int bool_t;
|
typedef int bool_t;
|
||||||
|
|||||||
@@ -68,65 +68,65 @@ void spl_dumpstack(void);
|
|||||||
#define PANIC(fmt, a...) \
|
#define PANIC(fmt, a...) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, fmt, ## a)
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, fmt, ## a)
|
||||||
|
|
||||||
#define VERIFY(cond) \
|
#define VERIFY(cond) \
|
||||||
(void) (unlikely(!(cond)) && \
|
(void) (unlikely(!(cond)) && \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"%s", "VERIFY(" #cond ") failed\n"))
|
"%s", "VERIFY(" #cond ") failed\n"))
|
||||||
|
|
||||||
#define VERIFY3B(LEFT, OP, RIGHT) do { \
|
#define VERIFY3B(LEFT, OP, RIGHT) do { \
|
||||||
boolean_t _verify3_left = (boolean_t)(LEFT); \
|
const boolean_t _verify3_left = (boolean_t)(LEFT); \
|
||||||
boolean_t _verify3_right = (boolean_t)(RIGHT); \
|
const boolean_t _verify3_right = (boolean_t)(RIGHT);\
|
||||||
if (!(_verify3_left OP _verify3_right)) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
||||||
"failed (%d " #OP " %d)\n", \
|
"failed (%d " #OP " %d)\n", \
|
||||||
(boolean_t) (_verify3_left), \
|
(boolean_t) (_verify3_left), \
|
||||||
(boolean_t) (_verify3_right)); \
|
(boolean_t) (_verify3_right)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY3S(LEFT, OP, RIGHT) do { \
|
#define VERIFY3S(LEFT, OP, RIGHT) do { \
|
||||||
int64_t _verify3_left = (int64_t)(LEFT); \
|
const int64_t _verify3_left = (int64_t)(LEFT); \
|
||||||
int64_t _verify3_right = (int64_t)(RIGHT); \
|
const int64_t _verify3_right = (int64_t)(RIGHT); \
|
||||||
if (!(_verify3_left OP _verify3_right)) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
||||||
"failed (%lld " #OP " %lld)\n", \
|
"failed (%lld " #OP " %lld)\n", \
|
||||||
(long long) (_verify3_left), \
|
(long long) (_verify3_left), \
|
||||||
(long long) (_verify3_right)); \
|
(long long) (_verify3_right)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY3U(LEFT, OP, RIGHT) do { \
|
#define VERIFY3U(LEFT, OP, RIGHT) do { \
|
||||||
uint64_t _verify3_left = (uint64_t)(LEFT); \
|
const uint64_t _verify3_left = (uint64_t)(LEFT); \
|
||||||
uint64_t _verify3_right = (uint64_t)(RIGHT); \
|
const uint64_t _verify3_right = (uint64_t)(RIGHT); \
|
||||||
if (!(_verify3_left OP _verify3_right)) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
||||||
"failed (%llu " #OP " %llu)\n", \
|
"failed (%llu " #OP " %llu)\n", \
|
||||||
(unsigned long long) (_verify3_left), \
|
(unsigned long long) (_verify3_left), \
|
||||||
(unsigned long long) (_verify3_right)); \
|
(unsigned long long) (_verify3_right)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY3P(LEFT, OP, RIGHT) do { \
|
#define VERIFY3P(LEFT, OP, RIGHT) do { \
|
||||||
uintptr_t _verify3_left = (uintptr_t)(LEFT); \
|
const uintptr_t _verify3_left = (uintptr_t)(LEFT); \
|
||||||
uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
|
const uintptr_t _verify3_right = (uintptr_t)(RIGHT);\
|
||||||
if (!(_verify3_left OP _verify3_right)) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
||||||
"failed (%px " #OP " %px)\n", \
|
"failed (%px " #OP " %px)\n", \
|
||||||
(void *) (_verify3_left), \
|
(void *) (_verify3_left), \
|
||||||
(void *) (_verify3_right)); \
|
(void *) (_verify3_right)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY0(RIGHT) do { \
|
#define VERIFY0(RIGHT) do { \
|
||||||
int64_t _verify3_left = (int64_t)(0); \
|
const int64_t _verify3_left = (int64_t)(0); \
|
||||||
int64_t _verify3_right = (int64_t)(RIGHT); \
|
const int64_t _verify3_right = (int64_t)(RIGHT); \
|
||||||
if (!(_verify3_left == _verify3_right)) \
|
if (unlikely(!(_verify3_left == _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(0 == " #RIGHT ") " \
|
"VERIFY3(0 == " #RIGHT ") " \
|
||||||
"failed (0 == %lld)\n", \
|
"failed (0 == %lld)\n", \
|
||||||
(long long) (_verify3_right)); \
|
(long long) (_verify3_right)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define CTASSERT_GLOBAL(x) CTASSERT(x)
|
#define CTASSERT_GLOBAL(x) CTASSERT(x)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Debugging disabled (--disable-debug)
|
* Debugging disabled (--disable-debug)
|
||||||
@@ -154,11 +154,11 @@ void spl_dumpstack(void);
|
|||||||
#define ASSERT0 VERIFY0
|
#define ASSERT0 VERIFY0
|
||||||
#define ASSERT VERIFY
|
#define ASSERT VERIFY
|
||||||
#define IMPLY(A, B) \
|
#define IMPLY(A, B) \
|
||||||
((void)(((!(A)) || (B)) || \
|
((void)(likely((!(A)) || (B)) || \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"(" #A ") implies (" #B ")")))
|
"(" #A ") implies (" #B ")")))
|
||||||
#define EQUIV(A, B) \
|
#define EQUIV(A, B) \
|
||||||
((void)((!!(A) == !!(B)) || \
|
((void)(likely(!!(A) == !!(B)) || \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"(" #A ") is equivalent to (" #B ")")))
|
"(" #A ") is equivalent to (" #B ")")))
|
||||||
/* END CSTYLED */
|
/* END CSTYLED */
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021 iXsystems, Inc.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||||
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
* SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _SPL_SYS_FCNTL_H_
|
||||||
|
#define _SPL_SYS_FCNTL_H_
|
||||||
|
|
||||||
|
#include_next <sys/fcntl.h>
|
||||||
|
|
||||||
|
#define O_LARGEFILE 0
|
||||||
|
#define O_RSYNC 0
|
||||||
|
|
||||||
|
#ifndef O_DSYNC
|
||||||
|
#define O_DSYNC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _SPL_SYS_FCNTL_H_ */
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
#define _OPENSOLARIS_SYS_MISC_H_
|
#define _OPENSOLARIS_SYS_MISC_H_
|
||||||
|
|
||||||
#include <sys/limits.h>
|
#include <sys/limits.h>
|
||||||
|
#include <sys/filio.h>
|
||||||
|
|
||||||
#define MAXUID UID_MAX
|
#define MAXUID UID_MAX
|
||||||
|
|
||||||
@@ -40,8 +41,8 @@
|
|||||||
#define _FIOGDIO (INT_MIN+1)
|
#define _FIOGDIO (INT_MIN+1)
|
||||||
#define _FIOSDIO (INT_MIN+2)
|
#define _FIOSDIO (INT_MIN+2)
|
||||||
|
|
||||||
#define _FIO_SEEK_DATA FIOSEEKDATA
|
#define F_SEEK_DATA FIOSEEKDATA
|
||||||
#define _FIO_SEEK_HOLE FIOSEEKHOLE
|
#define F_SEEK_HOLE FIOSEEKHOLE
|
||||||
|
|
||||||
struct opensolaris_utsname {
|
struct opensolaris_utsname {
|
||||||
char *sysname;
|
char *sysname;
|
||||||
@@ -53,4 +54,7 @@ struct opensolaris_utsname {
|
|||||||
|
|
||||||
extern char hw_serial[11];
|
extern char hw_serial[11];
|
||||||
|
|
||||||
|
#define task_io_account_read(n)
|
||||||
|
#define task_io_account_write(n)
|
||||||
|
|
||||||
#endif /* _OPENSOLARIS_SYS_MISC_H_ */
|
#endif /* _OPENSOLARIS_SYS_MISC_H_ */
|
||||||
|
|||||||
@@ -57,6 +57,8 @@
|
|||||||
#define ZFS_MODULE_PARAM_CALL(scope_prefix, name_prefix, name, func, _, perm, desc) \
|
#define ZFS_MODULE_PARAM_CALL(scope_prefix, name_prefix, name, func, _, perm, desc) \
|
||||||
ZFS_MODULE_PARAM_CALL_IMPL(_vfs_ ## scope_prefix, name, perm, func ## _args(name_prefix ## name), desc)
|
ZFS_MODULE_PARAM_CALL_IMPL(_vfs_ ## scope_prefix, name, perm, func ## _args(name_prefix ## name), desc)
|
||||||
|
|
||||||
|
#define ZFS_MODULE_VIRTUAL_PARAM_CALL ZFS_MODULE_PARAM_CALL
|
||||||
|
|
||||||
#define param_set_arc_long_args(var) \
|
#define param_set_arc_long_args(var) \
|
||||||
CTLTYPE_ULONG, &var, 0, param_set_arc_long, "LU"
|
CTLTYPE_ULONG, &var, 0, param_set_arc_long, "LU"
|
||||||
|
|
||||||
@@ -84,6 +86,9 @@
|
|||||||
#define param_set_max_auto_ashift_args(var) \
|
#define param_set_max_auto_ashift_args(var) \
|
||||||
CTLTYPE_U64, &var, 0, param_set_max_auto_ashift, "QU"
|
CTLTYPE_U64, &var, 0, param_set_max_auto_ashift, "QU"
|
||||||
|
|
||||||
|
#define fletcher_4_param_set_args(var) \
|
||||||
|
CTLTYPE_STRING, NULL, 0, fletcher_4_param, "A"
|
||||||
|
|
||||||
#include <sys/kernel.h>
|
#include <sys/kernel.h>
|
||||||
#define module_init(fn) \
|
#define module_init(fn) \
|
||||||
static void \
|
static void \
|
||||||
@@ -93,6 +98,13 @@ wrap_ ## fn(void *dummy __unused) \
|
|||||||
} \
|
} \
|
||||||
SYSINIT(zfs_ ## fn, SI_SUB_LAST, SI_ORDER_FIRST, wrap_ ## fn, NULL)
|
SYSINIT(zfs_ ## fn, SI_SUB_LAST, SI_ORDER_FIRST, wrap_ ## fn, NULL)
|
||||||
|
|
||||||
|
#define module_init_early(fn) \
|
||||||
|
static void \
|
||||||
|
wrap_ ## fn(void *dummy __unused) \
|
||||||
|
{ \
|
||||||
|
fn(); \
|
||||||
|
} \
|
||||||
|
SYSINIT(zfs_ ## fn, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_FIRST, wrap_ ## fn, NULL)
|
||||||
|
|
||||||
#define module_exit(fn) \
|
#define module_exit(fn) \
|
||||||
static void \
|
static void \
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
#include <sys/vnode.h>
|
#include <sys/vnode.h>
|
||||||
struct mount;
|
struct mount;
|
||||||
struct vattr;
|
struct vattr;
|
||||||
|
struct znode;
|
||||||
|
|
||||||
int secpolicy_nfs(cred_t *cr);
|
int secpolicy_nfs(cred_t *cr);
|
||||||
int secpolicy_zfs(cred_t *crd);
|
int secpolicy_zfs(cred_t *crd);
|
||||||
@@ -57,7 +58,7 @@ int secpolicy_vnode_setattr(cred_t *cr, vnode_t *vp, struct vattr *vap,
|
|||||||
int unlocked_access(void *, int, cred_t *), void *node);
|
int unlocked_access(void *, int, cred_t *), void *node);
|
||||||
int secpolicy_vnode_create_gid(cred_t *cr);
|
int secpolicy_vnode_create_gid(cred_t *cr);
|
||||||
int secpolicy_vnode_setids_setgids(vnode_t *vp, cred_t *cr, gid_t gid);
|
int secpolicy_vnode_setids_setgids(vnode_t *vp, cred_t *cr, gid_t gid);
|
||||||
int secpolicy_vnode_setid_retain(vnode_t *vp, cred_t *cr,
|
int secpolicy_vnode_setid_retain(struct znode *zp, cred_t *cr,
|
||||||
boolean_t issuidroot);
|
boolean_t issuidroot);
|
||||||
void secpolicy_setid_clear(struct vattr *vap, vnode_t *vp, cred_t *cr);
|
void secpolicy_setid_clear(struct vattr *vap, vnode_t *vp, cred_t *cr);
|
||||||
int secpolicy_setid_setsticky_clear(vnode_t *vp, struct vattr *vap,
|
int secpolicy_setid_setsticky_clear(vnode_t *vp, struct vattr *vap,
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ typedef u_int uint_t;
|
|||||||
typedef u_char uchar_t;
|
typedef u_char uchar_t;
|
||||||
typedef u_short ushort_t;
|
typedef u_short ushort_t;
|
||||||
typedef u_long ulong_t;
|
typedef u_long ulong_t;
|
||||||
typedef u_int minor_t;
|
typedef int minor_t;
|
||||||
/* END CSTYLED */
|
/* END CSTYLED */
|
||||||
#ifndef _OFF64_T_DECLARED
|
#ifndef _OFF64_T_DECLARED
|
||||||
#define _OFF64_T_DECLARED
|
#define _OFF64_T_DECLARED
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ void uioskip(uio_t *uiop, size_t n);
|
|||||||
#define uio_iovcnt(uio) (uio)->uio_iovcnt
|
#define uio_iovcnt(uio) (uio)->uio_iovcnt
|
||||||
#define uio_iovlen(uio, idx) (uio)->uio_iov[(idx)].iov_len
|
#define uio_iovlen(uio, idx) (uio)->uio_iov[(idx)].iov_len
|
||||||
#define uio_iovbase(uio, idx) (uio)->uio_iov[(idx)].iov_base
|
#define uio_iovbase(uio, idx) (uio)->uio_iov[(idx)].iov_base
|
||||||
|
#define uio_fault_disable(uio, set)
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
uio_iov_at_index(uio_t *uio, uint_t idx, void **base, uint64_t *len)
|
uio_iov_at_index(uio_t *uio, uint_t idx, void **base, uint64_t *len)
|
||||||
|
|||||||
@@ -127,7 +127,9 @@ vn_is_readonly(vnode_t *vp)
|
|||||||
#define FCREAT O_CREAT
|
#define FCREAT O_CREAT
|
||||||
#define FTRUNC O_TRUNC
|
#define FTRUNC O_TRUNC
|
||||||
#define FEXCL O_EXCL
|
#define FEXCL O_EXCL
|
||||||
|
#ifndef FDSYNC
|
||||||
#define FDSYNC FFSYNC
|
#define FDSYNC FFSYNC
|
||||||
|
#endif
|
||||||
#define FRSYNC FFSYNC
|
#define FRSYNC FFSYNC
|
||||||
#define FSYNC FFSYNC
|
#define FSYNC FFSYNC
|
||||||
#define FOFFMAX 0x00
|
#define FOFFMAX 0x00
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ KERNEL_H = \
|
|||||||
zfs_dir.h \
|
zfs_dir.h \
|
||||||
zfs_ioctl_compat.h \
|
zfs_ioctl_compat.h \
|
||||||
zfs_vfsops_os.h \
|
zfs_vfsops_os.h \
|
||||||
zfs_vnops.h \
|
zfs_vnops_os.h \
|
||||||
zfs_znode_impl.h \
|
zfs_znode_impl.h \
|
||||||
zpl.h
|
zpl.h
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
#define cond_resched() kern_yield(PRI_USER)
|
#define cond_resched() kern_yield(PRI_USER)
|
||||||
|
#define uio_prefaultpages(size, uio) (0)
|
||||||
|
|
||||||
#define taskq_create_sysdc(a, b, d, e, p, dc, f) \
|
#define taskq_create_sysdc(a, b, d, e, p, dc, f) \
|
||||||
(taskq_create(a, b, maxclsyspri, d, e, f))
|
(taskq_create(a, b, maxclsyspri, d, e, f))
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user