mirror of
https://github.com/openzfs/zfs.git
synced 2025-10-01 02:46:29 +00:00
Compare commits
150 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bc06d8164b | ||
![]() |
76745cf5b8 | ||
![]() |
0c88ae6187 | ||
![]() |
307fd0da1f | ||
![]() |
9f1c5e0b10 | ||
![]() |
5ba50c8135 | ||
![]() |
25565403aa | ||
![]() |
47b7dc976b | ||
![]() |
125731436d | ||
![]() |
4425a7bb85 | ||
![]() |
e47b033eae | ||
![]() |
cfec8f13a2 | ||
![]() |
997db7a7fc | ||
![]() |
e411081aa0 | ||
![]() |
a55b6fe94a | ||
![]() |
939e9f0b6a | ||
![]() |
679b164cd3 | ||
![]() |
c2d9494f99 | ||
![]() |
b952e061df | ||
![]() |
0fea7fc109 | ||
![]() |
0f6d955a35 | ||
![]() |
c3d2412b05 | ||
![]() |
74064cb175 | ||
![]() |
30b97ce218 | ||
![]() |
9519e7ebcc | ||
![]() |
f9b02fe7e3 | ||
![]() |
cb8da70329 | ||
![]() |
c944c46a98 | ||
![]() |
166a7bc602 | ||
![]() |
e90124a7c8 | ||
![]() |
18b3bea861 | ||
![]() |
d67eb17e27 | ||
![]() |
1862c1c0a8 | ||
![]() |
b57f53036d | ||
![]() |
4b8bf3c48a | ||
![]() |
696943533c | ||
![]() |
2284a61129 | ||
![]() |
e1833a72f9 | ||
![]() |
5bb034f533 | ||
![]() |
1e08e49a28 | ||
![]() |
6604fe9a06 | ||
![]() |
7cbe7bbbd4 | ||
![]() |
2dcc8fe035 | ||
![]() |
38875918d8 | ||
![]() |
0d51852ec7 | ||
![]() |
73a73cba71 | ||
![]() |
87947f2440 | ||
![]() |
0e87150b6c | ||
![]() |
7742e29387 | ||
![]() |
f54052a122 | ||
![]() |
d874f27776 | ||
![]() |
84d7d53e91 | ||
![]() |
d90042dedb | ||
![]() |
0e46085ee6 | ||
![]() |
3b0c1131ef | ||
![]() |
5988de77b0 | ||
![]() |
00debc1361 | ||
![]() |
af10714e42 | ||
![]() |
747781a345 | ||
![]() |
b17ea73f9d | ||
![]() |
17cdb7a2b1 | ||
![]() |
b673bcba4d | ||
![]() |
d8886275df | ||
![]() |
1aee375947 | ||
![]() |
a1907b038a | ||
![]() |
d359f7f547 | ||
![]() |
90603601b4 | ||
![]() |
ecd0b1528e | ||
![]() |
3ed1d608a8 | ||
![]() |
c165daa0b1 | ||
![]() |
1a5414ba2f | ||
![]() |
409aad3f33 | ||
![]() |
1917c26944 | ||
![]() |
2b64d41be8 | ||
![]() |
9753feaa63 | ||
![]() |
3c0b8da206 | ||
![]() |
d7abeef621 | ||
![]() |
7fb7eb9a63 | ||
![]() |
3f9af023f6 | ||
![]() |
f7675ae30f | ||
![]() |
920603990a | ||
![]() |
9a4b2f08d3 | ||
![]() |
8023d9d4b5 | ||
![]() |
23f063d2e6 | ||
![]() |
18474efeec | ||
![]() |
260065099e | ||
![]() |
4c9f2cec46 | ||
![]() |
ee3677d321 | ||
![]() |
0274a9a57d | ||
![]() |
025f8b2e74 | ||
![]() |
37e8f3ae17 | ||
![]() |
7313c6e382 | ||
![]() |
1c6b0302ef | ||
![]() |
7e3af4658b | ||
![]() |
1a54b13aaf | ||
![]() |
9061a4da0b | ||
![]() |
e12d76176d | ||
![]() |
8131793d6f | ||
![]() |
c82eb27b22 | ||
![]() |
661bb434e6 | ||
![]() |
ae48c2f6a9 | ||
![]() |
b96845b632 | ||
![]() |
55cbd1f9bd | ||
![]() |
880b73956b | ||
![]() |
d367ef2995 | ||
![]() |
7546fbd6e9 | ||
![]() |
903d3f9187 | ||
![]() |
86b5853cfb | ||
![]() |
19a8dd48e1 | ||
![]() |
8ac70aade7 | ||
![]() |
bbc0d34bfd | ||
![]() |
f3823a9ab2 | ||
![]() |
fd2cae969f | ||
![]() |
f7b4bca66a | ||
![]() |
7e3ce4efaa | ||
![]() |
77d81974b6 | ||
![]() |
5237760b17 | ||
![]() |
ede715d1e4 | ||
![]() |
e30c69365d | ||
![]() |
78d39d91fa | ||
![]() |
2b359c7824 | ||
![]() |
ace2e17a9b | ||
![]() |
b4cd10ce5b | ||
![]() |
f52d7aaaac | ||
![]() |
d5db840260 | ||
![]() |
bcd61d9579 | ||
![]() |
36a67b50a2 | ||
![]() |
3d9129a7b6 | ||
![]() |
0409c47fe0 | ||
![]() |
b5a3825244 | ||
![]() |
77df762a1b | ||
![]() |
56871e465a | ||
![]() |
c645b07eaa | ||
![]() |
5bc27acf51 | ||
![]() |
7f830d783b | ||
![]() |
58162960a1 | ||
![]() |
666903610d | ||
![]() |
26ecd8b993 | ||
![]() |
774dcba86d | ||
![]() |
09f6b2ebe3 | ||
![]() |
2609d93b65 | ||
![]() |
10f46d2aba | ||
![]() |
0df10dc911 | ||
![]() |
0fbe9d352c | ||
![]() |
84f44ec07f | ||
![]() |
fc9608e2e6 | ||
![]() |
d32c05949a | ||
![]() |
1ebb6b866f | ||
![]() |
f019b445f3 | ||
![]() |
03822a61be |
2
.github/workflows/codeql.yml
vendored
2
.github/workflows/codeql.yml
vendored
@ -11,7 +11,7 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
analyze:
|
analyze:
|
||||||
name: Analyze
|
name: Analyze
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
actions: read
|
actions: read
|
||||||
contents: read
|
contents: read
|
||||||
|
16
.github/workflows/scripts/qemu-1-setup.sh
vendored
16
.github/workflows/scripts/qemu-1-setup.sh
vendored
@ -18,19 +18,21 @@ ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -q -N ""
|
|||||||
|
|
||||||
# we expect RAM shortage
|
# we expect RAM shortage
|
||||||
cat << EOF | sudo tee /etc/ksmtuned.conf > /dev/null
|
cat << EOF | sudo tee /etc/ksmtuned.conf > /dev/null
|
||||||
|
# /etc/ksmtuned.conf - Configuration file for ksmtuned
|
||||||
# https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/virtualization_tuning_and_optimization_guide/chap-ksm
|
# https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/virtualization_tuning_and_optimization_guide/chap-ksm
|
||||||
KSM_MONITOR_INTERVAL=60
|
KSM_MONITOR_INTERVAL=60
|
||||||
|
|
||||||
# Millisecond sleep between ksm scans for 16Gb server.
|
# Millisecond sleep between ksm scans for 16Gb server.
|
||||||
# Smaller servers sleep more, bigger sleep less.
|
# Smaller servers sleep more, bigger sleep less.
|
||||||
KSM_SLEEP_MSEC=10
|
KSM_SLEEP_MSEC=30
|
||||||
KSM_NPAGES_BOOST=300
|
|
||||||
KSM_NPAGES_DECAY=-50
|
|
||||||
KSM_NPAGES_MIN=64
|
|
||||||
KSM_NPAGES_MAX=2048
|
|
||||||
|
|
||||||
KSM_THRES_COEF=25
|
KSM_NPAGES_BOOST=0
|
||||||
KSM_THRES_CONST=2048
|
KSM_NPAGES_DECAY=0
|
||||||
|
KSM_NPAGES_MIN=1000
|
||||||
|
KSM_NPAGES_MAX=25000
|
||||||
|
|
||||||
|
KSM_THRES_COEF=80
|
||||||
|
KSM_THRES_CONST=8192
|
||||||
|
|
||||||
LOGFILE=/var/log/ksmtuned.log
|
LOGFILE=/var/log/ksmtuned.log
|
||||||
DEBUG=1
|
DEBUG=1
|
||||||
|
57
.github/workflows/scripts/qemu-2-start.sh
vendored
57
.github/workflows/scripts/qemu-2-start.sh
vendored
@ -14,7 +14,7 @@ OSv=$OS
|
|||||||
|
|
||||||
# compressed with .zst extension
|
# compressed with .zst extension
|
||||||
REPO="https://github.com/mcmilk/openzfs-freebsd-images"
|
REPO="https://github.com/mcmilk/openzfs-freebsd-images"
|
||||||
FREEBSD="$REPO/releases/download/v2024-09-16"
|
FREEBSD="$REPO/releases/download/v2024-12-14"
|
||||||
URLzs=""
|
URLzs=""
|
||||||
|
|
||||||
# Ubuntu mirrors
|
# Ubuntu mirrors
|
||||||
@ -40,6 +40,12 @@ case "$OS" in
|
|||||||
# dns sometimes fails with that url :/
|
# dns sometimes fails with that url :/
|
||||||
echo "89.187.191.12 geo.mirror.pkgbuild.com" | sudo tee /etc/hosts > /dev/null
|
echo "89.187.191.12 geo.mirror.pkgbuild.com" | sudo tee /etc/hosts > /dev/null
|
||||||
;;
|
;;
|
||||||
|
centos-stream10)
|
||||||
|
OSNAME="CentOS Stream 10"
|
||||||
|
# TODO: #16903 Overwrite OSv to stream9 for virt-install until it's added to osinfo
|
||||||
|
OSv="centos-stream9"
|
||||||
|
URL="https://cloud.centos.org/centos/10-stream/x86_64/images/CentOS-Stream-GenericCloud-10-latest.x86_64.qcow2"
|
||||||
|
;;
|
||||||
centos-stream9)
|
centos-stream9)
|
||||||
OSNAME="CentOS Stream 9"
|
OSNAME="CentOS Stream 9"
|
||||||
URL="https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2"
|
URL="https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2"
|
||||||
@ -52,43 +58,56 @@ case "$OS" in
|
|||||||
OSNAME="Debian 12"
|
OSNAME="Debian 12"
|
||||||
URL="https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2"
|
URL="https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2"
|
||||||
;;
|
;;
|
||||||
fedora39)
|
|
||||||
OSNAME="Fedora 39"
|
|
||||||
OSv="fedora39"
|
|
||||||
URL="https://download.fedoraproject.org/pub/fedora/linux/releases/39/Cloud/x86_64/images/Fedora-Cloud-Base-39-1.5.x86_64.qcow2"
|
|
||||||
;;
|
|
||||||
fedora40)
|
fedora40)
|
||||||
OSNAME="Fedora 40"
|
OSNAME="Fedora 40"
|
||||||
OSv="fedora39"
|
OSv="fedora-unknown"
|
||||||
URL="https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2"
|
URL="https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2"
|
||||||
;;
|
;;
|
||||||
freebsd13r)
|
fedora41)
|
||||||
|
OSNAME="Fedora 41"
|
||||||
|
OSv="fedora-unknown"
|
||||||
|
URL="https://download.fedoraproject.org/pub/fedora/linux/releases/41/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2"
|
||||||
|
;;
|
||||||
|
freebsd13-3r)
|
||||||
|
OSNAME="FreeBSD 13.3-RELEASE"
|
||||||
|
OSv="freebsd13.0"
|
||||||
|
URLzs="$FREEBSD/amd64-freebsd-13.3-RELEASE.qcow2.zst"
|
||||||
|
BASH="/usr/local/bin/bash"
|
||||||
|
NIC="rtl8139"
|
||||||
|
;;
|
||||||
|
freebsd13-4r)
|
||||||
OSNAME="FreeBSD 13.4-RELEASE"
|
OSNAME="FreeBSD 13.4-RELEASE"
|
||||||
OSv="freebsd13.0"
|
OSv="freebsd13.0"
|
||||||
URLzs="$FREEBSD/amd64-freebsd-13.4-RELEASE.qcow2.zst"
|
URLzs="$FREEBSD/amd64-freebsd-13.4-RELEASE.qcow2.zst"
|
||||||
BASH="/usr/local/bin/bash"
|
BASH="/usr/local/bin/bash"
|
||||||
NIC="rtl8139"
|
NIC="rtl8139"
|
||||||
;;
|
;;
|
||||||
freebsd13)
|
freebsd14-1r)
|
||||||
|
OSNAME="FreeBSD 14.1-RELEASE"
|
||||||
|
OSv="freebsd14.0"
|
||||||
|
URLzs="$FREEBSD/amd64-freebsd-14.1-RELEASE.qcow2.zst"
|
||||||
|
BASH="/usr/local/bin/bash"
|
||||||
|
;;
|
||||||
|
freebsd14-2r)
|
||||||
|
OSNAME="FreeBSD 14.2-RELEASE"
|
||||||
|
OSv="freebsd14.0"
|
||||||
|
URLzs="$FREEBSD/amd64-freebsd-14.2-RELEASE.qcow2.zst"
|
||||||
|
BASH="/usr/local/bin/bash"
|
||||||
|
;;
|
||||||
|
freebsd13-4s)
|
||||||
OSNAME="FreeBSD 13.4-STABLE"
|
OSNAME="FreeBSD 13.4-STABLE"
|
||||||
OSv="freebsd13.0"
|
OSv="freebsd13.0"
|
||||||
URLzs="$FREEBSD/amd64-freebsd-13.4-STABLE.qcow2.zst"
|
URLzs="$FREEBSD/amd64-freebsd-13.4-STABLE.qcow2.zst"
|
||||||
BASH="/usr/local/bin/bash"
|
BASH="/usr/local/bin/bash"
|
||||||
NIC="rtl8139"
|
NIC="rtl8139"
|
||||||
;;
|
;;
|
||||||
freebsd14r)
|
freebsd14-2s)
|
||||||
OSNAME="FreeBSD 14.1-RELEASE"
|
OSNAME="FreeBSD 14.2-STABLE"
|
||||||
OSv="freebsd14.0"
|
OSv="freebsd14.0"
|
||||||
URLzs="$FREEBSD/amd64-freebsd-14.1-RELEASE.qcow2.zst"
|
URLzs="$FREEBSD/amd64-freebsd-14.2-STABLE.qcow2.zst"
|
||||||
BASH="/usr/local/bin/bash"
|
BASH="/usr/local/bin/bash"
|
||||||
;;
|
;;
|
||||||
freebsd14)
|
freebsd15-0c)
|
||||||
OSNAME="FreeBSD 14.1-STABLE"
|
|
||||||
OSv="freebsd14.0"
|
|
||||||
URLzs="$FREEBSD/amd64-freebsd-14.1-STABLE.qcow2.zst"
|
|
||||||
BASH="/usr/local/bin/bash"
|
|
||||||
;;
|
|
||||||
freebsd15)
|
|
||||||
OSNAME="FreeBSD 15.0-CURRENT"
|
OSNAME="FreeBSD 15.0-CURRENT"
|
||||||
OSv="freebsd14.0"
|
OSv="freebsd14.0"
|
||||||
URLzs="$FREEBSD/amd64-freebsd-15.0-CURRENT.qcow2.zst"
|
URLzs="$FREEBSD/amd64-freebsd-15.0-CURRENT.qcow2.zst"
|
||||||
|
46
.github/workflows/scripts/qemu-3-deps.sh
vendored
46
.github/workflows/scripts/qemu-3-deps.sh
vendored
@ -13,10 +13,10 @@ function archlinux() {
|
|||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
|
|
||||||
echo "##[group]Install Development Tools"
|
echo "##[group]Install Development Tools"
|
||||||
sudo pacman -Sy --noconfirm base-devel bc cpio dhclient dkms fakeroot \
|
sudo pacman -Sy --noconfirm base-devel bc cpio cryptsetup dhclient dkms \
|
||||||
fio gdb inetutils jq less linux linux-headers lsscsi nfs-utils parted \
|
fakeroot fio gdb inetutils jq less linux linux-headers lsscsi nfs-utils \
|
||||||
pax perf python-packaging python-setuptools qemu-guest-agent ksh samba \
|
parted pax perf python-packaging python-setuptools qemu-guest-agent ksh \
|
||||||
sysstat rng-tools rsync wget xxhash
|
samba sysstat rng-tools rsync wget xxhash
|
||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,11 +30,11 @@ function debian() {
|
|||||||
|
|
||||||
echo "##[group]Install Development Tools"
|
echo "##[group]Install Development Tools"
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
acl alien attr autoconf bc cpio curl dbench dh-python dkms fakeroot \
|
acl alien attr autoconf bc cpio cryptsetup curl dbench dh-python dkms \
|
||||||
fio gdb gdebi git ksh lcov isc-dhcp-client jq libacl1-dev libaio-dev \
|
fakeroot fio gdb gdebi git ksh lcov isc-dhcp-client jq libacl1-dev \
|
||||||
libattr1-dev libblkid-dev libcurl4-openssl-dev libdevmapper-dev libelf-dev \
|
libaio-dev libattr1-dev libblkid-dev libcurl4-openssl-dev libdevmapper-dev \
|
||||||
libffi-dev libmount-dev libpam0g-dev libselinux-dev libssl-dev libtool \
|
libelf-dev libffi-dev libmount-dev libpam0g-dev libselinux-dev libssl-dev \
|
||||||
libtool-bin libudev-dev libunwind-dev linux-headers-$(uname -r) \
|
libtool libtool-bin libudev-dev libunwind-dev linux-headers-$(uname -r) \
|
||||||
lsscsi nfs-kernel-server pamtester parted python3 python3-all-dev \
|
lsscsi nfs-kernel-server pamtester parted python3 python3-all-dev \
|
||||||
python3-cffi python3-dev python3-distlib python3-packaging \
|
python3-cffi python3-dev python3-distlib python3-packaging \
|
||||||
python3-setuptools python3-sphinx qemu-guest-agent rng-tools rpm2cpio \
|
python3-setuptools python3-sphinx qemu-guest-agent rng-tools rpm2cpio \
|
||||||
@ -66,16 +66,23 @@ function rhel() {
|
|||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
|
|
||||||
echo "##[group]Install Development Tools"
|
echo "##[group]Install Development Tools"
|
||||||
sudo dnf group install -y "Development Tools"
|
|
||||||
|
# Alma wants "Development Tools", Fedora 41 wants "development-tools"
|
||||||
|
if ! sudo dnf group install -y "Development Tools" ; then
|
||||||
|
echo "Trying 'development-tools' instead of 'Development Tools'"
|
||||||
|
sudo dnf group install -y development-tools
|
||||||
|
fi
|
||||||
|
|
||||||
sudo dnf install -y \
|
sudo dnf install -y \
|
||||||
acl attr bc bzip2 curl dbench dkms elfutils-libelf-devel fio gdb git \
|
acl attr bc bzip2 cryptsetup curl dbench dkms elfutils-libelf-devel fio \
|
||||||
jq kernel-rpm-macros ksh libacl-devel libaio-devel libargon2-devel \
|
gdb git jq kernel-rpm-macros ksh libacl-devel libaio-devel \
|
||||||
libattr-devel libblkid-devel libcurl-devel libffi-devel ncompress \
|
libargon2-devel libattr-devel libblkid-devel libcurl-devel libffi-devel \
|
||||||
libselinux-devel libtirpc-devel libtool libudev-devel libuuid-devel \
|
ncompress libselinux-devel libtirpc-devel libtool libudev-devel \
|
||||||
lsscsi mdadm nfs-utils openssl-devel pam-devel pamtester parted perf \
|
libuuid-devel lsscsi mdadm nfs-utils openssl-devel pam-devel pamtester \
|
||||||
python3 python3-cffi python3-devel python3-packaging kernel-devel \
|
parted perf python3 python3-cffi python3-devel python3-packaging \
|
||||||
python3-setuptools qemu-guest-agent rng-tools rpcgen rpm-build rsync \
|
kernel-devel python3-setuptools qemu-guest-agent rng-tools rpcgen \
|
||||||
samba sysstat systemd watchdog wget xfsprogs-devel xxhash zlib-devel
|
rpm-build rsync samba sysstat systemd watchdog wget xfsprogs-devel xxhash \
|
||||||
|
zlib-devel
|
||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,7 +104,7 @@ case "$1" in
|
|||||||
sudo dnf install -y kernel-abi-whitelists
|
sudo dnf install -y kernel-abi-whitelists
|
||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
;;
|
;;
|
||||||
almalinux9|centos-stream9)
|
almalinux9|centos-stream9|centos-stream10)
|
||||||
echo "##[group]Enable epel and crb repositories"
|
echo "##[group]Enable epel and crb repositories"
|
||||||
sudo dnf config-manager -y --set-enabled crb
|
sudo dnf config-manager -y --set-enabled crb
|
||||||
sudo dnf install -y epel-release
|
sudo dnf install -y epel-release
|
||||||
@ -111,6 +118,7 @@ case "$1" in
|
|||||||
archlinux
|
archlinux
|
||||||
;;
|
;;
|
||||||
debian*)
|
debian*)
|
||||||
|
echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
|
||||||
debian
|
debian
|
||||||
echo "##[group]Install Debian specific"
|
echo "##[group]Install Debian specific"
|
||||||
sudo apt-get install -yq linux-perf dh-sequence-dkms
|
sudo apt-get install -yq linux-perf dh-sequence-dkms
|
||||||
|
2
.github/workflows/scripts/qemu-4-build.sh
vendored
2
.github/workflows/scripts/qemu-4-build.sh
vendored
@ -83,7 +83,7 @@ function rpm_build_and_install() {
|
|||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
|
|
||||||
echo "##[group]Install"
|
echo "##[group]Install"
|
||||||
run sudo dnf -y --skip-broken localinstall $(ls *.rpm | grep -v src.rpm)
|
run sudo dnf -y --nobest install $(ls *.rpm | grep -v src.rpm)
|
||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
17
.github/workflows/scripts/qemu-5-setup.sh
vendored
17
.github/workflows/scripts/qemu-5-setup.sh
vendored
@ -14,17 +14,21 @@ PID=$(pidof /usr/bin/qemu-system-x86_64)
|
|||||||
tail --pid=$PID -f /dev/null
|
tail --pid=$PID -f /dev/null
|
||||||
sudo virsh undefine openzfs
|
sudo virsh undefine openzfs
|
||||||
|
|
||||||
# definitions of per operating system
|
# default values per test vm:
|
||||||
|
VMs=2
|
||||||
|
CPU=2
|
||||||
|
|
||||||
|
# cpu pinning
|
||||||
|
CPUSET=("0,1" "2,3")
|
||||||
|
|
||||||
case "$OS" in
|
case "$OS" in
|
||||||
freebsd*)
|
freebsd*)
|
||||||
VMs=2
|
# FreeBSD can't be optimized via ksmtuned
|
||||||
CPU=3
|
|
||||||
RAM=6
|
RAM=6
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
VMs=2
|
# Linux can be optimized via ksmtuned
|
||||||
CPU=3
|
RAM=8
|
||||||
RAM=7
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@ -73,6 +77,7 @@ EOF
|
|||||||
--cpu host-passthrough \
|
--cpu host-passthrough \
|
||||||
--virt-type=kvm --hvm \
|
--virt-type=kvm --hvm \
|
||||||
--vcpus=$CPU,sockets=1 \
|
--vcpus=$CPU,sockets=1 \
|
||||||
|
--cpuset=${CPUSET[$((i-1))]} \
|
||||||
--memory $((1024*RAM)) \
|
--memory $((1024*RAM)) \
|
||||||
--memballoon model=virtio \
|
--memballoon model=virtio \
|
||||||
--graphics none \
|
--graphics none \
|
||||||
|
@ -11,12 +11,10 @@ function output() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function outfile() {
|
function outfile() {
|
||||||
test -s "$1" || return
|
|
||||||
cat "$1" >> "out-$logfile.md"
|
cat "$1" >> "out-$logfile.md"
|
||||||
}
|
}
|
||||||
|
|
||||||
function outfile_plain() {
|
function outfile_plain() {
|
||||||
test -s "$1" || return
|
|
||||||
output "<pre>"
|
output "<pre>"
|
||||||
cat "$1" >> "out-$logfile.md"
|
cat "$1" >> "out-$logfile.md"
|
||||||
output "</pre>"
|
output "</pre>"
|
||||||
@ -45,6 +43,8 @@ if [ ! -f out-1.md ]; then
|
|||||||
tar xf "$tarfile"
|
tar xf "$tarfile"
|
||||||
test -s env.txt || continue
|
test -s env.txt || continue
|
||||||
source env.txt
|
source env.txt
|
||||||
|
# when uname.txt is there, the other files are also ok
|
||||||
|
test -s uname.txt || continue
|
||||||
output "\n## Functional Tests: $OSNAME\n"
|
output "\n## Functional Tests: $OSNAME\n"
|
||||||
outfile_plain uname.txt
|
outfile_plain uname.txt
|
||||||
outfile_plain summary.txt
|
outfile_plain summary.txt
|
||||||
|
40
.github/workflows/zfs-qemu.yml
vendored
40
.github/workflows/zfs-qemu.yml
vendored
@ -3,6 +3,18 @@ name: zfs-qemu
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
include_stream9:
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
description: 'Test on CentOS 9 stream'
|
||||||
|
include_stream10:
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
description: 'Test on CentOS 10 stream'
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
@ -22,8 +34,8 @@ jobs:
|
|||||||
- name: Generate OS config and CI type
|
- name: Generate OS config and CI type
|
||||||
id: os
|
id: os
|
||||||
run: |
|
run: |
|
||||||
FULL_OS='["almalinux8", "almalinux9", "centos-stream9", "debian11", "debian12", "fedora39", "fedora40", "freebsd13", "freebsd13r", "freebsd14", "freebsd14r", "ubuntu20", "ubuntu22", "ubuntu24"]'
|
FULL_OS='["almalinux8", "almalinux9", "debian11", "debian12", "fedora40", "fedora41", "freebsd13-3r", "freebsd13-4s", "freebsd14-1r", "freebsd14-2s", "freebsd15-0c", "ubuntu20", "ubuntu22", "ubuntu24"]'
|
||||||
QUICK_OS='["almalinux8", "almalinux9", "debian12", "fedora40", "freebsd13", "freebsd14", "ubuntu24"]'
|
QUICK_OS='["almalinux8", "almalinux9", "debian12", "fedora41", "freebsd13-3r", "freebsd14-2r", "ubuntu24"]'
|
||||||
# determine CI type when running on PR
|
# determine CI type when running on PR
|
||||||
ci_type="full"
|
ci_type="full"
|
||||||
if ${{ github.event_name == 'pull_request' }}; then
|
if ${{ github.event_name == 'pull_request' }}; then
|
||||||
@ -37,19 +49,35 @@ jobs:
|
|||||||
os_selection="$FULL_OS"
|
os_selection="$FULL_OS"
|
||||||
fi
|
fi
|
||||||
os_json=$(echo ${os_selection} | jq -c)
|
os_json=$(echo ${os_selection} | jq -c)
|
||||||
|
|
||||||
|
# Add optional runners
|
||||||
|
if [ "${{ github.event.inputs.include_stream9 }}" == 'true' ]; then
|
||||||
|
os_json=$(echo $os_json | jq -c '. += ["centos-stream9"]')
|
||||||
|
fi
|
||||||
|
if [ "${{ github.event.inputs.include_stream10 }}" == 'true' ]; then
|
||||||
|
os_json=$(echo $os_json | jq -c '. += ["centos-stream10"]')
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $os_json
|
||||||
echo "os=$os_json" >> $GITHUB_OUTPUT
|
echo "os=$os_json" >> $GITHUB_OUTPUT
|
||||||
echo "ci_type=$ci_type" >> $GITHUB_OUTPUT
|
echo "ci_type=$ci_type" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
qemu-vm:
|
qemu-vm:
|
||||||
name: qemu-x86
|
name: qemu-x86
|
||||||
needs: [ test-config ]
|
needs: [ test-config ]
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
# all:
|
# rhl: almalinux8, almalinux9, centos-stream9, fedora40, fedora41
|
||||||
# os: [almalinux8, almalinux9, archlinux, centos-stream9, fedora39, fedora40, debian11, debian12, freebsd13, freebsd13r, freebsd14, freebsd14r, freebsd15, ubuntu20, ubuntu22, ubuntu24]
|
# debian: debian11, debian12, ubuntu20, ubuntu22, ubuntu24
|
||||||
# openzfs:
|
# misc: archlinux, tumbleweed
|
||||||
# os: [almalinux8, almalinux9, centos-stream9, debian11, debian12, fedora39, fedora40, freebsd13, freebsd13r, freebsd14, freebsd14r, ubuntu20, ubuntu22, ubuntu24]
|
# FreeBSD variants of 2024-12:
|
||||||
|
# FreeBSD Release: freebsd13-3r, freebsd13-4r, freebsd14-1r, freebsd14-2r
|
||||||
|
# FreeBSD Stable: freebsd13-4s, freebsd14-2s
|
||||||
|
# FreeBSD Current: freebsd15-0c
|
||||||
os: ${{ fromJson(needs.test-config.outputs.test_os) }}
|
os: ${{ fromJson(needs.test-config.outputs.test_os) }}
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
|
2
.mailmap
2
.mailmap
@ -70,6 +70,7 @@ Rob Norris <robn@despairlabs.com>
|
|||||||
Rob Norris <rob.norris@klarasystems.com>
|
Rob Norris <rob.norris@klarasystems.com>
|
||||||
Sam Lunt <samuel.j.lunt@gmail.com>
|
Sam Lunt <samuel.j.lunt@gmail.com>
|
||||||
Sanjeev Bagewadi <sanjeev.bagewadi@gmail.com>
|
Sanjeev Bagewadi <sanjeev.bagewadi@gmail.com>
|
||||||
|
Sebastian Wuerl <s.wuerl@mailbox.org>
|
||||||
Stoiko Ivanov <github@nomore.at>
|
Stoiko Ivanov <github@nomore.at>
|
||||||
Tamas TEVESZ <ice@extreme.hu>
|
Tamas TEVESZ <ice@extreme.hu>
|
||||||
WHR <msl0000023508@gmail.com>
|
WHR <msl0000023508@gmail.com>
|
||||||
@ -78,6 +79,7 @@ Youzhong Yang <youzhong@gmail.com>
|
|||||||
|
|
||||||
# Signed-off-by: overriding Author:
|
# Signed-off-by: overriding Author:
|
||||||
Ryan <errornointernet@envs.net> <error.nointernet@gmail.com>
|
Ryan <errornointernet@envs.net> <error.nointernet@gmail.com>
|
||||||
|
Sietse <sietse@wizdom.nu> <uglymotha@wizdom.nu>
|
||||||
Qiuhao Chen <chenqiuhao1997@gmail.com> <haohao0924@126.com>
|
Qiuhao Chen <chenqiuhao1997@gmail.com> <haohao0924@126.com>
|
||||||
Yuxin Wang <yuxinwang9999@gmail.com> <Bi11gates9999@gmail.com>
|
Yuxin Wang <yuxinwang9999@gmail.com> <Bi11gates9999@gmail.com>
|
||||||
Zhenlei Huang <zlei@FreeBSD.org> <zlei.huang@gmail.com>
|
Zhenlei Huang <zlei@FreeBSD.org> <zlei.huang@gmail.com>
|
||||||
|
4
AUTHORS
4
AUTHORS
@ -423,6 +423,7 @@ CONTRIBUTORS:
|
|||||||
Mathieu Velten <matmaul@gmail.com>
|
Mathieu Velten <matmaul@gmail.com>
|
||||||
Matt Fiddaman <github@m.fiddaman.uk>
|
Matt Fiddaman <github@m.fiddaman.uk>
|
||||||
Matthew Ahrens <matt@delphix.com>
|
Matthew Ahrens <matt@delphix.com>
|
||||||
|
Matthew Heller <matthew.f.heller@gmail.com>
|
||||||
Matthew Thode <mthode@mthode.org>
|
Matthew Thode <mthode@mthode.org>
|
||||||
Matthias Blankertz <matthias@blankertz.org>
|
Matthias Blankertz <matthias@blankertz.org>
|
||||||
Matt Johnston <matt@fugro-fsi.com.au>
|
Matt Johnston <matt@fugro-fsi.com.au>
|
||||||
@ -562,6 +563,7 @@ CONTRIBUTORS:
|
|||||||
Scot W. Stevenson <scot.stevenson@gmail.com>
|
Scot W. Stevenson <scot.stevenson@gmail.com>
|
||||||
Sean Eric Fagan <sef@ixsystems.com>
|
Sean Eric Fagan <sef@ixsystems.com>
|
||||||
Sebastian Gottschall <s.gottschall@dd-wrt.com>
|
Sebastian Gottschall <s.gottschall@dd-wrt.com>
|
||||||
|
Sebastian Wuerl <s.wuerl@mailbox.org>
|
||||||
Sebastien Roy <seb@delphix.com>
|
Sebastien Roy <seb@delphix.com>
|
||||||
Sen Haerens <sen@senhaerens.be>
|
Sen Haerens <sen@senhaerens.be>
|
||||||
Serapheim Dimitropoulos <serapheim@delphix.com>
|
Serapheim Dimitropoulos <serapheim@delphix.com>
|
||||||
@ -574,6 +576,7 @@ CONTRIBUTORS:
|
|||||||
Shawn Bayern <sbayern@law.fsu.edu>
|
Shawn Bayern <sbayern@law.fsu.edu>
|
||||||
Shengqi Chen <harry-chen@outlook.com>
|
Shengqi Chen <harry-chen@outlook.com>
|
||||||
Shen Yan <shenyanxxxy@qq.com>
|
Shen Yan <shenyanxxxy@qq.com>
|
||||||
|
Sietse <sietse@wizdom.nu>
|
||||||
Simon Guest <simon.guest@tesujimath.org>
|
Simon Guest <simon.guest@tesujimath.org>
|
||||||
Simon Klinkert <simon.klinkert@gmail.com>
|
Simon Klinkert <simon.klinkert@gmail.com>
|
||||||
Sowrabha Gopal <sowrabha.gopal@delphix.com>
|
Sowrabha Gopal <sowrabha.gopal@delphix.com>
|
||||||
@ -629,6 +632,7 @@ CONTRIBUTORS:
|
|||||||
Trevor Bautista <trevrb@trevrb.net>
|
Trevor Bautista <trevrb@trevrb.net>
|
||||||
Trey Dockendorf <treydock@gmail.com>
|
Trey Dockendorf <treydock@gmail.com>
|
||||||
Troels Nørgaard <tnn@tradeshift.com>
|
Troels Nørgaard <tnn@tradeshift.com>
|
||||||
|
tstabrawa <tstabrawa@users.noreply.github.com>
|
||||||
Tulsi Jain <tulsi.jain@delphix.com>
|
Tulsi Jain <tulsi.jain@delphix.com>
|
||||||
Turbo Fredriksson <turbo@bayour.com>
|
Turbo Fredriksson <turbo@bayour.com>
|
||||||
Tyler J. Stachecki <stachecki.tyler@gmail.com>
|
Tyler J. Stachecki <stachecki.tyler@gmail.com>
|
||||||
|
4
META
4
META
@ -2,9 +2,9 @@ Meta: 1
|
|||||||
Name: zfs
|
Name: zfs
|
||||||
Branch: 1.0
|
Branch: 1.0
|
||||||
Version: 2.3.0
|
Version: 2.3.0
|
||||||
Release: rc1
|
Release: 1
|
||||||
Release-Tags: relext
|
Release-Tags: relext
|
||||||
License: CDDL
|
License: CDDL
|
||||||
Author: OpenZFS
|
Author: OpenZFS
|
||||||
Linux-Maximum: 6.11
|
Linux-Maximum: 6.12
|
||||||
Linux-Minimum: 4.18
|
Linux-Minimum: 4.18
|
||||||
|
@ -662,10 +662,7 @@ def section_arc(kstats_dict):
|
|||||||
print()
|
print()
|
||||||
|
|
||||||
print('ARC hash breakdown:')
|
print('ARC hash breakdown:')
|
||||||
prt_i1('Elements max:', f_hits(arc_stats['hash_elements_max']))
|
prt_i1('Elements:', f_hits(arc_stats['hash_elements']))
|
||||||
prt_i2('Elements current:',
|
|
||||||
f_perc(arc_stats['hash_elements'], arc_stats['hash_elements_max']),
|
|
||||||
f_hits(arc_stats['hash_elements']))
|
|
||||||
prt_i1('Collisions:', f_hits(arc_stats['hash_collisions']))
|
prt_i1('Collisions:', f_hits(arc_stats['hash_collisions']))
|
||||||
|
|
||||||
prt_i1('Chain max:', f_hits(arc_stats['hash_chain_max']))
|
prt_i1('Chain max:', f_hits(arc_stats['hash_chain_max']))
|
||||||
|
172
cmd/zdb/zdb.c
172
cmd/zdb/zdb.c
@ -1131,7 +1131,7 @@ dump_zap(objset_t *os, uint64_t object, void *data, size_t size)
|
|||||||
!!(zap_getflags(zc.zc_zap) & ZAP_FLAG_UINT64_KEY);
|
!!(zap_getflags(zc.zc_zap) & ZAP_FLAG_UINT64_KEY);
|
||||||
|
|
||||||
if (key64)
|
if (key64)
|
||||||
(void) printf("\t\t0x%010lx = ",
|
(void) printf("\t\t0x%010" PRIu64 "x = ",
|
||||||
*(uint64_t *)attrp->za_name);
|
*(uint64_t *)attrp->za_name);
|
||||||
else
|
else
|
||||||
(void) printf("\t\t%s = ", attrp->za_name);
|
(void) printf("\t\t%s = ", attrp->za_name);
|
||||||
@ -1967,17 +1967,53 @@ dump_dedup_ratio(const ddt_stat_t *dds)
|
|||||||
static void
|
static void
|
||||||
dump_ddt_log(ddt_t *ddt)
|
dump_ddt_log(ddt_t *ddt)
|
||||||
{
|
{
|
||||||
|
if (ddt->ddt_version != DDT_VERSION_FDT ||
|
||||||
|
!(ddt->ddt_flags & DDT_FLAG_LOG))
|
||||||
|
return;
|
||||||
|
|
||||||
for (int n = 0; n < 2; n++) {
|
for (int n = 0; n < 2; n++) {
|
||||||
ddt_log_t *ddl = &ddt->ddt_log[n];
|
ddt_log_t *ddl = &ddt->ddt_log[n];
|
||||||
|
|
||||||
|
char flagstr[64] = {0};
|
||||||
|
if (ddl->ddl_flags > 0) {
|
||||||
|
flagstr[0] = ' ';
|
||||||
|
int c = 1;
|
||||||
|
if (ddl->ddl_flags & DDL_FLAG_FLUSHING)
|
||||||
|
c += strlcpy(&flagstr[c], " FLUSHING",
|
||||||
|
sizeof (flagstr) - c);
|
||||||
|
if (ddl->ddl_flags & DDL_FLAG_CHECKPOINT)
|
||||||
|
c += strlcpy(&flagstr[c], " CHECKPOINT",
|
||||||
|
sizeof (flagstr) - c);
|
||||||
|
if (ddl->ddl_flags &
|
||||||
|
~(DDL_FLAG_FLUSHING|DDL_FLAG_CHECKPOINT))
|
||||||
|
c += strlcpy(&flagstr[c], " UNKNOWN",
|
||||||
|
sizeof (flagstr) - c);
|
||||||
|
flagstr[1] = '[';
|
||||||
|
flagstr[c++] = ']';
|
||||||
|
}
|
||||||
|
|
||||||
uint64_t count = avl_numnodes(&ddl->ddl_tree);
|
uint64_t count = avl_numnodes(&ddl->ddl_tree);
|
||||||
if (count == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
printf(DMU_POOL_DDT_LOG ": %lu log entries\n",
|
printf(DMU_POOL_DDT_LOG ": flags=0x%02x%s; obj=%llu; "
|
||||||
zio_checksum_table[ddt->ddt_checksum].ci_name, n, count);
|
"len=%llu; txg=%llu; entries=%llu\n",
|
||||||
|
zio_checksum_table[ddt->ddt_checksum].ci_name, n,
|
||||||
|
ddl->ddl_flags, flagstr,
|
||||||
|
(u_longlong_t)ddl->ddl_object,
|
||||||
|
(u_longlong_t)ddl->ddl_length,
|
||||||
|
(u_longlong_t)ddl->ddl_first_txg, (u_longlong_t)count);
|
||||||
|
|
||||||
if (dump_opt['D'] < 4)
|
if (ddl->ddl_flags & DDL_FLAG_CHECKPOINT) {
|
||||||
|
const ddt_key_t *ddk = &ddl->ddl_checkpoint;
|
||||||
|
printf(" checkpoint: "
|
||||||
|
"%016llx:%016llx:%016llx:%016llx:%016llx\n",
|
||||||
|
(u_longlong_t)ddk->ddk_cksum.zc_word[0],
|
||||||
|
(u_longlong_t)ddk->ddk_cksum.zc_word[1],
|
||||||
|
(u_longlong_t)ddk->ddk_cksum.zc_word[2],
|
||||||
|
(u_longlong_t)ddk->ddk_cksum.zc_word[3],
|
||||||
|
(u_longlong_t)ddk->ddk_prop);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count == 0 || dump_opt['D'] < 4)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ddt_lightweight_entry_t ddlwe;
|
ddt_lightweight_entry_t ddlwe;
|
||||||
@ -1991,7 +2027,7 @@ dump_ddt_log(ddt_t *ddt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dump_ddt(ddt_t *ddt, ddt_type_t type, ddt_class_t class)
|
dump_ddt_object(ddt_t *ddt, ddt_type_t type, ddt_class_t class)
|
||||||
{
|
{
|
||||||
char name[DDT_NAMELEN];
|
char name[DDT_NAMELEN];
|
||||||
ddt_lightweight_entry_t ddlwe;
|
ddt_lightweight_entry_t ddlwe;
|
||||||
@ -2016,11 +2052,8 @@ dump_ddt(ddt_t *ddt, ddt_type_t type, ddt_class_t class)
|
|||||||
|
|
||||||
ddt_object_name(ddt, type, class, name);
|
ddt_object_name(ddt, type, class, name);
|
||||||
|
|
||||||
(void) printf("%s: %llu entries, size %llu on disk, %llu in core\n",
|
(void) printf("%s: dspace=%llu; mspace=%llu; entries=%llu\n", name,
|
||||||
name,
|
(u_longlong_t)dspace, (u_longlong_t)mspace, (u_longlong_t)count);
|
||||||
(u_longlong_t)count,
|
|
||||||
(u_longlong_t)dspace,
|
|
||||||
(u_longlong_t)mspace);
|
|
||||||
|
|
||||||
if (dump_opt['D'] < 3)
|
if (dump_opt['D'] < 3)
|
||||||
return;
|
return;
|
||||||
@ -2043,24 +2076,52 @@ dump_ddt(ddt_t *ddt, ddt_type_t type, ddt_class_t class)
|
|||||||
(void) printf("\n");
|
(void) printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
dump_ddt(ddt_t *ddt)
|
||||||
|
{
|
||||||
|
if (!ddt || ddt->ddt_version == DDT_VERSION_UNCONFIGURED)
|
||||||
|
return;
|
||||||
|
|
||||||
|
char flagstr[64] = {0};
|
||||||
|
if (ddt->ddt_flags > 0) {
|
||||||
|
flagstr[0] = ' ';
|
||||||
|
int c = 1;
|
||||||
|
if (ddt->ddt_flags & DDT_FLAG_FLAT)
|
||||||
|
c += strlcpy(&flagstr[c], " FLAT",
|
||||||
|
sizeof (flagstr) - c);
|
||||||
|
if (ddt->ddt_flags & DDT_FLAG_LOG)
|
||||||
|
c += strlcpy(&flagstr[c], " LOG",
|
||||||
|
sizeof (flagstr) - c);
|
||||||
|
if (ddt->ddt_flags & ~DDT_FLAG_MASK)
|
||||||
|
c += strlcpy(&flagstr[c], " UNKNOWN",
|
||||||
|
sizeof (flagstr) - c);
|
||||||
|
flagstr[1] = '[';
|
||||||
|
flagstr[c] = ']';
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("DDT-%s: version=%llu [%s]; flags=0x%02llx%s; rootobj=%llu\n",
|
||||||
|
zio_checksum_table[ddt->ddt_checksum].ci_name,
|
||||||
|
(u_longlong_t)ddt->ddt_version,
|
||||||
|
(ddt->ddt_version == 0) ? "LEGACY" :
|
||||||
|
(ddt->ddt_version == 1) ? "FDT" : "UNKNOWN",
|
||||||
|
(u_longlong_t)ddt->ddt_flags, flagstr,
|
||||||
|
(u_longlong_t)ddt->ddt_dir_object);
|
||||||
|
|
||||||
|
for (ddt_type_t type = 0; type < DDT_TYPES; type++)
|
||||||
|
for (ddt_class_t class = 0; class < DDT_CLASSES; class++)
|
||||||
|
dump_ddt_object(ddt, type, class);
|
||||||
|
|
||||||
|
dump_ddt_log(ddt);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dump_all_ddts(spa_t *spa)
|
dump_all_ddts(spa_t *spa)
|
||||||
{
|
{
|
||||||
ddt_histogram_t ddh_total = {{{0}}};
|
ddt_histogram_t ddh_total = {{{0}}};
|
||||||
ddt_stat_t dds_total = {0};
|
ddt_stat_t dds_total = {0};
|
||||||
|
|
||||||
for (enum zio_checksum c = 0; c < ZIO_CHECKSUM_FUNCTIONS; c++) {
|
for (enum zio_checksum c = 0; c < ZIO_CHECKSUM_FUNCTIONS; c++)
|
||||||
ddt_t *ddt = spa->spa_ddt[c];
|
dump_ddt(spa->spa_ddt[c]);
|
||||||
if (!ddt || ddt->ddt_version == DDT_VERSION_UNCONFIGURED)
|
|
||||||
continue;
|
|
||||||
for (ddt_type_t type = 0; type < DDT_TYPES; type++) {
|
|
||||||
for (ddt_class_t class = 0; class < DDT_CLASSES;
|
|
||||||
class++) {
|
|
||||||
dump_ddt(ddt, type, class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dump_ddt_log(ddt);
|
|
||||||
}
|
|
||||||
|
|
||||||
ddt_get_dedup_stats(spa, &dds_total);
|
ddt_get_dedup_stats(spa, &dds_total);
|
||||||
|
|
||||||
@ -2119,9 +2180,6 @@ dump_brt(spa_t *spa)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
brt_t *brt = spa->spa_brt;
|
|
||||||
VERIFY(brt);
|
|
||||||
|
|
||||||
char count[32], used[32], saved[32];
|
char count[32], used[32], saved[32];
|
||||||
zdb_nicebytes(brt_get_used(spa), used, sizeof (used));
|
zdb_nicebytes(brt_get_used(spa), used, sizeof (used));
|
||||||
zdb_nicebytes(brt_get_saved(spa), saved, sizeof (saved));
|
zdb_nicebytes(brt_get_saved(spa), saved, sizeof (saved));
|
||||||
@ -2132,11 +2190,8 @@ dump_brt(spa_t *spa)
|
|||||||
if (dump_opt['T'] < 2)
|
if (dump_opt['T'] < 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (uint64_t vdevid = 0; vdevid < brt->brt_nvdevs; vdevid++) {
|
for (uint64_t vdevid = 0; vdevid < spa->spa_brt_nvdevs; vdevid++) {
|
||||||
brt_vdev_t *brtvd = &brt->brt_vdevs[vdevid];
|
brt_vdev_t *brtvd = spa->spa_brt_vdevs[vdevid];
|
||||||
if (brtvd == NULL)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!brtvd->bv_initiated) {
|
if (!brtvd->bv_initiated) {
|
||||||
printf("BRT: vdev %" PRIu64 ": empty\n", vdevid);
|
printf("BRT: vdev %" PRIu64 ": empty\n", vdevid);
|
||||||
continue;
|
continue;
|
||||||
@ -2152,34 +2207,54 @@ dump_brt(spa_t *spa)
|
|||||||
if (dump_opt['T'] < 3)
|
if (dump_opt['T'] < 3)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* -TTT shows a per-vdev histograms; -TTTT shows all entries */
|
||||||
|
boolean_t do_histo = dump_opt['T'] == 3;
|
||||||
|
|
||||||
char dva[64];
|
char dva[64];
|
||||||
|
|
||||||
|
if (!do_histo)
|
||||||
printf("\n%-16s %-10s\n", "DVA", "REFCNT");
|
printf("\n%-16s %-10s\n", "DVA", "REFCNT");
|
||||||
|
|
||||||
for (uint64_t vdevid = 0; vdevid < brt->brt_nvdevs; vdevid++) {
|
for (uint64_t vdevid = 0; vdevid < spa->spa_brt_nvdevs; vdevid++) {
|
||||||
brt_vdev_t *brtvd = &brt->brt_vdevs[vdevid];
|
brt_vdev_t *brtvd = spa->spa_brt_vdevs[vdevid];
|
||||||
if (brtvd == NULL || !brtvd->bv_initiated)
|
if (!brtvd->bv_initiated)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
uint64_t counts[64] = {};
|
||||||
|
|
||||||
zap_cursor_t zc;
|
zap_cursor_t zc;
|
||||||
zap_attribute_t *za = zap_attribute_alloc();
|
zap_attribute_t *za = zap_attribute_alloc();
|
||||||
for (zap_cursor_init(&zc, brt->brt_mos, brtvd->bv_mos_entries);
|
for (zap_cursor_init(&zc, spa->spa_meta_objset,
|
||||||
|
brtvd->bv_mos_entries);
|
||||||
zap_cursor_retrieve(&zc, za) == 0;
|
zap_cursor_retrieve(&zc, za) == 0;
|
||||||
zap_cursor_advance(&zc)) {
|
zap_cursor_advance(&zc)) {
|
||||||
uint64_t refcnt;
|
uint64_t refcnt;
|
||||||
VERIFY0(zap_lookup_uint64(brt->brt_mos,
|
VERIFY0(zap_lookup_uint64(spa->spa_meta_objset,
|
||||||
brtvd->bv_mos_entries,
|
brtvd->bv_mos_entries,
|
||||||
(const uint64_t *)za->za_name, 1,
|
(const uint64_t *)za->za_name, 1,
|
||||||
za->za_integer_length, za->za_num_integers,
|
za->za_integer_length, za->za_num_integers,
|
||||||
&refcnt));
|
&refcnt));
|
||||||
|
|
||||||
uint64_t offset = *(const uint64_t *)za->za_name;
|
if (do_histo)
|
||||||
|
counts[highbit64(refcnt)]++;
|
||||||
|
else {
|
||||||
|
uint64_t offset =
|
||||||
|
*(const uint64_t *)za->za_name;
|
||||||
|
|
||||||
snprintf(dva, sizeof (dva), "%" PRIu64 ":%llx", vdevid,
|
snprintf(dva, sizeof (dva), "%" PRIu64 ":%llx",
|
||||||
(u_longlong_t)offset);
|
vdevid, (u_longlong_t)offset);
|
||||||
printf("%-16s %-10llu\n", dva, (u_longlong_t)refcnt);
|
printf("%-16s %-10llu\n", dva,
|
||||||
|
(u_longlong_t)refcnt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
zap_cursor_fini(&zc);
|
zap_cursor_fini(&zc);
|
||||||
zap_attribute_free(za);
|
zap_attribute_free(za);
|
||||||
|
|
||||||
|
if (do_histo) {
|
||||||
|
printf("\nBRT: vdev %" PRIu64
|
||||||
|
": DVAs with 2^n refcnts:\n", vdevid);
|
||||||
|
dump_histogram(counts, 64, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4266,6 +4341,10 @@ dump_uberblock(uberblock_t *ub, const char *header, const char *footer)
|
|||||||
(void) printf("\ttimestamp = %llu UTC = %s",
|
(void) printf("\ttimestamp = %llu UTC = %s",
|
||||||
(u_longlong_t)ub->ub_timestamp, ctime(×tamp));
|
(u_longlong_t)ub->ub_timestamp, ctime(×tamp));
|
||||||
|
|
||||||
|
char blkbuf[BP_SPRINTF_LEN];
|
||||||
|
snprintf_blkptr(blkbuf, sizeof (blkbuf), &ub->ub_rootbp);
|
||||||
|
(void) printf("\tbp = %s\n", blkbuf);
|
||||||
|
|
||||||
(void) printf("\tmmp_magic = %016llx\n",
|
(void) printf("\tmmp_magic = %016llx\n",
|
||||||
(u_longlong_t)ub->ub_mmp_magic);
|
(u_longlong_t)ub->ub_mmp_magic);
|
||||||
if (MMP_VALID(ub)) {
|
if (MMP_VALID(ub)) {
|
||||||
@ -6874,7 +6953,7 @@ iterate_deleted_livelists(spa_t *spa, ll_iter_t func, void *arg)
|
|||||||
for (zap_cursor_init(&zc, mos, zap_obj);
|
for (zap_cursor_init(&zc, mos, zap_obj);
|
||||||
zap_cursor_retrieve(&zc, attrp) == 0;
|
zap_cursor_retrieve(&zc, attrp) == 0;
|
||||||
(void) zap_cursor_advance(&zc)) {
|
(void) zap_cursor_advance(&zc)) {
|
||||||
dsl_deadlist_open(&ll, mos, attrp->za_first_integer);
|
VERIFY0(dsl_deadlist_open(&ll, mos, attrp->za_first_integer));
|
||||||
func(&ll, arg);
|
func(&ll, arg);
|
||||||
dsl_deadlist_close(&ll);
|
dsl_deadlist_close(&ll);
|
||||||
}
|
}
|
||||||
@ -8204,16 +8283,13 @@ dump_mos_leaks(spa_t *spa)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spa->spa_brt != NULL) {
|
for (uint64_t vdevid = 0; vdevid < spa->spa_brt_nvdevs; vdevid++) {
|
||||||
brt_t *brt = spa->spa_brt;
|
brt_vdev_t *brtvd = spa->spa_brt_vdevs[vdevid];
|
||||||
for (uint64_t vdevid = 0; vdevid < brt->brt_nvdevs; vdevid++) {
|
if (brtvd->bv_initiated) {
|
||||||
brt_vdev_t *brtvd = &brt->brt_vdevs[vdevid];
|
|
||||||
if (brtvd != NULL && brtvd->bv_initiated) {
|
|
||||||
mos_obj_refd(brtvd->bv_mos_brtvdev);
|
mos_obj_refd(brtvd->bv_mos_brtvdev);
|
||||||
mos_obj_refd(brtvd->bv_mos_entries);
|
mos_obj_refd(brtvd->bv_mos_entries);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Visit all allocated objects and make sure they are referenced.
|
* Visit all allocated objects and make sure they are referenced.
|
||||||
|
@ -67,19 +67,19 @@ zil_prt_rec_create(zilog_t *zilog, int txtype, const void *arg)
|
|||||||
const lr_create_t *lrc = arg;
|
const lr_create_t *lrc = arg;
|
||||||
const _lr_create_t *lr = &lrc->lr_create;
|
const _lr_create_t *lr = &lrc->lr_create;
|
||||||
time_t crtime = lr->lr_crtime[0];
|
time_t crtime = lr->lr_crtime[0];
|
||||||
char *name, *link;
|
const char *name, *link;
|
||||||
lr_attr_t *lrattr;
|
lr_attr_t *lrattr;
|
||||||
|
|
||||||
name = (char *)(lr + 1);
|
name = (const char *)&lrc->lr_data[0];
|
||||||
|
|
||||||
if (lr->lr_common.lrc_txtype == TX_CREATE_ATTR ||
|
if (lr->lr_common.lrc_txtype == TX_CREATE_ATTR ||
|
||||||
lr->lr_common.lrc_txtype == TX_MKDIR_ATTR) {
|
lr->lr_common.lrc_txtype == TX_MKDIR_ATTR) {
|
||||||
lrattr = (lr_attr_t *)(lr + 1);
|
lrattr = (lr_attr_t *)&lrc->lr_data[0];
|
||||||
name += ZIL_XVAT_SIZE(lrattr->lr_attr_masksize);
|
name += ZIL_XVAT_SIZE(lrattr->lr_attr_masksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (txtype == TX_SYMLINK) {
|
if (txtype == TX_SYMLINK) {
|
||||||
link = name + strlen(name) + 1;
|
link = (const char *)&lrc->lr_data[strlen(name) + 1];
|
||||||
(void) printf("%s%s -> %s\n", tab_prefix, name, link);
|
(void) printf("%s%s -> %s\n", tab_prefix, name, link);
|
||||||
} else if (txtype != TX_MKXATTR) {
|
} else if (txtype != TX_MKXATTR) {
|
||||||
(void) printf("%s%s\n", tab_prefix, name);
|
(void) printf("%s%s\n", tab_prefix, name);
|
||||||
@ -104,7 +104,7 @@ zil_prt_rec_remove(zilog_t *zilog, int txtype, const void *arg)
|
|||||||
const lr_remove_t *lr = arg;
|
const lr_remove_t *lr = arg;
|
||||||
|
|
||||||
(void) printf("%sdoid %llu, name %s\n", tab_prefix,
|
(void) printf("%sdoid %llu, name %s\n", tab_prefix,
|
||||||
(u_longlong_t)lr->lr_doid, (char *)(lr + 1));
|
(u_longlong_t)lr->lr_doid, (const char *)&lr->lr_data[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -115,7 +115,7 @@ zil_prt_rec_link(zilog_t *zilog, int txtype, const void *arg)
|
|||||||
|
|
||||||
(void) printf("%sdoid %llu, link_obj %llu, name %s\n", tab_prefix,
|
(void) printf("%sdoid %llu, link_obj %llu, name %s\n", tab_prefix,
|
||||||
(u_longlong_t)lr->lr_doid, (u_longlong_t)lr->lr_link_obj,
|
(u_longlong_t)lr->lr_doid, (u_longlong_t)lr->lr_link_obj,
|
||||||
(char *)(lr + 1));
|
(const char *)&lr->lr_data[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -124,8 +124,8 @@ zil_prt_rec_rename(zilog_t *zilog, int txtype, const void *arg)
|
|||||||
(void) zilog, (void) txtype;
|
(void) zilog, (void) txtype;
|
||||||
const lr_rename_t *lrr = arg;
|
const lr_rename_t *lrr = arg;
|
||||||
const _lr_rename_t *lr = &lrr->lr_rename;
|
const _lr_rename_t *lr = &lrr->lr_rename;
|
||||||
char *snm = (char *)(lr + 1);
|
const char *snm = (const char *)&lrr->lr_data[0];
|
||||||
char *tnm = snm + strlen(snm) + 1;
|
const char *tnm = (const char *)&lrr->lr_data[strlen(snm) + 1];
|
||||||
|
|
||||||
(void) printf("%ssdoid %llu, tdoid %llu\n", tab_prefix,
|
(void) printf("%ssdoid %llu, tdoid %llu\n", tab_prefix,
|
||||||
(u_longlong_t)lr->lr_sdoid, (u_longlong_t)lr->lr_tdoid);
|
(u_longlong_t)lr->lr_sdoid, (u_longlong_t)lr->lr_tdoid);
|
||||||
@ -211,7 +211,7 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, const void *arg)
|
|||||||
|
|
||||||
/* data is stored after the end of the lr_write record */
|
/* data is stored after the end of the lr_write record */
|
||||||
data = abd_alloc(lr->lr_length, B_FALSE);
|
data = abd_alloc(lr->lr_length, B_FALSE);
|
||||||
abd_copy_from_buf(data, lr + 1, lr->lr_length);
|
abd_copy_from_buf(data, &lr->lr_data[0], lr->lr_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) printf("%s", tab_prefix);
|
(void) printf("%s", tab_prefix);
|
||||||
@ -309,7 +309,7 @@ zil_prt_rec_setsaxattr(zilog_t *zilog, int txtype, const void *arg)
|
|||||||
(void) zilog, (void) txtype;
|
(void) zilog, (void) txtype;
|
||||||
const lr_setsaxattr_t *lr = arg;
|
const lr_setsaxattr_t *lr = arg;
|
||||||
|
|
||||||
char *name = (char *)(lr + 1);
|
const char *name = (const char *)&lr->lr_data[0];
|
||||||
(void) printf("%sfoid %llu\n", tab_prefix,
|
(void) printf("%sfoid %llu\n", tab_prefix,
|
||||||
(u_longlong_t)lr->lr_foid);
|
(u_longlong_t)lr->lr_foid);
|
||||||
|
|
||||||
@ -318,7 +318,7 @@ zil_prt_rec_setsaxattr(zilog_t *zilog, int txtype, const void *arg)
|
|||||||
(void) printf("%sXAT_VALUE NULL\n", tab_prefix);
|
(void) printf("%sXAT_VALUE NULL\n", tab_prefix);
|
||||||
} else {
|
} else {
|
||||||
(void) printf("%sXAT_VALUE ", tab_prefix);
|
(void) printf("%sXAT_VALUE ", tab_prefix);
|
||||||
char *val = name + (strlen(name) + 1);
|
const char *val = (const char *)&lr->lr_data[strlen(name) + 1];
|
||||||
for (int i = 0; i < lr->lr_size; i++) {
|
for (int i = 0; i < lr->lr_size; i++) {
|
||||||
(void) printf("%c", *val);
|
(void) printf("%c", *val);
|
||||||
val++;
|
val++;
|
||||||
|
@ -445,8 +445,8 @@ zfs_retire_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl,
|
|||||||
* its a loopback event from spa_async_remove(). Just
|
* its a loopback event from spa_async_remove(). Just
|
||||||
* ignore it.
|
* ignore it.
|
||||||
*/
|
*/
|
||||||
if (vs->vs_state == VDEV_STATE_REMOVED &&
|
if ((vs->vs_state == VDEV_STATE_REMOVED && state ==
|
||||||
state == VDEV_STATE_REMOVED)
|
VDEV_STATE_REMOVED) || vs->vs_state == VDEV_STATE_OFFLINE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Remove the vdev since device is unplugged */
|
/* Remove the vdev since device is unplugged */
|
||||||
|
@ -139,7 +139,8 @@ dev_event_nvlist(struct udev_device *dev)
|
|||||||
* is /dev/sda.
|
* is /dev/sda.
|
||||||
*/
|
*/
|
||||||
struct udev_device *parent_dev = udev_device_get_parent(dev);
|
struct udev_device *parent_dev = udev_device_get_parent(dev);
|
||||||
if ((value = udev_device_get_sysattr_value(parent_dev, "size"))
|
if (parent_dev != NULL &&
|
||||||
|
(value = udev_device_get_sysattr_value(parent_dev, "size"))
|
||||||
!= NULL) {
|
!= NULL) {
|
||||||
uint64_t numval = DEV_BSIZE;
|
uint64_t numval = DEV_BSIZE;
|
||||||
|
|
||||||
|
@ -500,7 +500,7 @@ usage_prop_cb(int prop, void *cb)
|
|||||||
{
|
{
|
||||||
FILE *fp = cb;
|
FILE *fp = cb;
|
||||||
|
|
||||||
(void) fprintf(fp, "\t%-15s ", zfs_prop_to_name(prop));
|
(void) fprintf(fp, "\t%-22s ", zfs_prop_to_name(prop));
|
||||||
|
|
||||||
if (zfs_prop_readonly(prop))
|
if (zfs_prop_readonly(prop))
|
||||||
(void) fprintf(fp, " NO ");
|
(void) fprintf(fp, " NO ");
|
||||||
@ -561,40 +561,40 @@ usage(boolean_t requested)
|
|||||||
(void) fprintf(fp, "%s",
|
(void) fprintf(fp, "%s",
|
||||||
gettext("\nThe following properties are supported:\n"));
|
gettext("\nThe following properties are supported:\n"));
|
||||||
|
|
||||||
(void) fprintf(fp, "\n\t%-14s %s %s %s\n\n",
|
(void) fprintf(fp, "\n\t%-21s %s %s %s\n\n",
|
||||||
"PROPERTY", "EDIT", "INHERIT", "VALUES");
|
"PROPERTY", "EDIT", "INHERIT", "VALUES");
|
||||||
|
|
||||||
/* Iterate over all properties */
|
/* Iterate over all properties */
|
||||||
(void) zprop_iter(usage_prop_cb, fp, B_FALSE, B_TRUE,
|
(void) zprop_iter(usage_prop_cb, fp, B_FALSE, B_TRUE,
|
||||||
ZFS_TYPE_DATASET);
|
ZFS_TYPE_DATASET);
|
||||||
|
|
||||||
(void) fprintf(fp, "\t%-15s ", "userused@...");
|
(void) fprintf(fp, "\t%-22s ", "userused@...");
|
||||||
(void) fprintf(fp, " NO NO <size>\n");
|
(void) fprintf(fp, " NO NO <size>\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "groupused@...");
|
(void) fprintf(fp, "\t%-22s ", "groupused@...");
|
||||||
(void) fprintf(fp, " NO NO <size>\n");
|
(void) fprintf(fp, " NO NO <size>\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "projectused@...");
|
(void) fprintf(fp, "\t%-22s ", "projectused@...");
|
||||||
(void) fprintf(fp, " NO NO <size>\n");
|
(void) fprintf(fp, " NO NO <size>\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "userobjused@...");
|
(void) fprintf(fp, "\t%-22s ", "userobjused@...");
|
||||||
(void) fprintf(fp, " NO NO <size>\n");
|
(void) fprintf(fp, " NO NO <size>\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "groupobjused@...");
|
(void) fprintf(fp, "\t%-22s ", "groupobjused@...");
|
||||||
(void) fprintf(fp, " NO NO <size>\n");
|
(void) fprintf(fp, " NO NO <size>\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "projectobjused@...");
|
(void) fprintf(fp, "\t%-22s ", "projectobjused@...");
|
||||||
(void) fprintf(fp, " NO NO <size>\n");
|
(void) fprintf(fp, " NO NO <size>\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "userquota@...");
|
(void) fprintf(fp, "\t%-22s ", "userquota@...");
|
||||||
(void) fprintf(fp, "YES NO <size> | none\n");
|
(void) fprintf(fp, "YES NO <size> | none\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "groupquota@...");
|
(void) fprintf(fp, "\t%-22s ", "groupquota@...");
|
||||||
(void) fprintf(fp, "YES NO <size> | none\n");
|
(void) fprintf(fp, "YES NO <size> | none\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "projectquota@...");
|
(void) fprintf(fp, "\t%-22s ", "projectquota@...");
|
||||||
(void) fprintf(fp, "YES NO <size> | none\n");
|
(void) fprintf(fp, "YES NO <size> | none\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "userobjquota@...");
|
(void) fprintf(fp, "\t%-22s ", "userobjquota@...");
|
||||||
(void) fprintf(fp, "YES NO <size> | none\n");
|
(void) fprintf(fp, "YES NO <size> | none\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "groupobjquota@...");
|
(void) fprintf(fp, "\t%-22s ", "groupobjquota@...");
|
||||||
(void) fprintf(fp, "YES NO <size> | none\n");
|
(void) fprintf(fp, "YES NO <size> | none\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "projectobjquota@...");
|
(void) fprintf(fp, "\t%-22s ", "projectobjquota@...");
|
||||||
(void) fprintf(fp, "YES NO <size> | none\n");
|
(void) fprintf(fp, "YES NO <size> | none\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "written@<snap>");
|
(void) fprintf(fp, "\t%-22s ", "written@<snap>");
|
||||||
(void) fprintf(fp, " NO NO <size>\n");
|
(void) fprintf(fp, " NO NO <size>\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "written#<bookmark>");
|
(void) fprintf(fp, "\t%-22s ", "written#<bookmark>");
|
||||||
(void) fprintf(fp, " NO NO <size>\n");
|
(void) fprintf(fp, " NO NO <size>\n");
|
||||||
|
|
||||||
(void) fprintf(fp, gettext("\nSizes are specified in bytes "
|
(void) fprintf(fp, gettext("\nSizes are specified in bytes "
|
||||||
@ -2162,6 +2162,7 @@ zfs_do_get(int argc, char **argv)
|
|||||||
cb.cb_type = ZFS_TYPE_DATASET;
|
cb.cb_type = ZFS_TYPE_DATASET;
|
||||||
|
|
||||||
struct option long_options[] = {
|
struct option long_options[] = {
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
{"json-int", no_argument, NULL, ZFS_OPTION_JSON_NUMS_AS_INT},
|
{"json-int", no_argument, NULL, ZFS_OPTION_JSON_NUMS_AS_INT},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
@ -3760,8 +3761,13 @@ collect_dataset(zfs_handle_t *zhp, list_cbdata_t *cb)
|
|||||||
if (cb->cb_json) {
|
if (cb->cb_json) {
|
||||||
if (pl->pl_prop == ZFS_PROP_NAME)
|
if (pl->pl_prop == ZFS_PROP_NAME)
|
||||||
continue;
|
continue;
|
||||||
|
const char *prop_name;
|
||||||
|
if (pl->pl_prop != ZPROP_USERPROP)
|
||||||
|
prop_name = zfs_prop_to_name(pl->pl_prop);
|
||||||
|
else
|
||||||
|
prop_name = pl->pl_user_prop;
|
||||||
if (zprop_nvlist_one_property(
|
if (zprop_nvlist_one_property(
|
||||||
zfs_prop_to_name(pl->pl_prop), propstr,
|
prop_name, propstr,
|
||||||
sourcetype, source, NULL, props,
|
sourcetype, source, NULL, props,
|
||||||
cb->cb_json_as_int) != 0)
|
cb->cb_json_as_int) != 0)
|
||||||
nomem();
|
nomem();
|
||||||
@ -3852,6 +3858,7 @@ zfs_do_list(int argc, char **argv)
|
|||||||
nvlist_t *data = NULL;
|
nvlist_t *data = NULL;
|
||||||
|
|
||||||
struct option long_options[] = {
|
struct option long_options[] = {
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
{"json-int", no_argument, NULL, ZFS_OPTION_JSON_NUMS_AS_INT},
|
{"json-int", no_argument, NULL, ZFS_OPTION_JSON_NUMS_AS_INT},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
@ -7436,9 +7443,15 @@ share_mount(int op, int argc, char **argv)
|
|||||||
uint_t nthr;
|
uint_t nthr;
|
||||||
jsobj = data = item = NULL;
|
jsobj = data = item = NULL;
|
||||||
|
|
||||||
|
struct option long_options[] = {
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
|
{0, 0, 0, 0}
|
||||||
|
};
|
||||||
|
|
||||||
/* check options */
|
/* check options */
|
||||||
while ((c = getopt(argc, argv, op == OP_MOUNT ? ":ajRlvo:Of" : "al"))
|
while ((c = getopt_long(argc, argv,
|
||||||
!= -1) {
|
op == OP_MOUNT ? ":ajRlvo:Of" : "al",
|
||||||
|
op == OP_MOUNT ? long_options : NULL, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'a':
|
case 'a':
|
||||||
do_all = 1;
|
do_all = 1;
|
||||||
@ -8374,8 +8387,14 @@ zfs_do_channel_program(int argc, char **argv)
|
|||||||
boolean_t sync_flag = B_TRUE, json_output = B_FALSE;
|
boolean_t sync_flag = B_TRUE, json_output = B_FALSE;
|
||||||
zpool_handle_t *zhp;
|
zpool_handle_t *zhp;
|
||||||
|
|
||||||
|
struct option long_options[] = {
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
|
{0, 0, 0, 0}
|
||||||
|
};
|
||||||
|
|
||||||
/* check options */
|
/* check options */
|
||||||
while ((c = getopt(argc, argv, "nt:m:j")) != -1) {
|
while ((c = getopt_long(argc, argv, "nt:m:j", long_options,
|
||||||
|
NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 't':
|
case 't':
|
||||||
case 'm': {
|
case 'm': {
|
||||||
@ -9083,7 +9102,13 @@ zfs_do_version(int argc, char **argv)
|
|||||||
int c;
|
int c;
|
||||||
nvlist_t *jsobj = NULL, *zfs_ver = NULL;
|
nvlist_t *jsobj = NULL, *zfs_ver = NULL;
|
||||||
boolean_t json = B_FALSE;
|
boolean_t json = B_FALSE;
|
||||||
while ((c = getopt(argc, argv, "j")) != -1) {
|
|
||||||
|
struct option long_options[] = {
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
|
{0, 0, 0, 0}
|
||||||
|
};
|
||||||
|
|
||||||
|
while ((c = getopt_long(argc, argv, "j", long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'j':
|
case 'j':
|
||||||
json = B_TRUE;
|
json = B_TRUE;
|
||||||
@ -9187,7 +9212,7 @@ main(int argc, char **argv)
|
|||||||
* Special case '-V|--version'
|
* Special case '-V|--version'
|
||||||
*/
|
*/
|
||||||
if ((strcmp(cmdname, "-V") == 0) || (strcmp(cmdname, "--version") == 0))
|
if ((strcmp(cmdname, "-V") == 0) || (strcmp(cmdname, "--version") == 0))
|
||||||
return (zfs_do_version(argc, argv));
|
return (zfs_version_print() != 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Special case 'help'
|
* Special case 'help'
|
||||||
|
@ -512,7 +512,8 @@ get_usage(zpool_help_t idx)
|
|||||||
return (gettext("\tinitialize [-c | -s | -u] [-w] <pool> "
|
return (gettext("\tinitialize [-c | -s | -u] [-w] <pool> "
|
||||||
"[<device> ...]\n"));
|
"[<device> ...]\n"));
|
||||||
case HELP_SCRUB:
|
case HELP_SCRUB:
|
||||||
return (gettext("\tscrub [-s | -p] [-w] [-e] <pool> ...\n"));
|
return (gettext("\tscrub [-e | -s | -p | -C] [-w] "
|
||||||
|
"<pool> ...\n"));
|
||||||
case HELP_RESILVER:
|
case HELP_RESILVER:
|
||||||
return (gettext("\tresilver <pool> ...\n"));
|
return (gettext("\tresilver <pool> ...\n"));
|
||||||
case HELP_TRIM:
|
case HELP_TRIM:
|
||||||
@ -6882,8 +6883,13 @@ collect_pool(zpool_handle_t *zhp, list_cbdata_t *cb)
|
|||||||
if (cb->cb_json) {
|
if (cb->cb_json) {
|
||||||
if (pl->pl_prop == ZPOOL_PROP_NAME)
|
if (pl->pl_prop == ZPOOL_PROP_NAME)
|
||||||
continue;
|
continue;
|
||||||
|
const char *prop_name;
|
||||||
|
if (pl->pl_prop != ZPROP_USERPROP)
|
||||||
|
prop_name = zpool_prop_to_name(pl->pl_prop);
|
||||||
|
else
|
||||||
|
prop_name = pl->pl_user_prop;
|
||||||
(void) zprop_nvlist_one_property(
|
(void) zprop_nvlist_one_property(
|
||||||
zpool_prop_to_name(pl->pl_prop), propstr,
|
prop_name, propstr,
|
||||||
sourcetype, NULL, NULL, props, cb->cb_json_as_int);
|
sourcetype, NULL, NULL, props, cb->cb_json_as_int);
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
@ -7340,6 +7346,7 @@ zpool_do_list(int argc, char **argv)
|
|||||||
current_prop_type = ZFS_TYPE_POOL;
|
current_prop_type = ZFS_TYPE_POOL;
|
||||||
|
|
||||||
struct option long_options[] = {
|
struct option long_options[] = {
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
{"json-int", no_argument, NULL, ZPOOL_OPTION_JSON_NUMS_AS_INT},
|
{"json-int", no_argument, NULL, ZPOOL_OPTION_JSON_NUMS_AS_INT},
|
||||||
{"json-pool-key-guid", no_argument, NULL,
|
{"json-pool-key-guid", no_argument, NULL,
|
||||||
ZPOOL_OPTION_POOL_KEY_GUID},
|
ZPOOL_OPTION_POOL_KEY_GUID},
|
||||||
@ -7965,8 +7972,11 @@ zpool_do_online(int argc, char **argv)
|
|||||||
|
|
||||||
poolname = argv[0];
|
poolname = argv[0];
|
||||||
|
|
||||||
if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
|
if ((zhp = zpool_open(g_zfs, poolname)) == NULL) {
|
||||||
|
(void) fprintf(stderr, gettext("failed to open pool "
|
||||||
|
"\"%s\""), poolname);
|
||||||
return (1);
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
vdev_state_t oldstate;
|
vdev_state_t oldstate;
|
||||||
@ -7987,12 +7997,15 @@ zpool_do_online(int argc, char **argv)
|
|||||||
&l2cache, NULL);
|
&l2cache, NULL);
|
||||||
if (tgt == NULL) {
|
if (tgt == NULL) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
(void) fprintf(stderr, gettext("couldn't find device "
|
||||||
|
"\"%s\" in pool \"%s\"\n"), argv[i], poolname);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
uint_t vsc;
|
uint_t vsc;
|
||||||
oldstate = ((vdev_stat_t *)fnvlist_lookup_uint64_array(tgt,
|
oldstate = ((vdev_stat_t *)fnvlist_lookup_uint64_array(tgt,
|
||||||
ZPOOL_CONFIG_VDEV_STATS, &vsc))->vs_state;
|
ZPOOL_CONFIG_VDEV_STATS, &vsc))->vs_state;
|
||||||
if (zpool_vdev_online(zhp, argv[i], flags, &newstate) == 0) {
|
if ((rc = zpool_vdev_online(zhp, argv[i], flags,
|
||||||
|
&newstate)) == 0) {
|
||||||
if (newstate != VDEV_STATE_HEALTHY) {
|
if (newstate != VDEV_STATE_HEALTHY) {
|
||||||
(void) printf(gettext("warning: device '%s' "
|
(void) printf(gettext("warning: device '%s' "
|
||||||
"onlined, but remains in faulted state\n"),
|
"onlined, but remains in faulted state\n"),
|
||||||
@ -8018,6 +8031,9 @@ zpool_do_online(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
(void) fprintf(stderr, gettext("Failed to online "
|
||||||
|
"\"%s\" in pool \"%s\": %d\n"),
|
||||||
|
argv[i], poolname, rc);
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8102,8 +8118,11 @@ zpool_do_offline(int argc, char **argv)
|
|||||||
|
|
||||||
poolname = argv[0];
|
poolname = argv[0];
|
||||||
|
|
||||||
if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
|
if ((zhp = zpool_open(g_zfs, poolname)) == NULL) {
|
||||||
|
(void) fprintf(stderr, gettext("failed to open pool "
|
||||||
|
"\"%s\""), poolname);
|
||||||
return (1);
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
uint64_t guid = zpool_vdev_path_to_guid(zhp, argv[i]);
|
uint64_t guid = zpool_vdev_path_to_guid(zhp, argv[i]);
|
||||||
@ -8411,12 +8430,13 @@ wait_callback(zpool_handle_t *zhp, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* zpool scrub [-s | -p] [-w] [-e] <pool> ...
|
* zpool scrub [-e | -s | -p | -C] [-w] <pool> ...
|
||||||
*
|
*
|
||||||
* -e Only scrub blocks in the error log.
|
* -e Only scrub blocks in the error log.
|
||||||
* -s Stop. Stops any in-progress scrub.
|
* -s Stop. Stops any in-progress scrub.
|
||||||
* -p Pause. Pause in-progress scrub.
|
* -p Pause. Pause in-progress scrub.
|
||||||
* -w Wait. Blocks until scrub has completed.
|
* -w Wait. Blocks until scrub has completed.
|
||||||
|
* -C Scrub from last saved txg.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
zpool_do_scrub(int argc, char **argv)
|
zpool_do_scrub(int argc, char **argv)
|
||||||
@ -8432,9 +8452,10 @@ zpool_do_scrub(int argc, char **argv)
|
|||||||
boolean_t is_error_scrub = B_FALSE;
|
boolean_t is_error_scrub = B_FALSE;
|
||||||
boolean_t is_pause = B_FALSE;
|
boolean_t is_pause = B_FALSE;
|
||||||
boolean_t is_stop = B_FALSE;
|
boolean_t is_stop = B_FALSE;
|
||||||
|
boolean_t is_txg_continue = B_FALSE;
|
||||||
|
|
||||||
/* check options */
|
/* check options */
|
||||||
while ((c = getopt(argc, argv, "spwe")) != -1) {
|
while ((c = getopt(argc, argv, "spweC")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'e':
|
case 'e':
|
||||||
is_error_scrub = B_TRUE;
|
is_error_scrub = B_TRUE;
|
||||||
@ -8448,6 +8469,9 @@ zpool_do_scrub(int argc, char **argv)
|
|||||||
case 'w':
|
case 'w':
|
||||||
wait = B_TRUE;
|
wait = B_TRUE;
|
||||||
break;
|
break;
|
||||||
|
case 'C':
|
||||||
|
is_txg_continue = B_TRUE;
|
||||||
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
|
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
|
||||||
optopt);
|
optopt);
|
||||||
@ -8459,6 +8483,18 @@ zpool_do_scrub(int argc, char **argv)
|
|||||||
(void) fprintf(stderr, gettext("invalid option "
|
(void) fprintf(stderr, gettext("invalid option "
|
||||||
"combination :-s and -p are mutually exclusive\n"));
|
"combination :-s and -p are mutually exclusive\n"));
|
||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
|
} else if (is_pause && is_txg_continue) {
|
||||||
|
(void) fprintf(stderr, gettext("invalid option "
|
||||||
|
"combination :-p and -C are mutually exclusive\n"));
|
||||||
|
usage(B_FALSE);
|
||||||
|
} else if (is_stop && is_txg_continue) {
|
||||||
|
(void) fprintf(stderr, gettext("invalid option "
|
||||||
|
"combination :-s and -C are mutually exclusive\n"));
|
||||||
|
usage(B_FALSE);
|
||||||
|
} else if (is_error_scrub && is_txg_continue) {
|
||||||
|
(void) fprintf(stderr, gettext("invalid option "
|
||||||
|
"combination :-e and -C are mutually exclusive\n"));
|
||||||
|
usage(B_FALSE);
|
||||||
} else {
|
} else {
|
||||||
if (is_error_scrub)
|
if (is_error_scrub)
|
||||||
cb.cb_type = POOL_SCAN_ERRORSCRUB;
|
cb.cb_type = POOL_SCAN_ERRORSCRUB;
|
||||||
@ -8467,6 +8503,8 @@ zpool_do_scrub(int argc, char **argv)
|
|||||||
cb.cb_scrub_cmd = POOL_SCRUB_PAUSE;
|
cb.cb_scrub_cmd = POOL_SCRUB_PAUSE;
|
||||||
} else if (is_stop) {
|
} else if (is_stop) {
|
||||||
cb.cb_type = POOL_SCAN_NONE;
|
cb.cb_type = POOL_SCAN_NONE;
|
||||||
|
} else if (is_txg_continue) {
|
||||||
|
cb.cb_scrub_cmd = POOL_SCRUB_FROM_LAST_TXG;
|
||||||
} else {
|
} else {
|
||||||
cb.cb_scrub_cmd = POOL_SCRUB_NORMAL;
|
cb.cb_scrub_cmd = POOL_SCRUB_NORMAL;
|
||||||
}
|
}
|
||||||
@ -9224,6 +9262,12 @@ vdev_stats_nvlist(zpool_handle_t *zhp, status_cbdata_t *cb, nvlist_t *nv,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cb->cb_print_dio_verify) {
|
||||||
|
nice_num_str_nvlist(vds, "dio_verify_errors",
|
||||||
|
vs->vs_dio_verify_errors, cb->cb_literal,
|
||||||
|
cb->cb_json_as_int, ZFS_NICENUM_1024);
|
||||||
|
}
|
||||||
|
|
||||||
if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT,
|
if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT,
|
||||||
¬present) == 0) {
|
¬present) == 0) {
|
||||||
nice_num_str_nvlist(vds, ZPOOL_CONFIG_NOT_PRESENT,
|
nice_num_str_nvlist(vds, ZPOOL_CONFIG_NOT_PRESENT,
|
||||||
@ -10010,9 +10054,8 @@ print_removal_status(zpool_handle_t *zhp, pool_removal_stat_t *prs)
|
|||||||
(void) printf(gettext("Removal of %s canceled on %s"),
|
(void) printf(gettext("Removal of %s canceled on %s"),
|
||||||
vdev_name, ctime(&end));
|
vdev_name, ctime(&end));
|
||||||
} else {
|
} else {
|
||||||
uint64_t copied, total, elapsed, mins_left, hours_left;
|
uint64_t copied, total, elapsed, rate, mins_left, hours_left;
|
||||||
double fraction_done;
|
double fraction_done;
|
||||||
uint_t rate;
|
|
||||||
|
|
||||||
assert(prs->prs_state == DSS_SCANNING);
|
assert(prs->prs_state == DSS_SCANNING);
|
||||||
|
|
||||||
@ -10108,9 +10151,8 @@ print_raidz_expand_status(zpool_handle_t *zhp, pool_raidz_expand_stat_t *pres)
|
|||||||
copied_buf, time_buf, ctime((time_t *)&end));
|
copied_buf, time_buf, ctime((time_t *)&end));
|
||||||
} else {
|
} else {
|
||||||
char examined_buf[7], total_buf[7], rate_buf[7];
|
char examined_buf[7], total_buf[7], rate_buf[7];
|
||||||
uint64_t copied, total, elapsed, secs_left;
|
uint64_t copied, total, elapsed, rate, secs_left;
|
||||||
double fraction_done;
|
double fraction_done;
|
||||||
uint_t rate;
|
|
||||||
|
|
||||||
assert(pres->pres_state == DSS_SCANNING);
|
assert(pres->pres_state == DSS_SCANNING);
|
||||||
|
|
||||||
@ -10975,6 +11017,7 @@ zpool_do_status(int argc, char **argv)
|
|||||||
|
|
||||||
struct option long_options[] = {
|
struct option long_options[] = {
|
||||||
{"power", no_argument, NULL, ZPOOL_OPTION_POWER},
|
{"power", no_argument, NULL, ZPOOL_OPTION_POWER},
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
{"json-int", no_argument, NULL, ZPOOL_OPTION_JSON_NUMS_AS_INT},
|
{"json-int", no_argument, NULL, ZPOOL_OPTION_JSON_NUMS_AS_INT},
|
||||||
{"json-flat-vdevs", no_argument, NULL,
|
{"json-flat-vdevs", no_argument, NULL,
|
||||||
ZPOOL_OPTION_JSON_FLAT_VDEVS},
|
ZPOOL_OPTION_JSON_FLAT_VDEVS},
|
||||||
@ -12583,6 +12626,7 @@ zpool_do_get(int argc, char **argv)
|
|||||||
current_prop_type = cb.cb_type;
|
current_prop_type = cb.cb_type;
|
||||||
|
|
||||||
struct option long_options[] = {
|
struct option long_options[] = {
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
{"json-int", no_argument, NULL, ZPOOL_OPTION_JSON_NUMS_AS_INT},
|
{"json-int", no_argument, NULL, ZPOOL_OPTION_JSON_NUMS_AS_INT},
|
||||||
{"json-pool-key-guid", no_argument, NULL,
|
{"json-pool-key-guid", no_argument, NULL,
|
||||||
ZPOOL_OPTION_POOL_KEY_GUID},
|
ZPOOL_OPTION_POOL_KEY_GUID},
|
||||||
@ -13497,7 +13541,12 @@ zpool_do_version(int argc, char **argv)
|
|||||||
int c;
|
int c;
|
||||||
nvlist_t *jsobj = NULL, *zfs_ver = NULL;
|
nvlist_t *jsobj = NULL, *zfs_ver = NULL;
|
||||||
boolean_t json = B_FALSE;
|
boolean_t json = B_FALSE;
|
||||||
while ((c = getopt(argc, argv, "j")) != -1) {
|
|
||||||
|
struct option long_options[] = {
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
|
};
|
||||||
|
|
||||||
|
while ((c = getopt_long(argc, argv, "j", long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'j':
|
case 'j':
|
||||||
json = B_TRUE;
|
json = B_TRUE;
|
||||||
@ -13613,7 +13662,7 @@ main(int argc, char **argv)
|
|||||||
* Special case '-V|--version'
|
* Special case '-V|--version'
|
||||||
*/
|
*/
|
||||||
if ((strcmp(cmdname, "-V") == 0) || (strcmp(cmdname, "--version") == 0))
|
if ((strcmp(cmdname, "-V") == 0) || (strcmp(cmdname, "--version") == 0))
|
||||||
return (zpool_do_version(argc, argv));
|
return (zfs_version_print() != 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Special case 'help'
|
* Special case 'help'
|
||||||
|
19
cmd/ztest.c
19
cmd/ztest.c
@ -6717,6 +6717,17 @@ out:
|
|||||||
*
|
*
|
||||||
* Only after a full scrub has been completed is it safe to start injecting
|
* Only after a full scrub has been completed is it safe to start injecting
|
||||||
* data corruption. See the comment in zfs_fault_inject().
|
* data corruption. See the comment in zfs_fault_inject().
|
||||||
|
*
|
||||||
|
* EBUSY may be returned for the following six cases. It's the callers
|
||||||
|
* responsibility to handle them accordingly.
|
||||||
|
*
|
||||||
|
* Current state Requested
|
||||||
|
* 1. Normal Scrub Running Normal Scrub or Error Scrub
|
||||||
|
* 2. Normal Scrub Paused Error Scrub
|
||||||
|
* 3. Normal Scrub Paused Pause Normal Scrub
|
||||||
|
* 4. Error Scrub Running Normal Scrub or Error Scrub
|
||||||
|
* 5. Error Scrub Paused Pause Error Scrub
|
||||||
|
* 6. Resilvering Anything else
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ztest_scrub_impl(spa_t *spa)
|
ztest_scrub_impl(spa_t *spa)
|
||||||
@ -8082,8 +8093,14 @@ ztest_raidz_expand_check(spa_t *spa)
|
|||||||
(void) printf("verifying an interrupted raidz "
|
(void) printf("verifying an interrupted raidz "
|
||||||
"expansion using a pool scrub ...\n");
|
"expansion using a pool scrub ...\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Will fail here if there is non-recoverable corruption detected */
|
/* Will fail here if there is non-recoverable corruption detected */
|
||||||
VERIFY0(ztest_scrub_impl(spa));
|
int error = ztest_scrub_impl(spa);
|
||||||
|
if (error == EBUSY)
|
||||||
|
error = 0;
|
||||||
|
|
||||||
|
VERIFY0(error);
|
||||||
|
|
||||||
if (ztest_opts.zo_verbose >= 1) {
|
if (ztest_opts.zo_verbose >= 1) {
|
||||||
(void) printf("raidz expansion scrub check complete\n");
|
(void) printf("raidz expansion scrub check complete\n");
|
||||||
}
|
}
|
||||||
|
@ -58,9 +58,9 @@ deb-utils: deb-local rpm-utils-initramfs
|
|||||||
pkg1=$${name}-$${version}.$${arch}.rpm; \
|
pkg1=$${name}-$${version}.$${arch}.rpm; \
|
||||||
pkg2=libnvpair3-$${version}.$${arch}.rpm; \
|
pkg2=libnvpair3-$${version}.$${arch}.rpm; \
|
||||||
pkg3=libuutil3-$${version}.$${arch}.rpm; \
|
pkg3=libuutil3-$${version}.$${arch}.rpm; \
|
||||||
pkg4=libzfs5-$${version}.$${arch}.rpm; \
|
pkg4=libzfs6-$${version}.$${arch}.rpm; \
|
||||||
pkg5=libzpool5-$${version}.$${arch}.rpm; \
|
pkg5=libzpool6-$${version}.$${arch}.rpm; \
|
||||||
pkg6=libzfs5-devel-$${version}.$${arch}.rpm; \
|
pkg6=libzfs6-devel-$${version}.$${arch}.rpm; \
|
||||||
pkg7=$${name}-test-$${version}.$${arch}.rpm; \
|
pkg7=$${name}-test-$${version}.$${arch}.rpm; \
|
||||||
pkg8=$${name}-dracut-$${version}.noarch.rpm; \
|
pkg8=$${name}-dracut-$${version}.noarch.rpm; \
|
||||||
pkg9=$${name}-initramfs-$${version}.$${arch}.rpm; \
|
pkg9=$${name}-initramfs-$${version}.$${arch}.rpm; \
|
||||||
@ -72,7 +72,7 @@ deb-utils: deb-local rpm-utils-initramfs
|
|||||||
path_prepend=`mktemp -d /tmp/intercept.XXXXXX`; \
|
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 -xlibzfs5linux -xlibzpool5linux" \
|
-xlibuutil3linux -xlibnvpair3linux -xlibzfs6linux -xlibzpool6linux" \
|
||||||
>> $${path_prepend}/dh_shlibdeps; \
|
>> $${path_prepend}/dh_shlibdeps; \
|
||||||
## These -x arguments are passed to dpkg-shlibdeps, which exclude the
|
## These -x arguments are passed to dpkg-shlibdeps, which exclude the
|
||||||
## Debianized packages from the auto-generated dependencies of the new debs,
|
## Debianized packages from the auto-generated dependencies of the new debs,
|
||||||
@ -93,13 +93,17 @@ debian:
|
|||||||
cp -r contrib/debian debian; chmod +x debian/rules;
|
cp -r contrib/debian debian; chmod +x debian/rules;
|
||||||
|
|
||||||
native-deb-utils: native-deb-local debian
|
native-deb-utils: native-deb-local debian
|
||||||
|
while [ -f debian/deb-build.lock ]; do sleep 1; done; \
|
||||||
|
echo "native-deb-utils" > debian/deb-build.lock; \
|
||||||
cp contrib/debian/control debian/control; \
|
cp contrib/debian/control debian/control; \
|
||||||
$(DPKGBUILD) -b -rfakeroot -us -uc;
|
$(DPKGBUILD) -b -rfakeroot -us -uc; \
|
||||||
|
$(RM) -f debian/deb-build.lock
|
||||||
|
|
||||||
native-deb-kmod: native-deb-local debian
|
native-deb-kmod: native-deb-local debian
|
||||||
|
while [ -f debian/deb-build.lock ]; do sleep 1; done; \
|
||||||
|
echo "native-deb-kmod" > debian/deb-build.lock; \
|
||||||
sh scripts/make_gitrev.sh; \
|
sh scripts/make_gitrev.sh; \
|
||||||
fakeroot debian/rules override_dh_binary-modules;
|
fakeroot debian/rules override_dh_binary-modules; \
|
||||||
|
$(RM) -f debian/deb-build.lock
|
||||||
|
|
||||||
native-deb: native-deb-utils native-deb-kmod
|
native-deb: native-deb-utils native-deb-kmod
|
||||||
|
|
||||||
.NOTPARALLEL: native-deb native-deb-utils native-deb-kmod
|
|
||||||
|
@ -17,14 +17,21 @@ AC_DEFUN([ZFS_AC_KERNEL_KTHREAD_COMPLETE_AND_EXIT], [
|
|||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_KTHREAD_DEQUEUE_SIGNAL], [
|
AC_DEFUN([ZFS_AC_KERNEL_KTHREAD_DEQUEUE_SIGNAL], [
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 5.17 API: enum pid_type * as new 4th dequeue_signal() argument,
|
dnl # prehistory:
|
||||||
dnl # 5768d8906bc23d512b1a736c1e198aa833a6daa4 ("signal: Requeue signals in the appropriate queue")
|
dnl # int dequeue_signal(struct task_struct *task, sigset_t *mask,
|
||||||
|
dnl # siginfo_t *info)
|
||||||
dnl #
|
dnl #
|
||||||
dnl # int dequeue_signal(struct task_struct *task, sigset_t *mask, kernel_siginfo_t *info);
|
dnl # 4.20: kernel_siginfo_t introduced, replaces siginfo_t
|
||||||
dnl # int dequeue_signal(struct task_struct *task, sigset_t *mask, kernel_siginfo_t *info, enum pid_type *type);
|
dnl # int dequeue_signal(struct task_struct *task, sigset_t *mask,
|
||||||
|
dnl kernel_siginfo_t *info)
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 6.12 API: first arg struct_task* removed
|
dnl # 5.17: enum pid_type introduced as 4th arg
|
||||||
dnl # int dequeue_signal(sigset_t *mask, kernel_siginfo_t *info, enum pid_type *type);
|
dnl # int dequeue_signal(struct task_struct *task, sigset_t *mask,
|
||||||
|
dnl # kernel_siginfo_t *info, enum pid_type *type)
|
||||||
|
dnl #
|
||||||
|
dnl # 6.12: first arg struct_task* removed
|
||||||
|
dnl # int dequeue_signal(sigset_t *mask, kernel_siginfo_t *info,
|
||||||
|
dnl # enum pid_type *type)
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_CHECKING([whether dequeue_signal() takes 4 arguments])
|
AC_MSG_CHECKING([whether dequeue_signal() takes 4 arguments])
|
||||||
ZFS_LINUX_TEST_RESULT([kthread_dequeue_signal_4arg], [
|
ZFS_LINUX_TEST_RESULT([kthread_dequeue_signal_4arg], [
|
||||||
@ -33,11 +40,11 @@ AC_DEFUN([ZFS_AC_KERNEL_KTHREAD_DEQUEUE_SIGNAL], [
|
|||||||
[dequeue_signal() takes 4 arguments])
|
[dequeue_signal() takes 4 arguments])
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
AC_MSG_CHECKING([whether dequeue_signal() a task argument])
|
AC_MSG_CHECKING([whether 3-arg dequeue_signal() takes a type argument])
|
||||||
ZFS_LINUX_TEST_RESULT([kthread_dequeue_signal_3arg_task], [
|
ZFS_LINUX_TEST_RESULT([kthread_dequeue_signal_3arg_type], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_DEQUEUE_SIGNAL_3ARG_TASK, 1,
|
AC_DEFINE(HAVE_DEQUEUE_SIGNAL_3ARG_TYPE, 1,
|
||||||
[dequeue_signal() takes a task argument])
|
[3-arg dequeue_signal() takes a type argument])
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
@ -56,17 +63,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_KTHREAD_COMPLETE_AND_EXIT], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KTHREAD_DEQUEUE_SIGNAL], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_KTHREAD_DEQUEUE_SIGNAL], [
|
||||||
ZFS_LINUX_TEST_SRC([kthread_dequeue_signal_3arg_task], [
|
|
||||||
#include <linux/sched/signal.h>
|
|
||||||
], [
|
|
||||||
struct task_struct *task = NULL;
|
|
||||||
sigset_t *mask = NULL;
|
|
||||||
kernel_siginfo_t *info = NULL;
|
|
||||||
int error __attribute__ ((unused));
|
|
||||||
|
|
||||||
error = dequeue_signal(task, mask, info);
|
|
||||||
])
|
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([kthread_dequeue_signal_4arg], [
|
ZFS_LINUX_TEST_SRC([kthread_dequeue_signal_4arg], [
|
||||||
#include <linux/sched/signal.h>
|
#include <linux/sched/signal.h>
|
||||||
], [
|
], [
|
||||||
@ -78,6 +74,17 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_KTHREAD_DEQUEUE_SIGNAL], [
|
|||||||
|
|
||||||
error = dequeue_signal(task, mask, info, type);
|
error = dequeue_signal(task, mask, info, type);
|
||||||
])
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([kthread_dequeue_signal_3arg_type], [
|
||||||
|
#include <linux/sched/signal.h>
|
||||||
|
], [
|
||||||
|
sigset_t *mask = NULL;
|
||||||
|
kernel_siginfo_t *info = NULL;
|
||||||
|
enum pid_type *type = NULL;
|
||||||
|
int error __attribute__ ((unused));
|
||||||
|
|
||||||
|
error = dequeue_signal(mask, info, type);
|
||||||
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_KTHREAD], [
|
AC_DEFUN([ZFS_AC_KERNEL_KTHREAD], [
|
||||||
|
33
config/kernel-pin-user-pages.m4
Normal file
33
config/kernel-pin-user-pages.m4
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Check for pin_user_pages_unlocked().
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_PIN_USER_PAGES], [
|
||||||
|
ZFS_LINUX_TEST_SRC([pin_user_pages_unlocked], [
|
||||||
|
#include <linux/mm.h>
|
||||||
|
],[
|
||||||
|
unsigned long start = 0;
|
||||||
|
unsigned long nr_pages = 1;
|
||||||
|
struct page **pages = NULL;
|
||||||
|
unsigned int gup_flags = 0;
|
||||||
|
long ret __attribute__ ((unused));
|
||||||
|
|
||||||
|
ret = pin_user_pages_unlocked(start, nr_pages, pages,
|
||||||
|
gup_flags);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_PIN_USER_PAGES], [
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Kernal 5.8 introduced the pin_user_pages* interfaces which should
|
||||||
|
dnl # be used for Direct I/O requests.
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([whether pin_user_pages_unlocked() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([pin_user_pages_unlocked], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_PIN_USER_PAGES_UNLOCKED, 1,
|
||||||
|
[pin_user_pages_unlocked() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
@ -36,7 +36,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_SZ], [
|
|||||||
ZFS_LINUX_TEST_SRC([has_register_sysctl_sz], [
|
ZFS_LINUX_TEST_SRC([has_register_sysctl_sz], [
|
||||||
#include <linux/sysctl.h>
|
#include <linux/sysctl.h>
|
||||||
],[
|
],[
|
||||||
struct ctl_table test_table[] __attribute__((unused)) = {0};
|
struct ctl_table test_table[] __attribute__((unused)) = {{}};
|
||||||
register_sysctl_sz("", test_table, 0);
|
register_sysctl_sz("", test_table, 0);
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
@ -1,57 +0,0 @@
|
|||||||
dnl #
|
|
||||||
dnl # Check for Direct I/O interfaces.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_DIRECT_IO], [
|
|
||||||
ZFS_LINUX_TEST_SRC([direct_io_iter], [
|
|
||||||
#include <linux/fs.h>
|
|
||||||
|
|
||||||
static ssize_t test_direct_IO(struct kiocb *kiocb,
|
|
||||||
struct iov_iter *iter) { return 0; }
|
|
||||||
|
|
||||||
static const struct address_space_operations
|
|
||||||
aops __attribute__ ((unused)) = {
|
|
||||||
.direct_IO = test_direct_IO,
|
|
||||||
};
|
|
||||||
],[])
|
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([direct_io_iter_offset], [
|
|
||||||
#include <linux/fs.h>
|
|
||||||
|
|
||||||
static ssize_t test_direct_IO(struct kiocb *kiocb,
|
|
||||||
struct iov_iter *iter, loff_t offset) { return 0; }
|
|
||||||
|
|
||||||
static const struct address_space_operations
|
|
||||||
aops __attribute__ ((unused)) = {
|
|
||||||
.direct_IO = test_direct_IO,
|
|
||||||
};
|
|
||||||
],[])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_VFS_DIRECT_IO], [
|
|
||||||
dnl #
|
|
||||||
dnl # Linux 4.6.x API change
|
|
||||||
dnl #
|
|
||||||
AC_MSG_CHECKING([whether aops->direct_IO() uses iov_iter])
|
|
||||||
ZFS_LINUX_TEST_RESULT([direct_io_iter], [
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
AC_DEFINE(HAVE_VFS_DIRECT_IO_ITER, 1,
|
|
||||||
[aops->direct_IO() uses iov_iter without rw])
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
|
|
||||||
dnl #
|
|
||||||
dnl # Linux 4.1.x API change
|
|
||||||
dnl #
|
|
||||||
AC_MSG_CHECKING(
|
|
||||||
[whether aops->direct_IO() uses offset])
|
|
||||||
ZFS_LINUX_TEST_RESULT([direct_io_iter_offset], [
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
AC_DEFINE(HAVE_VFS_DIRECT_IO_ITER_OFFSET, 1,
|
|
||||||
[aops->direct_IO() uses iov_iter with offset])
|
|
||||||
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
ZFS_LINUX_TEST_ERROR([Direct I/O])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
])
|
|
@ -1,33 +0,0 @@
|
|||||||
dnl #
|
|
||||||
dnl # Linux 5.18 uses invalidate_folio in lieu of invalidate_page
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_INVALIDATE_FOLIO], [
|
|
||||||
ZFS_LINUX_TEST_SRC([vfs_has_invalidate_folio], [
|
|
||||||
#include <linux/fs.h>
|
|
||||||
|
|
||||||
static void
|
|
||||||
test_invalidate_folio(struct folio *folio, size_t offset,
|
|
||||||
size_t len) {
|
|
||||||
(void) folio; (void) offset; (void) len;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct address_space_operations
|
|
||||||
aops __attribute__ ((unused)) = {
|
|
||||||
.invalidate_folio = test_invalidate_folio,
|
|
||||||
};
|
|
||||||
],[])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_VFS_INVALIDATE_FOLIO], [
|
|
||||||
dnl #
|
|
||||||
dnl # Linux 5.18 uses invalidate_folio in lieu of invalidate_page
|
|
||||||
dnl #
|
|
||||||
AC_MSG_CHECKING([whether invalidate_folio exists])
|
|
||||||
ZFS_LINUX_TEST_RESULT([vfs_has_invalidate_folio], [
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
AC_DEFINE(HAVE_VFS_INVALIDATE_FOLIO, 1, [invalidate_folio exists])
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
])
|
|
||||||
])
|
|
@ -13,34 +13,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_IOV_ITER], [
|
|||||||
error = fault_in_iov_iter_readable(&iter, size);
|
error = fault_in_iov_iter_readable(&iter, size);
|
||||||
])
|
])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([iov_iter_get_pages2], [
|
|
||||||
#include <linux/uio.h>
|
|
||||||
], [
|
|
||||||
struct iov_iter iter = { 0 };
|
|
||||||
struct page **pages = NULL;
|
|
||||||
size_t maxsize = 4096;
|
|
||||||
unsigned maxpages = 1;
|
|
||||||
size_t start;
|
|
||||||
size_t ret __attribute__ ((unused));
|
|
||||||
|
|
||||||
ret = iov_iter_get_pages2(&iter, pages, maxsize, maxpages,
|
|
||||||
&start);
|
|
||||||
])
|
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([iov_iter_get_pages], [
|
|
||||||
#include <linux/uio.h>
|
|
||||||
], [
|
|
||||||
struct iov_iter iter = { 0 };
|
|
||||||
struct page **pages = NULL;
|
|
||||||
size_t maxsize = 4096;
|
|
||||||
unsigned maxpages = 1;
|
|
||||||
size_t start;
|
|
||||||
size_t ret __attribute__ ((unused));
|
|
||||||
|
|
||||||
ret = iov_iter_get_pages(&iter, pages, maxsize, maxpages,
|
|
||||||
&start);
|
|
||||||
])
|
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([iov_iter_type], [
|
ZFS_LINUX_TEST_SRC([iov_iter_type], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/uio.h>
|
#include <linux/uio.h>
|
||||||
@ -49,6 +21,15 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_IOV_ITER], [
|
|||||||
__attribute__((unused)) enum iter_type i = iov_iter_type(&iter);
|
__attribute__((unused)) enum iter_type i = iov_iter_type(&iter);
|
||||||
])
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([iter_is_ubuf], [
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
struct iov_iter iter = { 0 };
|
||||||
|
bool ret __attribute__((unused));
|
||||||
|
|
||||||
|
ret = iter_is_ubuf(&iter);
|
||||||
|
])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([iter_iov], [
|
ZFS_LINUX_TEST_SRC([iter_iov], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/uio.h>
|
#include <linux/uio.h>
|
||||||
@ -59,7 +40,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_IOV_ITER], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_VFS_IOV_ITER], [
|
AC_DEFUN([ZFS_AC_KERNEL_VFS_IOV_ITER], [
|
||||||
enable_vfs_iov_iter="yes"
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether fault_in_iov_iter_readable() is available])
|
AC_MSG_CHECKING([whether fault_in_iov_iter_readable() is available])
|
||||||
ZFS_LINUX_TEST_RESULT([fault_in_iov_iter_readable], [
|
ZFS_LINUX_TEST_RESULT([fault_in_iov_iter_readable], [
|
||||||
@ -70,27 +50,6 @@ AC_DEFUN([ZFS_AC_KERNEL_VFS_IOV_ITER], [
|
|||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl #
|
|
||||||
dnl # Kernel 6.0 changed iov_iter_get_pages() to iov_iter_page_pages2().
|
|
||||||
dnl #
|
|
||||||
AC_MSG_CHECKING([whether iov_iter_get_pages2() is available])
|
|
||||||
ZFS_LINUX_TEST_RESULT([iov_iter_get_pages2], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_IOV_ITER_GET_PAGES2, 1,
|
|
||||||
[iov_iter_get_pages2() is available])
|
|
||||||
], [
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
AC_MSG_CHECKING([whether iov_iter_get_pages() is available])
|
|
||||||
ZFS_LINUX_TEST_RESULT([iov_iter_get_pages], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_IOV_ITER_GET_PAGES, 1,
|
|
||||||
[iov_iter_get_pages() is available])
|
|
||||||
], [
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
enable_vfs_iov_iter="no"
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # This checks for iov_iter_type() in linux/uio.h. It is not
|
dnl # This checks for iov_iter_type() in linux/uio.h. It is not
|
||||||
dnl # required, however, and the module will compiled without it
|
dnl # required, however, and the module will compiled without it
|
||||||
@ -106,14 +65,15 @@ AC_DEFUN([ZFS_AC_KERNEL_VFS_IOV_ITER], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # As of the 4.9 kernel support is provided for iovecs, kvecs,
|
dnl # Kernel 6.0 introduced the ITER_UBUF iov_iter type. iter_is_ubuf()
|
||||||
dnl # bvecs and pipes in the iov_iter structure. As long as the
|
dnl # was also added to determine if the iov_iter is an ITER_UBUF.
|
||||||
dnl # other support interfaces are all available the iov_iter can
|
|
||||||
dnl # be correctly used in the uio structure.
|
|
||||||
dnl #
|
dnl #
|
||||||
AS_IF([test "x$enable_vfs_iov_iter" = "xyes"], [
|
AC_MSG_CHECKING([whether iter_is_ubuf() is available])
|
||||||
AC_DEFINE(HAVE_VFS_IOV_ITER, 1,
|
ZFS_LINUX_TEST_RESULT([iter_is_ubuf], [
|
||||||
[All required iov_iter interfaces are available])
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_ITER_IS_UBUF, 1, [iter_is_ubuf() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
|
27
config/kernel-vfs-migrate_folio.m4
Normal file
27
config/kernel-vfs-migrate_folio.m4
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Linux 6.0 uses migrate_folio in lieu of migrate_page
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_MIGRATE_FOLIO], [
|
||||||
|
ZFS_LINUX_TEST_SRC([vfs_has_migrate_folio], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/migrate.h>
|
||||||
|
|
||||||
|
static const struct address_space_operations
|
||||||
|
aops __attribute__ ((unused)) = {
|
||||||
|
.migrate_folio = migrate_folio,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_VFS_MIGRATE_FOLIO], [
|
||||||
|
dnl #
|
||||||
|
dnl # Linux 6.0 uses migrate_folio in lieu of migrate_page
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([whether migrate_folio exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([vfs_has_migrate_folio], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE(HAVE_VFS_MIGRATE_FOLIO, 1, [migrate_folio exists])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
|
])
|
@ -1,32 +0,0 @@
|
|||||||
dnl #
|
|
||||||
dnl # Linux 5.19 uses release_folio in lieu of releasepage
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_RELEASE_FOLIO], [
|
|
||||||
ZFS_LINUX_TEST_SRC([vfs_has_release_folio], [
|
|
||||||
#include <linux/fs.h>
|
|
||||||
|
|
||||||
static bool
|
|
||||||
test_release_folio(struct folio *folio, gfp_t gfp) {
|
|
||||||
(void) folio; (void) gfp;
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct address_space_operations
|
|
||||||
aops __attribute__ ((unused)) = {
|
|
||||||
.release_folio = test_release_folio,
|
|
||||||
};
|
|
||||||
],[])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_VFS_RELEASE_FOLIO], [
|
|
||||||
dnl #
|
|
||||||
dnl # Linux 5.19 uses release_folio in lieu of releasepage
|
|
||||||
dnl #
|
|
||||||
AC_MSG_CHECKING([whether release_folio exists])
|
|
||||||
ZFS_LINUX_TEST_RESULT([vfs_has_release_folio], [
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
AC_DEFINE(HAVE_VFS_RELEASE_FOLIO, 1, [release_folio exists])
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
])
|
|
||||||
])
|
|
@ -54,7 +54,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_GET_DENTRY_INODE_FLAGS], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET_DENTRY_INODE_FLAGS], [
|
AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET_DENTRY_INODE_FLAGS], [
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
AC_MSG_CHECKING(
|
AC_MSG_CHECKING(
|
||||||
[whether xattr_handler->get() wants dentry and inode and flags])
|
[whether xattr_handler->get() wants dentry and inode and flags])
|
||||||
ZFS_LINUX_TEST_RESULT([xattr_handler_get_dentry_inode_flags], [
|
ZFS_LINUX_TEST_RESULT([xattr_handler_get_dentry_inode_flags], [
|
||||||
|
@ -77,10 +77,8 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_SGET
|
ZFS_AC_KERNEL_SRC_SGET
|
||||||
ZFS_AC_KERNEL_SRC_VFS_FILEMAP_DIRTY_FOLIO
|
ZFS_AC_KERNEL_SRC_VFS_FILEMAP_DIRTY_FOLIO
|
||||||
ZFS_AC_KERNEL_SRC_VFS_READ_FOLIO
|
ZFS_AC_KERNEL_SRC_VFS_READ_FOLIO
|
||||||
ZFS_AC_KERNEL_SRC_VFS_RELEASE_FOLIO
|
ZFS_AC_KERNEL_SRC_VFS_MIGRATE_FOLIO
|
||||||
ZFS_AC_KERNEL_SRC_VFS_INVALIDATE_FOLIO
|
|
||||||
ZFS_AC_KERNEL_SRC_VFS_FSYNC_2ARGS
|
ZFS_AC_KERNEL_SRC_VFS_FSYNC_2ARGS
|
||||||
ZFS_AC_KERNEL_SRC_VFS_DIRECT_IO
|
|
||||||
ZFS_AC_KERNEL_SRC_VFS_READPAGES
|
ZFS_AC_KERNEL_SRC_VFS_READPAGES
|
||||||
ZFS_AC_KERNEL_SRC_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
ZFS_AC_KERNEL_SRC_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
||||||
ZFS_AC_KERNEL_SRC_VFS_IOV_ITER
|
ZFS_AC_KERNEL_SRC_VFS_IOV_ITER
|
||||||
@ -129,6 +127,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_MM_PAGE_SIZE
|
ZFS_AC_KERNEL_SRC_MM_PAGE_SIZE
|
||||||
ZFS_AC_KERNEL_SRC_MM_PAGE_MAPPING
|
ZFS_AC_KERNEL_SRC_MM_PAGE_MAPPING
|
||||||
ZFS_AC_KERNEL_SRC_FILE
|
ZFS_AC_KERNEL_SRC_FILE
|
||||||
|
ZFS_AC_KERNEL_SRC_PIN_USER_PAGES
|
||||||
case "$host_cpu" in
|
case "$host_cpu" in
|
||||||
powerpc*)
|
powerpc*)
|
||||||
ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE
|
ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE
|
||||||
@ -189,10 +188,8 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_SGET
|
ZFS_AC_KERNEL_SGET
|
||||||
ZFS_AC_KERNEL_VFS_FILEMAP_DIRTY_FOLIO
|
ZFS_AC_KERNEL_VFS_FILEMAP_DIRTY_FOLIO
|
||||||
ZFS_AC_KERNEL_VFS_READ_FOLIO
|
ZFS_AC_KERNEL_VFS_READ_FOLIO
|
||||||
ZFS_AC_KERNEL_VFS_RELEASE_FOLIO
|
ZFS_AC_KERNEL_VFS_MIGRATE_FOLIO
|
||||||
ZFS_AC_KERNEL_VFS_INVALIDATE_FOLIO
|
|
||||||
ZFS_AC_KERNEL_VFS_FSYNC_2ARGS
|
ZFS_AC_KERNEL_VFS_FSYNC_2ARGS
|
||||||
ZFS_AC_KERNEL_VFS_DIRECT_IO
|
|
||||||
ZFS_AC_KERNEL_VFS_READPAGES
|
ZFS_AC_KERNEL_VFS_READPAGES
|
||||||
ZFS_AC_KERNEL_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
ZFS_AC_KERNEL_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
||||||
ZFS_AC_KERNEL_VFS_IOV_ITER
|
ZFS_AC_KERNEL_VFS_IOV_ITER
|
||||||
@ -242,6 +239,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_MM_PAGE_MAPPING
|
ZFS_AC_KERNEL_MM_PAGE_MAPPING
|
||||||
ZFS_AC_KERNEL_1ARG_ASSIGN_STR
|
ZFS_AC_KERNEL_1ARG_ASSIGN_STR
|
||||||
ZFS_AC_KERNEL_FILE
|
ZFS_AC_KERNEL_FILE
|
||||||
|
ZFS_AC_KERNEL_PIN_USER_PAGES
|
||||||
case "$host_cpu" in
|
case "$host_cpu" in
|
||||||
powerpc*)
|
powerpc*)
|
||||||
ZFS_AC_KERNEL_CPU_HAS_FEATURE
|
ZFS_AC_KERNEL_CPU_HAS_FEATURE
|
||||||
@ -683,11 +681,16 @@ AC_DEFUN([ZFS_LINUX_COMPILE], [
|
|||||||
building kernel modules])
|
building kernel modules])
|
||||||
AC_ARG_VAR([KERNEL_LLVM], [Binary option to
|
AC_ARG_VAR([KERNEL_LLVM], [Binary option to
|
||||||
build kernel modules with LLVM/CLANG toolchain])
|
build kernel modules with LLVM/CLANG toolchain])
|
||||||
|
AC_ARG_VAR([KERNEL_CROSS_COMPILE], [Cross compile prefix
|
||||||
|
for kernel module builds])
|
||||||
|
AC_ARG_VAR([KERNEL_ARCH], [Architecture to build kernel modules for])
|
||||||
AC_TRY_COMMAND([
|
AC_TRY_COMMAND([
|
||||||
KBUILD_MODPOST_NOFINAL="$5" KBUILD_MODPOST_WARN="$6"
|
KBUILD_MODPOST_NOFINAL="$5" KBUILD_MODPOST_WARN="$6"
|
||||||
make modules -k -j$TEST_JOBS ${KERNEL_CC:+CC=$KERNEL_CC}
|
make modules -k -j$TEST_JOBS ${KERNEL_CC:+CC=$KERNEL_CC}
|
||||||
${KERNEL_LD:+LD=$KERNEL_LD} ${KERNEL_LLVM:+LLVM=$KERNEL_LLVM}
|
${KERNEL_LD:+LD=$KERNEL_LD} ${KERNEL_LLVM:+LLVM=$KERNEL_LLVM}
|
||||||
CONFIG_MODULES=y CFLAGS_MODULE=-DCONFIG_MODULES
|
CONFIG_MODULES=y CFLAGS_MODULE=-DCONFIG_MODULES
|
||||||
|
${KERNEL_CROSS_COMPILE:+CROSS_COMPILE=$KERNEL_CROSS_COMPILE}
|
||||||
|
${KERNEL_ARCH:+ARCH=$KERNEL_ARCH}
|
||||||
-C $LINUX_OBJ $ARCH_UM M=$PWD/$1 >$1/build.log 2>&1])
|
-C $LINUX_OBJ $ARCH_UM M=$PWD/$1 >$1/build.log 2>&1])
|
||||||
AS_IF([AC_TRY_COMMAND([$2])], [$3], [$4])
|
AS_IF([AC_TRY_COMMAND([$2])], [$3], [$4])
|
||||||
])
|
])
|
||||||
|
@ -393,6 +393,8 @@ AC_DEFUN([ZFS_AC_RPM], [
|
|||||||
RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernel_cc KERNEL_CC=$(KERNEL_CC)"'
|
RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernel_cc KERNEL_CC=$(KERNEL_CC)"'
|
||||||
RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernel_ld KERNEL_LD=$(KERNEL_LD)"'
|
RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernel_ld KERNEL_LD=$(KERNEL_LD)"'
|
||||||
RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernel_llvm KERNEL_LLVM=$(KERNEL_LLVM)"'
|
RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernel_llvm KERNEL_LLVM=$(KERNEL_LLVM)"'
|
||||||
|
RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernel_cross_compile KERNEL_CROSS_COMPILE=$(KERNEL_CROSS_COMPILE)"'
|
||||||
|
RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernel_arch KERNEL_ARCH=$(KERNEL_ARCH)"'
|
||||||
])
|
])
|
||||||
|
|
||||||
RPM_DEFINE_DKMS=''
|
RPM_DEFINE_DKMS=''
|
||||||
@ -627,7 +629,7 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
|
|||||||
|
|
||||||
AC_MSG_CHECKING([default bash completion directory])
|
AC_MSG_CHECKING([default bash completion directory])
|
||||||
case "$VENDOR" in
|
case "$VENDOR" in
|
||||||
alpine|artix|debian|gentoo|ubuntu)
|
alpine|arch|artix|debian|gentoo|ubuntu)
|
||||||
bashcompletiondir=/usr/share/bash-completion/completions
|
bashcompletiondir=/usr/share/bash-completion/completions
|
||||||
;;
|
;;
|
||||||
freebsd)
|
freebsd)
|
||||||
|
@ -12,14 +12,14 @@ dist_noinst_DATA += %D%/openzfs-libpam-zfs.postinst
|
|||||||
dist_noinst_DATA += %D%/openzfs-libpam-zfs.prerm
|
dist_noinst_DATA += %D%/openzfs-libpam-zfs.prerm
|
||||||
dist_noinst_DATA += %D%/openzfs-libuutil3.docs
|
dist_noinst_DATA += %D%/openzfs-libuutil3.docs
|
||||||
dist_noinst_DATA += %D%/openzfs-libuutil3.install.in
|
dist_noinst_DATA += %D%/openzfs-libuutil3.install.in
|
||||||
dist_noinst_DATA += %D%/openzfs-libzfs4.docs
|
dist_noinst_DATA += %D%/openzfs-libzfs6.docs
|
||||||
dist_noinst_DATA += %D%/openzfs-libzfs4.install.in
|
dist_noinst_DATA += %D%/openzfs-libzfs6.install.in
|
||||||
dist_noinst_DATA += %D%/openzfs-libzfsbootenv1.docs
|
dist_noinst_DATA += %D%/openzfs-libzfsbootenv1.docs
|
||||||
dist_noinst_DATA += %D%/openzfs-libzfsbootenv1.install.in
|
dist_noinst_DATA += %D%/openzfs-libzfsbootenv1.install.in
|
||||||
dist_noinst_DATA += %D%/openzfs-libzfs-dev.docs
|
dist_noinst_DATA += %D%/openzfs-libzfs-dev.docs
|
||||||
dist_noinst_DATA += %D%/openzfs-libzfs-dev.install.in
|
dist_noinst_DATA += %D%/openzfs-libzfs-dev.install.in
|
||||||
dist_noinst_DATA += %D%/openzfs-libzpool5.docs
|
dist_noinst_DATA += %D%/openzfs-libzpool6.docs
|
||||||
dist_noinst_DATA += %D%/openzfs-libzpool5.install.in
|
dist_noinst_DATA += %D%/openzfs-libzpool6.install.in
|
||||||
dist_noinst_DATA += %D%/openzfs-python3-pyzfs.install
|
dist_noinst_DATA += %D%/openzfs-python3-pyzfs.install
|
||||||
dist_noinst_DATA += %D%/openzfs-zfs-dkms.config
|
dist_noinst_DATA += %D%/openzfs-zfs-dkms.config
|
||||||
dist_noinst_DATA += %D%/openzfs-zfs-dkms.dkms
|
dist_noinst_DATA += %D%/openzfs-zfs-dkms.dkms
|
||||||
|
@ -6,6 +6,6 @@ contrib/pyzfs/libzfs_core/bindings/__pycache__/
|
|||||||
contrib/pyzfs/pyzfs.egg-info/
|
contrib/pyzfs/pyzfs.egg-info/
|
||||||
debian/openzfs-libnvpair3.install
|
debian/openzfs-libnvpair3.install
|
||||||
debian/openzfs-libuutil3.install
|
debian/openzfs-libuutil3.install
|
||||||
debian/openzfs-libzfs4.install
|
debian/openzfs-libzfs6.install
|
||||||
debian/openzfs-libzfs-dev.install
|
debian/openzfs-libzfs-dev.install
|
||||||
debian/openzfs-libzpool5.install
|
debian/openzfs-libzpool6.install
|
||||||
|
@ -78,9 +78,9 @@ Architecture: linux-any
|
|||||||
Depends: libssl-dev | libssl1.0-dev,
|
Depends: libssl-dev | libssl1.0-dev,
|
||||||
openzfs-libnvpair3 (= ${binary:Version}),
|
openzfs-libnvpair3 (= ${binary:Version}),
|
||||||
openzfs-libuutil3 (= ${binary:Version}),
|
openzfs-libuutil3 (= ${binary:Version}),
|
||||||
openzfs-libzfs4 (= ${binary:Version}),
|
openzfs-libzfs6 (= ${binary:Version}),
|
||||||
openzfs-libzfsbootenv1 (= ${binary:Version}),
|
openzfs-libzfsbootenv1 (= ${binary:Version}),
|
||||||
openzfs-libzpool5 (= ${binary:Version}),
|
openzfs-libzpool6 (= ${binary:Version}),
|
||||||
${misc:Depends}
|
${misc:Depends}
|
||||||
Replaces: libzfslinux-dev
|
Replaces: libzfslinux-dev
|
||||||
Conflicts: libzfslinux-dev
|
Conflicts: libzfslinux-dev
|
||||||
@ -90,18 +90,18 @@ Description: OpenZFS filesystem development files for Linux
|
|||||||
libraries of OpenZFS filesystem.
|
libraries of OpenZFS filesystem.
|
||||||
.
|
.
|
||||||
This package includes the development files of libnvpair3, libuutil3,
|
This package includes the development files of libnvpair3, libuutil3,
|
||||||
libzpool5 and libzfs4.
|
libzpool6 and libzfs6.
|
||||||
|
|
||||||
Package: openzfs-libzfs4
|
Package: openzfs-libzfs6
|
||||||
Section: contrib/libs
|
Section: contrib/libs
|
||||||
Architecture: linux-any
|
Architecture: linux-any
|
||||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||||
# The libcurl4 is loaded through dlopen("libcurl.so.4").
|
# The libcurl4 is loaded through dlopen("libcurl.so.4").
|
||||||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=988521
|
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=988521
|
||||||
Recommends: libcurl4
|
Recommends: libcurl4
|
||||||
Breaks: libzfs2, libzfs4
|
Breaks: libzfs2, libzfs4, libzfs4linux, libzfs6linux
|
||||||
Replaces: libzfs2, libzfs4, libzfs4linux
|
Replaces: libzfs2, libzfs4, libzfs4linux, libzfs6linux
|
||||||
Conflicts: libzfs4linux
|
Conflicts: libzfs6linux
|
||||||
Description: OpenZFS filesystem library for Linux - general support
|
Description: OpenZFS filesystem library for Linux - general support
|
||||||
OpenZFS is a storage platform that encompasses the functionality of
|
OpenZFS is a storage platform that encompasses the functionality of
|
||||||
traditional filesystems and volume managers. It supports data checksums,
|
traditional filesystems and volume managers. It supports data checksums,
|
||||||
@ -123,13 +123,13 @@ Description: OpenZFS filesystem library for Linux - label info support
|
|||||||
.
|
.
|
||||||
The zfsbootenv library provides support for modifying ZFS label information.
|
The zfsbootenv library provides support for modifying ZFS label information.
|
||||||
|
|
||||||
Package: openzfs-libzpool5
|
Package: openzfs-libzpool6
|
||||||
Section: contrib/libs
|
Section: contrib/libs
|
||||||
Architecture: linux-any
|
Architecture: linux-any
|
||||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||||
Breaks: libzpool2, libzpool5
|
Breaks: libzpool2, libzpool5, libzpool5linux, libzpool6linux
|
||||||
Replaces: libzpool2, libzpool5, libzpool5linux
|
Replaces: libzpool2, libzpool5, libzpool5linux, libzpool6linux
|
||||||
Conflicts: libzpool5linux
|
Conflicts: libzpool6linux
|
||||||
Description: OpenZFS pool library for Linux
|
Description: OpenZFS pool library for Linux
|
||||||
OpenZFS is a storage platform that encompasses the functionality of
|
OpenZFS is a storage platform that encompasses the functionality of
|
||||||
traditional filesystems and volume managers. It supports data checksums,
|
traditional filesystems and volume managers. It supports data checksums,
|
||||||
@ -246,8 +246,8 @@ Architecture: linux-any
|
|||||||
Pre-Depends: ${misc:Pre-Depends}
|
Pre-Depends: ${misc:Pre-Depends}
|
||||||
Depends: openzfs-libnvpair3 (= ${binary:Version}),
|
Depends: openzfs-libnvpair3 (= ${binary:Version}),
|
||||||
openzfs-libuutil3 (= ${binary:Version}),
|
openzfs-libuutil3 (= ${binary:Version}),
|
||||||
openzfs-libzfs4 (= ${binary:Version}),
|
openzfs-libzfs6 (= ${binary:Version}),
|
||||||
openzfs-libzpool5 (= ${binary:Version}),
|
openzfs-libzpool6 (= ${binary:Version}),
|
||||||
python3,
|
python3,
|
||||||
${misc:Depends},
|
${misc:Depends},
|
||||||
${shlibs:Depends}
|
${shlibs:Depends}
|
||||||
|
@ -98,6 +98,7 @@ usr/share/man/man8/zpool-attach.8
|
|||||||
usr/share/man/man8/zpool-checkpoint.8
|
usr/share/man/man8/zpool-checkpoint.8
|
||||||
usr/share/man/man8/zpool-clear.8
|
usr/share/man/man8/zpool-clear.8
|
||||||
usr/share/man/man8/zpool-create.8
|
usr/share/man/man8/zpool-create.8
|
||||||
|
usr/share/man/man8/zpool-ddtprune.8
|
||||||
usr/share/man/man8/zpool-destroy.8
|
usr/share/man/man8/zpool-destroy.8
|
||||||
usr/share/man/man8/zpool-detach.8
|
usr/share/man/man8/zpool-detach.8
|
||||||
usr/share/man/man8/zpool-ddtprune.8
|
usr/share/man/man8/zpool-ddtprune.8
|
||||||
@ -113,6 +114,7 @@ usr/share/man/man8/zpool-list.8
|
|||||||
usr/share/man/man8/zpool-offline.8
|
usr/share/man/man8/zpool-offline.8
|
||||||
usr/share/man/man8/zpool-online.8
|
usr/share/man/man8/zpool-online.8
|
||||||
usr/share/man/man8/zpool-prefetch.8
|
usr/share/man/man8/zpool-prefetch.8
|
||||||
|
usr/share/man/man8/zpool-prefetch.8
|
||||||
usr/share/man/man8/zpool-reguid.8
|
usr/share/man/man8/zpool-reguid.8
|
||||||
usr/share/man/man8/zpool-remove.8
|
usr/share/man/man8/zpool-remove.8
|
||||||
usr/share/man/man8/zpool-reopen.8
|
usr/share/man/man8/zpool-reopen.8
|
||||||
|
@ -344,7 +344,7 @@ mount_fs()
|
|||||||
|
|
||||||
# Need the _original_ datasets mountpoint!
|
# Need the _original_ datasets mountpoint!
|
||||||
mountpoint=$(get_fs_value "$fs" mountpoint)
|
mountpoint=$(get_fs_value "$fs" mountpoint)
|
||||||
ZFS_CMD="mount -o zfsutil -t zfs"
|
ZFS_CMD="mount.zfs -o zfsutil"
|
||||||
if [ "$mountpoint" = "legacy" ] || [ "$mountpoint" = "none" ]; then
|
if [ "$mountpoint" = "legacy" ] || [ "$mountpoint" = "none" ]; then
|
||||||
# Can't use the mountpoint property. Might be one of our
|
# Can't use the mountpoint property. Might be one of our
|
||||||
# clones. Check the 'org.zol:mountpoint' property set in
|
# clones. Check the 'org.zol:mountpoint' property set in
|
||||||
@ -359,9 +359,8 @@ mount_fs()
|
|||||||
# isn't the root fs.
|
# isn't the root fs.
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
# Don't use mount.zfs -o zfsutils for legacy mountpoint
|
|
||||||
if [ "$mountpoint" = "legacy" ]; then
|
if [ "$mountpoint" = "legacy" ]; then
|
||||||
ZFS_CMD="mount -t zfs"
|
ZFS_CMD="mount.zfs"
|
||||||
fi
|
fi
|
||||||
# Last hail-mary: Hope 'rootmnt' is set!
|
# Last hail-mary: Hope 'rootmnt' is set!
|
||||||
mountpoint=""
|
mountpoint=""
|
||||||
|
@ -8,6 +8,13 @@ After=systemd-remount-fs.service
|
|||||||
Before=local-fs.target
|
Before=local-fs.target
|
||||||
ConditionPathIsDirectory=/sys/module/zfs
|
ConditionPathIsDirectory=/sys/module/zfs
|
||||||
|
|
||||||
|
# This merely tells the service manager
|
||||||
|
# that unmounting everything undoes the
|
||||||
|
# effect of this service. No extra logic
|
||||||
|
# is ran as a result of these settings.
|
||||||
|
Conflicts=umount.target
|
||||||
|
Before=umount.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#define _LIBZUTIL_H extern __attribute__((visibility("default")))
|
#define _LIBZUTIL_H extern __attribute__((visibility("default")))
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <locale.h>
|
#include <pthread.h>
|
||||||
#include <sys/nvpair.h>
|
#include <sys/nvpair.h>
|
||||||
#include <sys/fs/zfs.h>
|
#include <sys/fs/zfs.h>
|
||||||
|
|
||||||
@ -276,7 +276,14 @@ _LIBZUTIL_H void update_vdev_config_dev_sysfs_path(nvlist_t *nv,
|
|||||||
* Thread-safe strerror() for use in ZFS libraries
|
* Thread-safe strerror() for use in ZFS libraries
|
||||||
*/
|
*/
|
||||||
static inline char *zfs_strerror(int errnum) {
|
static inline char *zfs_strerror(int errnum) {
|
||||||
return (strerror_l(errnum, uselocale(0)));
|
static __thread char errbuf[512];
|
||||||
|
static pthread_mutex_t zfs_strerror_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
|
(void) pthread_mutex_lock(&zfs_strerror_lock);
|
||||||
|
(void) strlcpy(errbuf, strerror(errnum), sizeof (errbuf));
|
||||||
|
(void) pthread_mutex_unlock(&zfs_strerror_lock);
|
||||||
|
|
||||||
|
return (errbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2010 Isilon Systems, Inc.
|
* Copyright (c) 2024 Warner Losh.
|
||||||
* Copyright (c) 2010 iXsystems, Inc.
|
|
||||||
* Copyright (c) 2010 Panasas, Inc.
|
|
||||||
* Copyright (c) 2013-2016 Mellanox Technologies, Ltd.
|
|
||||||
* Copyright (c) 2015 François Tigeot
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@ -26,76 +21,14 @@
|
|||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
#ifndef _LINUX_COMPILER_H_
|
|
||||||
#define _LINUX_COMPILER_H_
|
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
/*
|
||||||
|
* FreeBSD's LinuxKPI compiler.h as far back as FreeBSD 12 has what we need,
|
||||||
|
* except zfs_fallthrough.
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <compat/linuxkpi/common/include/linux/compiler.h>
|
||||||
|
|
||||||
#define __user
|
|
||||||
#define __kernel
|
|
||||||
#define __safe
|
|
||||||
#define __force
|
|
||||||
#define __nocast
|
|
||||||
#define __iomem
|
|
||||||
#define __chk_user_ptr(x) ((void)0)
|
|
||||||
#define __chk_io_ptr(x) ((void)0)
|
|
||||||
#define __builtin_warning(x, y...) (1)
|
|
||||||
#define __acquires(x)
|
|
||||||
#define __releases(x)
|
|
||||||
#define __acquire(x) do { } while (0)
|
|
||||||
#define __release(x) do { } while (0)
|
|
||||||
#define __cond_lock(x, c) (c)
|
|
||||||
#define __bitwise
|
|
||||||
#define __devinitdata
|
|
||||||
#define __deprecated
|
|
||||||
#define __init
|
|
||||||
#define __initconst
|
|
||||||
#define __devinit
|
|
||||||
#define __devexit
|
|
||||||
#define __exit
|
|
||||||
#define __rcu
|
|
||||||
#define __percpu
|
|
||||||
#define __weak __weak_symbol
|
|
||||||
#define __malloc
|
|
||||||
#define ___stringify(...) #__VA_ARGS__
|
|
||||||
#define __stringify(...) ___stringify(__VA_ARGS__)
|
|
||||||
#define __attribute_const__ __attribute__((__const__))
|
|
||||||
#undef __always_inline
|
|
||||||
#define __always_inline inline
|
|
||||||
#define noinline __noinline
|
|
||||||
#define ____cacheline_aligned __aligned(CACHE_LINE_SIZE)
|
|
||||||
#define zfs_fallthrough __attribute__((__fallthrough__))
|
#define zfs_fallthrough __attribute__((__fallthrough__))
|
||||||
|
|
||||||
#if !defined(_KERNEL) && !defined(_STANDALONE)
|
|
||||||
#define likely(x) __builtin_expect(!!(x), 1)
|
|
||||||
#define unlikely(x) __builtin_expect(!!(x), 0)
|
|
||||||
#endif
|
|
||||||
#define typeof(x) __typeof(x)
|
|
||||||
|
|
||||||
#define uninitialized_var(x) x = x
|
|
||||||
#define __maybe_unused __unused
|
|
||||||
#define __always_unused __unused
|
|
||||||
#define __must_check __result_use_check
|
|
||||||
|
|
||||||
#define __printf(a, b) __printflike(a, b)
|
|
||||||
|
|
||||||
#define barrier() __asm__ __volatile__("": : :"memory")
|
|
||||||
#define ___PASTE(a, b) a##b
|
|
||||||
#define __PASTE(a, b) ___PASTE(a, b)
|
|
||||||
|
|
||||||
#define ACCESS_ONCE(x) (*(volatile __typeof(x) *)&(x))
|
|
||||||
|
|
||||||
#define WRITE_ONCE(x, v) do { \
|
|
||||||
barrier(); \
|
|
||||||
ACCESS_ONCE(x) = (v); \
|
|
||||||
barrier(); \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#define lockless_dereference(p) READ_ONCE(p)
|
|
||||||
|
|
||||||
#define _AT(T, X) ((T)(X))
|
|
||||||
|
|
||||||
#endif /* _LINUX_COMPILER_H_ */
|
|
||||||
|
@ -70,15 +70,6 @@ hlist_del(struct hlist_node *n)
|
|||||||
n->next->pprev = n->pprev;
|
n->next->pprev = n->pprev;
|
||||||
}
|
}
|
||||||
/* BEGIN CSTYLED */
|
/* BEGIN CSTYLED */
|
||||||
#define READ_ONCE(x) ({ \
|
|
||||||
__typeof(x) __var = ({ \
|
|
||||||
barrier(); \
|
|
||||||
ACCESS_ONCE(x); \
|
|
||||||
}); \
|
|
||||||
barrier(); \
|
|
||||||
__var; \
|
|
||||||
})
|
|
||||||
|
|
||||||
#define HLIST_HEAD_INIT { }
|
#define HLIST_HEAD_INIT { }
|
||||||
#define HLIST_HEAD(name) struct hlist_head name = HLIST_HEAD_INIT
|
#define HLIST_HEAD(name) struct hlist_head name = HLIST_HEAD_INIT
|
||||||
#define INIT_HLIST_HEAD(head) (head)->first = NULL
|
#define INIT_HLIST_HEAD(head) (head)->first = NULL
|
||||||
|
@ -95,10 +95,6 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
#ifndef expect
|
#ifndef expect
|
||||||
#define expect(expr, value) (__builtin_expect((expr), (value)))
|
#define expect(expr, value) (__builtin_expect((expr), (value)))
|
||||||
#endif
|
#endif
|
||||||
#ifndef __linux__
|
|
||||||
#define likely(expr) expect((expr) != 0, 1)
|
|
||||||
#define unlikely(expr) expect((expr) != 0, 0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define PANIC(fmt, a...) \
|
#define PANIC(fmt, a...) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, fmt, ## a)
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, fmt, ## a)
|
||||||
@ -109,7 +105,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
__FILE__, __FUNCTION__, __LINE__))
|
__FILE__, __FUNCTION__, __LINE__))
|
||||||
|
|
||||||
#define VERIFYF(cond, str, ...) do { \
|
#define VERIFYF(cond, str, ...) do { \
|
||||||
if (unlikely(!cond)) \
|
if (unlikely(!(cond))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY(" #cond ") failed " str "\n", __VA_ARGS__);\
|
"VERIFY(" #cond ") failed " str "\n", __VA_ARGS__);\
|
||||||
} while (0)
|
} while (0)
|
||||||
@ -205,7 +201,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
"failed (%lld " #OP " %lld) " STR "\n", \
|
"failed (%lld " #OP " %lld) " STR "\n", \
|
||||||
(long long)(_verify3_left), \
|
(long long)(_verify3_left), \
|
||||||
(long long)(_verify3_right), \
|
(long long)(_verify3_right), \
|
||||||
__VA_ARGS); \
|
__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY3UF(LEFT, OP, RIGHT, STR, ...) do { \
|
#define VERIFY3UF(LEFT, OP, RIGHT, STR, ...) do { \
|
||||||
@ -217,7 +213,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
"failed (%llu " #OP " %llu) " STR "\n", \
|
"failed (%llu " #OP " %llu) " STR "\n", \
|
||||||
(unsigned long long)(_verify3_left), \
|
(unsigned long long)(_verify3_left), \
|
||||||
(unsigned long long)(_verify3_right), \
|
(unsigned long long)(_verify3_right), \
|
||||||
__VA_ARGS); \
|
__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY3PF(LEFT, OP, RIGHT, STR, ...) do { \
|
#define VERIFY3PF(LEFT, OP, RIGHT, STR, ...) do { \
|
||||||
|
@ -31,9 +31,9 @@
|
|||||||
|
|
||||||
#include_next <sys/sdt.h>
|
#include_next <sys/sdt.h>
|
||||||
#ifdef KDTRACE_HOOKS
|
#ifdef KDTRACE_HOOKS
|
||||||
/* BEGIN CSTYLED */
|
|
||||||
SDT_PROBE_DECLARE(sdt, , , set__error);
|
SDT_PROBE_DECLARE(sdt, , , set__error);
|
||||||
|
|
||||||
|
/* BEGIN CSTYLED */
|
||||||
#define SET_ERROR(err) ({ \
|
#define SET_ERROR(err) ({ \
|
||||||
SDT_PROBE1(sdt, , , set__error, (uintptr_t)err); \
|
SDT_PROBE1(sdt, , , set__error, (uintptr_t)err); \
|
||||||
err; \
|
err; \
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
#define kfpu_fini() do {} while (0)
|
#define kfpu_fini() do {} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define simd_stat_init() 0
|
#define simd_stat_init() do {} while (0)
|
||||||
#define simd_stat_fini() 0
|
#define simd_stat_fini() do {} while (0)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -68,47 +68,30 @@ enum symfollow { NO_FOLLOW = NOFOLLOW };
|
|||||||
#include <vm/vm_object.h>
|
#include <vm/vm_object.h>
|
||||||
|
|
||||||
typedef struct vop_vector vnodeops_t;
|
typedef struct vop_vector vnodeops_t;
|
||||||
#define VOP_FID VOP_VPTOFH
|
|
||||||
#define vop_fid vop_vptofh
|
#define vop_fid vop_vptofh
|
||||||
#define vop_fid_args vop_vptofh_args
|
#define vop_fid_args vop_vptofh_args
|
||||||
#define a_fid a_fhp
|
#define a_fid a_fhp
|
||||||
|
|
||||||
#define rootvfs (rootvnode == NULL ? NULL : rootvnode->v_mount)
|
|
||||||
|
|
||||||
#ifndef IN_BASE
|
|
||||||
static __inline int
|
|
||||||
vn_is_readonly(vnode_t *vp)
|
|
||||||
{
|
|
||||||
return (vp->v_mount->mnt_flag & MNT_RDONLY);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#define vn_vfswlock(vp) (0)
|
#define vn_vfswlock(vp) (0)
|
||||||
#define vn_vfsunlock(vp) do { } while (0)
|
#define vn_vfsunlock(vp) do { } while (0)
|
||||||
#define vn_ismntpt(vp) \
|
|
||||||
((vp)->v_type == VDIR && (vp)->v_mountedhere != NULL)
|
#ifndef IN_BASE
|
||||||
#define vn_mountedvfs(vp) ((vp)->v_mountedhere)
|
|
||||||
#define vn_has_cached_data(vp) \
|
#define vn_has_cached_data(vp) \
|
||||||
((vp)->v_object != NULL && \
|
((vp)->v_object != NULL && \
|
||||||
(vp)->v_object->resident_page_count > 0)
|
(vp)->v_object->resident_page_count > 0)
|
||||||
|
|
||||||
#ifndef IN_BASE
|
|
||||||
static __inline void
|
static __inline void
|
||||||
vn_flush_cached_data(vnode_t *vp, boolean_t sync)
|
vn_flush_cached_data(vnode_t *vp, boolean_t sync)
|
||||||
{
|
{
|
||||||
if (vm_object_mightbedirty(vp->v_object)) {
|
if (vm_object_mightbedirty(vp->v_object)) {
|
||||||
int flags = sync ? OBJPC_SYNC : 0;
|
int flags = sync ? OBJPC_SYNC : 0;
|
||||||
vn_lock(vp, LK_SHARED | LK_RETRY);
|
|
||||||
zfs_vmobject_wlock(vp->v_object);
|
zfs_vmobject_wlock(vp->v_object);
|
||||||
vm_object_page_clean(vp->v_object, 0, 0, flags);
|
vm_object_page_clean(vp->v_object, 0, 0, flags);
|
||||||
zfs_vmobject_wunlock(vp->v_object);
|
zfs_vmobject_wunlock(vp->v_object);
|
||||||
VOP_UNLOCK(vp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define vn_exists(vp) do { } while (0)
|
|
||||||
#define vn_invalid(vp) do { } while (0)
|
|
||||||
#define vn_free(vp) do { } while (0)
|
|
||||||
#define vn_matchops(vp, vops) ((vp)->v_op == &(vops))
|
#define vn_matchops(vp, vops) ((vp)->v_op == &(vops))
|
||||||
|
|
||||||
#define VN_HOLD(v) vref(v)
|
#define VN_HOLD(v) vref(v)
|
||||||
@ -123,9 +106,6 @@ vn_flush_cached_data(vnode_t *vp, boolean_t sync)
|
|||||||
#define vnevent_rename_dest(vp, dvp, name, ct) do { } while (0)
|
#define vnevent_rename_dest(vp, dvp, name, ct) do { } while (0)
|
||||||
#define vnevent_rename_dest_dir(vp, ct) do { } while (0)
|
#define vnevent_rename_dest_dir(vp, ct) do { } while (0)
|
||||||
|
|
||||||
#define specvp(vp, rdev, type, cr) (VN_HOLD(vp), (vp))
|
|
||||||
#define MANDLOCK(vp, mode) (0)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We will use va_spare is place of Solaris' va_mask.
|
* We will use va_spare is place of Solaris' va_mask.
|
||||||
* This field is initialized in zfs_setattr().
|
* This field is initialized in zfs_setattr().
|
||||||
|
@ -26,8 +26,10 @@
|
|||||||
#ifndef _ABD_OS_H
|
#ifndef _ABD_OS_H
|
||||||
#define _ABD_OS_H
|
#define _ABD_OS_H
|
||||||
|
|
||||||
|
#ifdef _KERNEL
|
||||||
#include <sys/vm.h>
|
#include <sys/vm.h>
|
||||||
#include <vm/vm_page.h>
|
#include <vm/vm_page.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -47,8 +49,10 @@ struct abd_linear {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef _KERNEL
|
||||||
__attribute__((malloc))
|
__attribute__((malloc))
|
||||||
struct abd *abd_alloc_from_pages(vm_page_t *, unsigned long, uint64_t);
|
struct abd *abd_alloc_from_pages(vm_page_t *, unsigned long, uint64_t);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
__FILE__, __FUNCTION__, __LINE__))
|
__FILE__, __FUNCTION__, __LINE__))
|
||||||
|
|
||||||
#define VERIFYF(cond, str, ...) do { \
|
#define VERIFYF(cond, str, ...) do { \
|
||||||
if (unlikely(!cond)) \
|
if (unlikely(!(cond))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY(" #cond ") failed " str "\n", __VA_ARGS__);\
|
"VERIFY(" #cond ") failed " str "\n", __VA_ARGS__);\
|
||||||
} while (0)
|
} while (0)
|
||||||
@ -205,7 +205,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
"failed (%lld " #OP " %lld) " STR "\n", \
|
"failed (%lld " #OP " %lld) " STR "\n", \
|
||||||
(long long)(_verify3_left), \
|
(long long)(_verify3_left), \
|
||||||
(long long)(_verify3_right), \
|
(long long)(_verify3_right), \
|
||||||
__VA_ARGS); \
|
__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY3UF(LEFT, OP, RIGHT, STR, ...) do { \
|
#define VERIFY3UF(LEFT, OP, RIGHT, STR, ...) do { \
|
||||||
@ -217,7 +217,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
"failed (%llu " #OP " %llu) " STR "\n", \
|
"failed (%llu " #OP " %llu) " STR "\n", \
|
||||||
(unsigned long long)(_verify3_left), \
|
(unsigned long long)(_verify3_left), \
|
||||||
(unsigned long long)(_verify3_right), \
|
(unsigned long long)(_verify3_right), \
|
||||||
__VA_ARGS); \
|
__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY3PF(LEFT, OP, RIGHT, STR, ...) do { \
|
#define VERIFY3PF(LEFT, OP, RIGHT, STR, ...) do { \
|
||||||
|
@ -38,8 +38,7 @@
|
|||||||
#include <sys/rwlock.h>
|
#include <sys/rwlock.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <sys/wmsum.h>
|
#include <sys/wmsum.h>
|
||||||
|
#include <sys/kstat.h>
|
||||||
typedef struct kstat_s kstat_t;
|
|
||||||
|
|
||||||
#define TASKQ_NAMELEN 31
|
#define TASKQ_NAMELEN 31
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
#define TS_ZOMB EXIT_ZOMBIE
|
#define TS_ZOMB EXIT_ZOMBIE
|
||||||
#define TS_STOPPED TASK_STOPPED
|
#define TS_STOPPED TASK_STOPPED
|
||||||
|
|
||||||
typedef void (*thread_func_t)(void *);
|
typedef void (*thread_func_t)(void *) __attribute__((noreturn));
|
||||||
|
|
||||||
#define thread_create_named(name, stk, stksize, func, arg, len, \
|
#define thread_create_named(name, stk, stksize, func, arg, len, \
|
||||||
pp, state, pri) \
|
pp, state, pri) \
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
*/
|
*/
|
||||||
#define UIO_DIRECT 0x0001 /* Direct I/O request */
|
#define UIO_DIRECT 0x0001 /* Direct I/O request */
|
||||||
|
|
||||||
#if defined(HAVE_VFS_IOV_ITER) && defined(HAVE_FAULT_IN_IOV_ITER_READABLE)
|
#if defined(HAVE_FAULT_IN_IOV_ITER_READABLE)
|
||||||
#define iov_iter_fault_in_readable(a, b) fault_in_iov_iter_readable(a, b)
|
#define iov_iter_fault_in_readable(a, b) fault_in_iov_iter_readable(a, b)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -52,12 +52,9 @@ typedef enum zfs_uio_rw {
|
|||||||
} zfs_uio_rw_t;
|
} zfs_uio_rw_t;
|
||||||
|
|
||||||
typedef enum zfs_uio_seg {
|
typedef enum zfs_uio_seg {
|
||||||
UIO_USERSPACE = 0,
|
UIO_SYSSPACE = 0,
|
||||||
UIO_SYSSPACE = 1,
|
UIO_BVEC = 1,
|
||||||
UIO_BVEC = 2,
|
UIO_ITER = 2,
|
||||||
#if defined(HAVE_VFS_IOV_ITER)
|
|
||||||
UIO_ITER = 3,
|
|
||||||
#endif
|
|
||||||
} zfs_uio_seg_t;
|
} zfs_uio_seg_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -72,9 +69,7 @@ typedef struct zfs_uio {
|
|||||||
union {
|
union {
|
||||||
const struct iovec *uio_iov;
|
const struct iovec *uio_iov;
|
||||||
const struct bio_vec *uio_bvec;
|
const struct bio_vec *uio_bvec;
|
||||||
#if defined(HAVE_VFS_IOV_ITER)
|
|
||||||
struct iov_iter *uio_iter;
|
struct iov_iter *uio_iter;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
int uio_iovcnt; /* Number of iovecs */
|
int uio_iovcnt; /* Number of iovecs */
|
||||||
offset_t uio_soffset; /* Starting logical offset */
|
offset_t uio_soffset; /* Starting logical offset */
|
||||||
@ -129,7 +124,7 @@ zfs_uio_iovec_init(zfs_uio_t *uio, const struct iovec *iov,
|
|||||||
unsigned long nr_segs, offset_t offset, zfs_uio_seg_t seg, ssize_t resid,
|
unsigned long nr_segs, offset_t offset, zfs_uio_seg_t seg, ssize_t resid,
|
||||||
size_t skip)
|
size_t skip)
|
||||||
{
|
{
|
||||||
ASSERT(seg == UIO_USERSPACE || seg == UIO_SYSSPACE);
|
ASSERT(seg == UIO_SYSSPACE);
|
||||||
|
|
||||||
uio->uio_iov = iov;
|
uio->uio_iov = iov;
|
||||||
uio->uio_iovcnt = nr_segs;
|
uio->uio_iovcnt = nr_segs;
|
||||||
@ -175,7 +170,6 @@ zfs_uio_bvec_init(zfs_uio_t *uio, struct bio *bio, struct request *rq)
|
|||||||
memset(&uio->uio_dio, 0, sizeof (zfs_uio_dio_t));
|
memset(&uio->uio_dio, 0, sizeof (zfs_uio_dio_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_VFS_IOV_ITER)
|
|
||||||
static inline void
|
static inline void
|
||||||
zfs_uio_iov_iter_init(zfs_uio_t *uio, struct iov_iter *iter, offset_t offset,
|
zfs_uio_iov_iter_init(zfs_uio_t *uio, struct iov_iter *iter, offset_t offset,
|
||||||
ssize_t resid, size_t skip)
|
ssize_t resid, size_t skip)
|
||||||
@ -192,7 +186,6 @@ zfs_uio_iov_iter_init(zfs_uio_t *uio, struct iov_iter *iter, offset_t offset,
|
|||||||
uio->uio_soffset = uio->uio_loffset;
|
uio->uio_soffset = uio->uio_loffset;
|
||||||
memset(&uio->uio_dio, 0, sizeof (zfs_uio_dio_t));
|
memset(&uio->uio_dio, 0, sizeof (zfs_uio_dio_t));
|
||||||
}
|
}
|
||||||
#endif /* HAVE_VFS_IOV_ITER */
|
|
||||||
|
|
||||||
#if defined(HAVE_ITER_IOV)
|
#if defined(HAVE_ITER_IOV)
|
||||||
#define zfs_uio_iter_iov(iter) iter_iov((iter))
|
#define zfs_uio_iter_iov(iter) iter_iov((iter))
|
||||||
|
@ -30,6 +30,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct abd;
|
||||||
|
|
||||||
struct abd_scatter {
|
struct abd_scatter {
|
||||||
uint_t abd_offset;
|
uint_t abd_offset;
|
||||||
uint_t abd_nents;
|
uint_t abd_nents;
|
||||||
@ -41,10 +43,8 @@ struct abd_linear {
|
|||||||
struct scatterlist *abd_sgl; /* for LINEAR_PAGE */
|
struct scatterlist *abd_sgl; /* for LINEAR_PAGE */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct abd abd_t;
|
|
||||||
|
|
||||||
typedef int abd_iter_page_func_t(struct page *, size_t, size_t, void *);
|
typedef int abd_iter_page_func_t(struct page *, size_t, size_t, void *);
|
||||||
int abd_iterate_page_func(abd_t *, size_t, size_t, abd_iter_page_func_t *,
|
int abd_iterate_page_func(struct abd *, size_t, size_t, abd_iter_page_func_t *,
|
||||||
void *);
|
void *);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -52,11 +52,11 @@ int abd_iterate_page_func(abd_t *, size_t, size_t, abd_iter_page_func_t *,
|
|||||||
* Note: these are only needed to support vdev_classic. See comment in
|
* Note: these are only needed to support vdev_classic. See comment in
|
||||||
* vdev_disk.c.
|
* vdev_disk.c.
|
||||||
*/
|
*/
|
||||||
unsigned int abd_bio_map_off(struct bio *, abd_t *, unsigned int, size_t);
|
unsigned int abd_bio_map_off(struct bio *, struct abd *, unsigned int, size_t);
|
||||||
unsigned long abd_nr_pages_off(abd_t *, unsigned int, size_t);
|
unsigned long abd_nr_pages_off(struct abd *, unsigned int, size_t);
|
||||||
|
|
||||||
__attribute__((malloc))
|
__attribute__((malloc))
|
||||||
abd_t *abd_alloc_from_pages(struct page **, unsigned long, uint64_t);
|
struct abd *abd_alloc_from_pages(struct page **, unsigned long, uint64_t);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -69,6 +69,7 @@ typedef struct vfs {
|
|||||||
boolean_t vfs_do_relatime;
|
boolean_t vfs_do_relatime;
|
||||||
boolean_t vfs_nbmand;
|
boolean_t vfs_nbmand;
|
||||||
boolean_t vfs_do_nbmand;
|
boolean_t vfs_do_nbmand;
|
||||||
|
kmutex_t vfs_mntpt_lock;
|
||||||
} vfs_t;
|
} vfs_t;
|
||||||
|
|
||||||
typedef struct zfs_mnt {
|
typedef struct zfs_mnt {
|
||||||
|
@ -347,6 +347,7 @@ void l2arc_fini(void);
|
|||||||
void l2arc_start(void);
|
void l2arc_start(void);
|
||||||
void l2arc_stop(void);
|
void l2arc_stop(void);
|
||||||
void l2arc_spa_rebuild_start(spa_t *spa);
|
void l2arc_spa_rebuild_start(spa_t *spa);
|
||||||
|
void l2arc_spa_rebuild_stop(spa_t *spa);
|
||||||
|
|
||||||
#ifndef _KERNEL
|
#ifndef _KERNEL
|
||||||
extern boolean_t arc_watch;
|
extern boolean_t arc_watch;
|
||||||
|
@ -942,6 +942,7 @@ typedef struct arc_sums {
|
|||||||
wmsum_t arcstat_evict_l2_eligible_mru;
|
wmsum_t arcstat_evict_l2_eligible_mru;
|
||||||
wmsum_t arcstat_evict_l2_ineligible;
|
wmsum_t arcstat_evict_l2_ineligible;
|
||||||
wmsum_t arcstat_evict_l2_skip;
|
wmsum_t arcstat_evict_l2_skip;
|
||||||
|
wmsum_t arcstat_hash_elements;
|
||||||
wmsum_t arcstat_hash_collisions;
|
wmsum_t arcstat_hash_collisions;
|
||||||
wmsum_t arcstat_hash_chains;
|
wmsum_t arcstat_hash_chains;
|
||||||
aggsum_t arcstat_size;
|
aggsum_t arcstat_size;
|
||||||
|
@ -86,28 +86,38 @@ typedef struct brt_vdev_phys {
|
|||||||
uint64_t bvp_savedspace;
|
uint64_t bvp_savedspace;
|
||||||
} brt_vdev_phys_t;
|
} brt_vdev_phys_t;
|
||||||
|
|
||||||
typedef struct brt_vdev {
|
struct brt_vdev {
|
||||||
|
/*
|
||||||
|
* Pending changes from open contexts.
|
||||||
|
*/
|
||||||
|
kmutex_t bv_pending_lock;
|
||||||
|
avl_tree_t bv_pending_tree[TXG_SIZE];
|
||||||
|
/*
|
||||||
|
* Protects bv_mos_*.
|
||||||
|
*/
|
||||||
|
krwlock_t bv_mos_entries_lock ____cacheline_aligned;
|
||||||
|
/*
|
||||||
|
* Protects all the fields starting from bv_initiated.
|
||||||
|
*/
|
||||||
|
krwlock_t bv_lock ____cacheline_aligned;
|
||||||
/*
|
/*
|
||||||
* VDEV id.
|
* VDEV id.
|
||||||
*/
|
*/
|
||||||
uint64_t bv_vdevid;
|
uint64_t bv_vdevid ____cacheline_aligned;
|
||||||
/*
|
|
||||||
* Is the structure initiated?
|
|
||||||
* (bv_entcount and bv_bitmap are allocated?)
|
|
||||||
*/
|
|
||||||
boolean_t bv_initiated;
|
|
||||||
/*
|
/*
|
||||||
* Object number in the MOS for the entcount array and brt_vdev_phys.
|
* Object number in the MOS for the entcount array and brt_vdev_phys.
|
||||||
*/
|
*/
|
||||||
uint64_t bv_mos_brtvdev;
|
uint64_t bv_mos_brtvdev;
|
||||||
/*
|
/*
|
||||||
* Object number in the MOS for the entries table.
|
* Object number in the MOS and dnode for the entries table.
|
||||||
*/
|
*/
|
||||||
uint64_t bv_mos_entries;
|
uint64_t bv_mos_entries;
|
||||||
|
dnode_t *bv_mos_entries_dnode;
|
||||||
/*
|
/*
|
||||||
* Entries to sync.
|
* Is the structure initiated?
|
||||||
|
* (bv_entcount and bv_bitmap are allocated?)
|
||||||
*/
|
*/
|
||||||
avl_tree_t bv_tree;
|
boolean_t bv_initiated;
|
||||||
/*
|
/*
|
||||||
* Does the bv_entcount[] array needs byte swapping?
|
* Does the bv_entcount[] array needs byte swapping?
|
||||||
*/
|
*/
|
||||||
@ -120,6 +130,26 @@ typedef struct brt_vdev {
|
|||||||
* This is the array with BRT entry count per BRT_RANGESIZE.
|
* This is the array with BRT entry count per BRT_RANGESIZE.
|
||||||
*/
|
*/
|
||||||
uint16_t *bv_entcount;
|
uint16_t *bv_entcount;
|
||||||
|
/*
|
||||||
|
* bv_entcount[] potentially can be a bit too big to sychronize it all
|
||||||
|
* when we just changed few entcounts. The fields below allow us to
|
||||||
|
* track updates to bv_entcount[] array since the last sync.
|
||||||
|
* A single bit in the bv_bitmap represents as many entcounts as can
|
||||||
|
* fit into a single BRT_BLOCKSIZE.
|
||||||
|
* For example we have 65536 entcounts in the bv_entcount array
|
||||||
|
* (so the whole array is 128kB). We updated bv_entcount[2] and
|
||||||
|
* bv_entcount[5]. In that case only first bit in the bv_bitmap will
|
||||||
|
* be set and we will write only first BRT_BLOCKSIZE out of 128kB.
|
||||||
|
*/
|
||||||
|
ulong_t *bv_bitmap;
|
||||||
|
/*
|
||||||
|
* bv_entcount[] needs updating on disk.
|
||||||
|
*/
|
||||||
|
boolean_t bv_entcount_dirty;
|
||||||
|
/*
|
||||||
|
* brt_vdev_phys needs updating on disk.
|
||||||
|
*/
|
||||||
|
boolean_t bv_meta_dirty;
|
||||||
/*
|
/*
|
||||||
* Sum of all bv_entcount[]s.
|
* Sum of all bv_entcount[]s.
|
||||||
*/
|
*/
|
||||||
@ -133,65 +163,27 @@ typedef struct brt_vdev {
|
|||||||
*/
|
*/
|
||||||
uint64_t bv_savedspace;
|
uint64_t bv_savedspace;
|
||||||
/*
|
/*
|
||||||
* brt_vdev_phys needs updating on disk.
|
* Entries to sync.
|
||||||
*/
|
*/
|
||||||
boolean_t bv_meta_dirty;
|
avl_tree_t bv_tree;
|
||||||
/*
|
};
|
||||||
* bv_entcount[] needs updating on disk.
|
|
||||||
*/
|
|
||||||
boolean_t bv_entcount_dirty;
|
|
||||||
/*
|
|
||||||
* bv_entcount[] potentially can be a bit too big to sychronize it all
|
|
||||||
* when we just changed few entcounts. The fields below allow us to
|
|
||||||
* track updates to bv_entcount[] array since the last sync.
|
|
||||||
* A single bit in the bv_bitmap represents as many entcounts as can
|
|
||||||
* fit into a single BRT_BLOCKSIZE.
|
|
||||||
* For example we have 65536 entcounts in the bv_entcount array
|
|
||||||
* (so the whole array is 128kB). We updated bv_entcount[2] and
|
|
||||||
* bv_entcount[5]. In that case only first bit in the bv_bitmap will
|
|
||||||
* be set and we will write only first BRT_BLOCKSIZE out of 128kB.
|
|
||||||
*/
|
|
||||||
ulong_t *bv_bitmap;
|
|
||||||
uint64_t bv_nblocks;
|
|
||||||
} brt_vdev_t;
|
|
||||||
|
|
||||||
/*
|
/* Size of offset / sizeof (uint64_t). */
|
||||||
* In-core brt
|
|
||||||
*/
|
|
||||||
typedef struct brt {
|
|
||||||
krwlock_t brt_lock;
|
|
||||||
spa_t *brt_spa;
|
|
||||||
#define brt_mos brt_spa->spa_meta_objset
|
|
||||||
uint64_t brt_rangesize;
|
|
||||||
uint64_t brt_usedspace;
|
|
||||||
uint64_t brt_savedspace;
|
|
||||||
avl_tree_t brt_pending_tree[TXG_SIZE];
|
|
||||||
kmutex_t brt_pending_lock[TXG_SIZE];
|
|
||||||
/* Sum of all entries across all bv_trees. */
|
|
||||||
uint64_t brt_nentries;
|
|
||||||
brt_vdev_t *brt_vdevs;
|
|
||||||
uint64_t brt_nvdevs;
|
|
||||||
} brt_t;
|
|
||||||
|
|
||||||
/* Size of bre_offset / sizeof (uint64_t). */
|
|
||||||
#define BRT_KEY_WORDS (1)
|
#define BRT_KEY_WORDS (1)
|
||||||
|
|
||||||
|
#define BRE_OFFSET(bre) (DVA_GET_OFFSET(&(bre)->bre_bp.blk_dva[0]))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In-core brt entry.
|
* In-core brt entry.
|
||||||
* On-disk we use bre_offset as the key and bre_refcount as the value.
|
* On-disk we use ZAP with offset as the key and count as the value.
|
||||||
*/
|
*/
|
||||||
typedef struct brt_entry {
|
typedef struct brt_entry {
|
||||||
uint64_t bre_offset;
|
|
||||||
uint64_t bre_refcount;
|
|
||||||
avl_node_t bre_node;
|
avl_node_t bre_node;
|
||||||
|
blkptr_t bre_bp;
|
||||||
|
uint64_t bre_count;
|
||||||
|
uint64_t bre_pcount;
|
||||||
} brt_entry_t;
|
} brt_entry_t;
|
||||||
|
|
||||||
typedef struct brt_pending_entry {
|
|
||||||
blkptr_t bpe_bp;
|
|
||||||
int bpe_count;
|
|
||||||
avl_node_t bpe_node;
|
|
||||||
} brt_pending_entry_t;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -171,7 +171,6 @@ typedef struct dbuf_dirty_record {
|
|||||||
* gets COW'd in a subsequent transaction group.
|
* gets COW'd in a subsequent transaction group.
|
||||||
*/
|
*/
|
||||||
arc_buf_t *dr_data;
|
arc_buf_t *dr_data;
|
||||||
blkptr_t dr_overridden_by;
|
|
||||||
override_states_t dr_override_state;
|
override_states_t dr_override_state;
|
||||||
uint8_t dr_copies;
|
uint8_t dr_copies;
|
||||||
boolean_t dr_nopwrite;
|
boolean_t dr_nopwrite;
|
||||||
@ -179,14 +178,21 @@ typedef struct dbuf_dirty_record {
|
|||||||
boolean_t dr_diowrite;
|
boolean_t dr_diowrite;
|
||||||
boolean_t dr_has_raw_params;
|
boolean_t dr_has_raw_params;
|
||||||
|
|
||||||
|
/* Override and raw params are mutually exclusive. */
|
||||||
|
union {
|
||||||
|
blkptr_t dr_overridden_by;
|
||||||
|
struct {
|
||||||
/*
|
/*
|
||||||
* If dr_has_raw_params is set, the following crypt
|
* If dr_has_raw_params is set, the
|
||||||
* params will be set on the BP that's written.
|
* following crypt params will be set
|
||||||
|
* on the BP that's written.
|
||||||
*/
|
*/
|
||||||
boolean_t dr_byteorder;
|
boolean_t dr_byteorder;
|
||||||
uint8_t dr_salt[ZIO_DATA_SALT_LEN];
|
uint8_t dr_salt[ZIO_DATA_SALT_LEN];
|
||||||
uint8_t dr_iv[ZIO_DATA_IV_LEN];
|
uint8_t dr_iv[ZIO_DATA_IV_LEN];
|
||||||
uint8_t dr_mac[ZIO_DATA_MAC_LEN];
|
uint8_t dr_mac[ZIO_DATA_MAC_LEN];
|
||||||
|
};
|
||||||
|
};
|
||||||
} dl;
|
} dl;
|
||||||
struct dirty_lightweight_leaf {
|
struct dirty_lightweight_leaf {
|
||||||
/*
|
/*
|
||||||
@ -264,6 +270,27 @@ typedef struct dmu_buf_impl {
|
|||||||
*/
|
*/
|
||||||
uint8_t db_level;
|
uint8_t db_level;
|
||||||
|
|
||||||
|
/* This block was freed while a read or write was active. */
|
||||||
|
uint8_t db_freed_in_flight;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Evict user data as soon as the dirty and reference counts are equal.
|
||||||
|
*/
|
||||||
|
uint8_t db_user_immediate_evict;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* dnode_evict_dbufs() or dnode_evict_bonus() tried to evict this dbuf,
|
||||||
|
* but couldn't due to outstanding references. Evict once the refcount
|
||||||
|
* drops to 0.
|
||||||
|
*/
|
||||||
|
uint8_t db_pending_evict;
|
||||||
|
|
||||||
|
/* Number of TXGs in which this buffer is dirty. */
|
||||||
|
uint8_t db_dirtycnt;
|
||||||
|
|
||||||
|
/* The buffer was partially read. More reads may follow. */
|
||||||
|
uint8_t db_partial_read;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Protects db_buf's contents if they contain an indirect block or data
|
* Protects db_buf's contents if they contain an indirect block or data
|
||||||
* block of the meta-dnode. We use this lock to protect the structure of
|
* block of the meta-dnode. We use this lock to protect the structure of
|
||||||
@ -288,6 +315,9 @@ typedef struct dmu_buf_impl {
|
|||||||
*/
|
*/
|
||||||
dbuf_states_t db_state;
|
dbuf_states_t db_state;
|
||||||
|
|
||||||
|
/* In which dbuf cache this dbuf is, if any. */
|
||||||
|
dbuf_cached_state_t db_caching_status;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Refcount accessed by dmu_buf_{hold,rele}.
|
* Refcount accessed by dmu_buf_{hold,rele}.
|
||||||
* If nonzero, the buffer can't be destroyed.
|
* If nonzero, the buffer can't be destroyed.
|
||||||
@ -304,39 +334,10 @@ typedef struct dmu_buf_impl {
|
|||||||
/* Link in dbuf_cache or dbuf_metadata_cache */
|
/* Link in dbuf_cache or dbuf_metadata_cache */
|
||||||
multilist_node_t db_cache_link;
|
multilist_node_t db_cache_link;
|
||||||
|
|
||||||
/* Tells us which dbuf cache this dbuf is in, if any */
|
|
||||||
dbuf_cached_state_t db_caching_status;
|
|
||||||
|
|
||||||
uint64_t db_hash;
|
uint64_t db_hash;
|
||||||
|
|
||||||
/* Data which is unique to data (leaf) blocks: */
|
|
||||||
|
|
||||||
/* User callback information. */
|
/* User callback information. */
|
||||||
dmu_buf_user_t *db_user;
|
dmu_buf_user_t *db_user;
|
||||||
|
|
||||||
/*
|
|
||||||
* Evict user data as soon as the dirty and reference
|
|
||||||
* counts are equal.
|
|
||||||
*/
|
|
||||||
uint8_t db_user_immediate_evict;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This block was freed while a read or write was
|
|
||||||
* active.
|
|
||||||
*/
|
|
||||||
uint8_t db_freed_in_flight;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* dnode_evict_dbufs() or dnode_evict_bonus() tried to
|
|
||||||
* evict this dbuf, but couldn't due to outstanding
|
|
||||||
* references. Evict once the refcount drops to 0.
|
|
||||||
*/
|
|
||||||
uint8_t db_pending_evict;
|
|
||||||
|
|
||||||
uint8_t db_dirtycnt;
|
|
||||||
|
|
||||||
/* The buffer was partially read. More reads may follow. */
|
|
||||||
uint8_t db_partial_read;
|
|
||||||
} dmu_buf_impl_t;
|
} dmu_buf_impl_t;
|
||||||
|
|
||||||
#define DBUF_HASH_MUTEX(h, idx) \
|
#define DBUF_HASH_MUTEX(h, idx) \
|
||||||
@ -351,6 +352,8 @@ typedef struct dbuf_hash_table {
|
|||||||
|
|
||||||
typedef void (*dbuf_prefetch_fn)(void *, uint64_t, uint64_t, boolean_t);
|
typedef void (*dbuf_prefetch_fn)(void *, uint64_t, uint64_t, boolean_t);
|
||||||
|
|
||||||
|
extern kmem_cache_t *dbuf_dirty_kmem_cache;
|
||||||
|
|
||||||
uint64_t dbuf_whichblock(const struct dnode *di, const int64_t level,
|
uint64_t dbuf_whichblock(const struct dnode *di, const int64_t level,
|
||||||
const uint64_t offset);
|
const uint64_t offset);
|
||||||
|
|
||||||
|
@ -381,6 +381,7 @@ typedef struct dmu_buf {
|
|||||||
#define DMU_POOL_CREATION_VERSION "creation_version"
|
#define DMU_POOL_CREATION_VERSION "creation_version"
|
||||||
#define DMU_POOL_SCAN "scan"
|
#define DMU_POOL_SCAN "scan"
|
||||||
#define DMU_POOL_ERRORSCRUB "error_scrub"
|
#define DMU_POOL_ERRORSCRUB "error_scrub"
|
||||||
|
#define DMU_POOL_LAST_SCRUBBED_TXG "last_scrubbed_txg"
|
||||||
#define DMU_POOL_FREE_BPOBJ "free_bpobj"
|
#define DMU_POOL_FREE_BPOBJ "free_bpobj"
|
||||||
#define DMU_POOL_BPTREE_OBJ "bptree_obj"
|
#define DMU_POOL_BPTREE_OBJ "bptree_obj"
|
||||||
#define DMU_POOL_EMPTY_BPOBJ "empty_bpobj"
|
#define DMU_POOL_EMPTY_BPOBJ "empty_bpobj"
|
||||||
|
@ -89,7 +89,7 @@ extern int zfs_livelist_min_percent_shared;
|
|||||||
|
|
||||||
typedef int deadlist_iter_t(void *args, dsl_deadlist_entry_t *dle);
|
typedef int deadlist_iter_t(void *args, dsl_deadlist_entry_t *dle);
|
||||||
|
|
||||||
void dsl_deadlist_open(dsl_deadlist_t *dl, objset_t *os, uint64_t object);
|
int dsl_deadlist_open(dsl_deadlist_t *dl, objset_t *os, uint64_t object);
|
||||||
void dsl_deadlist_close(dsl_deadlist_t *dl);
|
void dsl_deadlist_close(dsl_deadlist_t *dl);
|
||||||
void dsl_deadlist_iterate(dsl_deadlist_t *dl, deadlist_iter_t func, void *arg);
|
void dsl_deadlist_iterate(dsl_deadlist_t *dl, deadlist_iter_t func, void *arg);
|
||||||
uint64_t dsl_deadlist_alloc(objset_t *os, dmu_tx_t *tx);
|
uint64_t dsl_deadlist_alloc(objset_t *os, dmu_tx_t *tx);
|
||||||
|
@ -198,7 +198,7 @@ void dsl_dir_set_reservation_sync_impl(dsl_dir_t *dd, uint64_t value,
|
|||||||
dmu_tx_t *tx);
|
dmu_tx_t *tx);
|
||||||
void dsl_dir_zapify(dsl_dir_t *dd, dmu_tx_t *tx);
|
void dsl_dir_zapify(dsl_dir_t *dd, dmu_tx_t *tx);
|
||||||
boolean_t dsl_dir_is_zapified(dsl_dir_t *dd);
|
boolean_t dsl_dir_is_zapified(dsl_dir_t *dd);
|
||||||
void dsl_dir_livelist_open(dsl_dir_t *dd, uint64_t obj);
|
int dsl_dir_livelist_open(dsl_dir_t *dd, uint64_t obj);
|
||||||
void dsl_dir_livelist_close(dsl_dir_t *dd);
|
void dsl_dir_livelist_close(dsl_dir_t *dd);
|
||||||
void dsl_dir_remove_livelist(dsl_dir_t *dd, dmu_tx_t *tx, boolean_t total);
|
void dsl_dir_remove_livelist(dsl_dir_t *dd, dmu_tx_t *tx, boolean_t total);
|
||||||
int dsl_dir_wait(dsl_dir_t *dd, dsl_dataset_t *ds, zfs_wait_activity_t activity,
|
int dsl_dir_wait(dsl_dir_t *dd, dsl_dataset_t *ds, zfs_wait_activity_t activity,
|
||||||
|
@ -179,6 +179,12 @@ typedef struct dsl_scan {
|
|||||||
dsl_errorscrub_phys_t errorscrub_phys;
|
dsl_errorscrub_phys_t errorscrub_phys;
|
||||||
} dsl_scan_t;
|
} dsl_scan_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
pool_scan_func_t func;
|
||||||
|
uint64_t txgstart;
|
||||||
|
uint64_t txgend;
|
||||||
|
} setup_sync_arg_t;
|
||||||
|
|
||||||
typedef struct dsl_scan_io_queue dsl_scan_io_queue_t;
|
typedef struct dsl_scan_io_queue dsl_scan_io_queue_t;
|
||||||
|
|
||||||
void scan_init(void);
|
void scan_init(void);
|
||||||
@ -189,7 +195,8 @@ void dsl_scan_setup_sync(void *, dmu_tx_t *);
|
|||||||
void dsl_scan_fini(struct dsl_pool *dp);
|
void dsl_scan_fini(struct dsl_pool *dp);
|
||||||
void dsl_scan_sync(struct dsl_pool *, dmu_tx_t *);
|
void dsl_scan_sync(struct dsl_pool *, dmu_tx_t *);
|
||||||
int dsl_scan_cancel(struct dsl_pool *);
|
int dsl_scan_cancel(struct dsl_pool *);
|
||||||
int dsl_scan(struct dsl_pool *, pool_scan_func_t);
|
int dsl_scan(struct dsl_pool *, pool_scan_func_t, uint64_t starttxg,
|
||||||
|
uint64_t txgend);
|
||||||
void dsl_scan_assess_vdev(struct dsl_pool *dp, vdev_t *vd);
|
void dsl_scan_assess_vdev(struct dsl_pool *dp, vdev_t *vd);
|
||||||
boolean_t dsl_scan_scrubbing(const struct dsl_pool *dp);
|
boolean_t dsl_scan_scrubbing(const struct dsl_pool *dp);
|
||||||
boolean_t dsl_errorscrubbing(const struct dsl_pool *dp);
|
boolean_t dsl_errorscrubbing(const struct dsl_pool *dp);
|
||||||
|
@ -42,7 +42,8 @@ extern "C" {
|
|||||||
#define FM_EREPORT_ZFS_DATA "data"
|
#define FM_EREPORT_ZFS_DATA "data"
|
||||||
#define FM_EREPORT_ZFS_DELAY "delay"
|
#define FM_EREPORT_ZFS_DELAY "delay"
|
||||||
#define FM_EREPORT_ZFS_DEADMAN "deadman"
|
#define FM_EREPORT_ZFS_DEADMAN "deadman"
|
||||||
#define FM_EREPORT_ZFS_DIO_VERIFY "dio_verify"
|
#define FM_EREPORT_ZFS_DIO_VERIFY_WR "dio_verify_wr"
|
||||||
|
#define FM_EREPORT_ZFS_DIO_VERIFY_RD "dio_verify_rd"
|
||||||
#define FM_EREPORT_ZFS_POOL "zpool"
|
#define FM_EREPORT_ZFS_POOL "zpool"
|
||||||
#define FM_EREPORT_ZFS_DEVICE_UNKNOWN "vdev.unknown"
|
#define FM_EREPORT_ZFS_DEVICE_UNKNOWN "vdev.unknown"
|
||||||
#define FM_EREPORT_ZFS_DEVICE_OPEN_FAILED "vdev.open_failed"
|
#define FM_EREPORT_ZFS_DEVICE_OPEN_FAILED "vdev.open_failed"
|
||||||
|
@ -265,6 +265,7 @@ typedef enum {
|
|||||||
ZPOOL_PROP_DEDUP_TABLE_SIZE,
|
ZPOOL_PROP_DEDUP_TABLE_SIZE,
|
||||||
ZPOOL_PROP_DEDUP_TABLE_QUOTA,
|
ZPOOL_PROP_DEDUP_TABLE_QUOTA,
|
||||||
ZPOOL_PROP_DEDUPCACHED,
|
ZPOOL_PROP_DEDUPCACHED,
|
||||||
|
ZPOOL_PROP_LAST_SCRUBBED_TXG,
|
||||||
ZPOOL_NUM_PROPS
|
ZPOOL_NUM_PROPS
|
||||||
} zpool_prop_t;
|
} zpool_prop_t;
|
||||||
|
|
||||||
@ -1088,6 +1089,7 @@ typedef enum pool_scan_func {
|
|||||||
typedef enum pool_scrub_cmd {
|
typedef enum pool_scrub_cmd {
|
||||||
POOL_SCRUB_NORMAL = 0,
|
POOL_SCRUB_NORMAL = 0,
|
||||||
POOL_SCRUB_PAUSE,
|
POOL_SCRUB_PAUSE,
|
||||||
|
POOL_SCRUB_FROM_LAST_TXG,
|
||||||
POOL_SCRUB_FLAGS_END
|
POOL_SCRUB_FLAGS_END
|
||||||
} pool_scrub_cmd_t;
|
} pool_scrub_cmd_t;
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ extern "C" {
|
|||||||
/*
|
/*
|
||||||
* Forward references that lots of things need.
|
* Forward references that lots of things need.
|
||||||
*/
|
*/
|
||||||
|
typedef struct brt_vdev brt_vdev_t;
|
||||||
typedef struct spa spa_t;
|
typedef struct spa spa_t;
|
||||||
typedef struct vdev vdev_t;
|
typedef struct vdev vdev_t;
|
||||||
typedef struct metaslab metaslab_t;
|
typedef struct metaslab metaslab_t;
|
||||||
@ -821,6 +822,8 @@ extern void spa_l2cache_drop(spa_t *spa);
|
|||||||
|
|
||||||
/* scanning */
|
/* scanning */
|
||||||
extern int spa_scan(spa_t *spa, pool_scan_func_t func);
|
extern int spa_scan(spa_t *spa, pool_scan_func_t func);
|
||||||
|
extern int spa_scan_range(spa_t *spa, pool_scan_func_t func, uint64_t txgstart,
|
||||||
|
uint64_t txgend);
|
||||||
extern int spa_scan_stop(spa_t *spa);
|
extern int spa_scan_stop(spa_t *spa);
|
||||||
extern int spa_scrub_pause_resume(spa_t *spa, pool_scrub_cmd_t flag);
|
extern int spa_scrub_pause_resume(spa_t *spa, pool_scrub_cmd_t flag);
|
||||||
|
|
||||||
@ -1079,6 +1082,7 @@ extern uint64_t spa_get_deadman_failmode(spa_t *spa);
|
|||||||
extern void spa_set_deadman_failmode(spa_t *spa, const char *failmode);
|
extern void spa_set_deadman_failmode(spa_t *spa, const char *failmode);
|
||||||
extern boolean_t spa_suspended(spa_t *spa);
|
extern boolean_t spa_suspended(spa_t *spa);
|
||||||
extern uint64_t spa_bootfs(spa_t *spa);
|
extern uint64_t spa_bootfs(spa_t *spa);
|
||||||
|
extern uint64_t spa_get_last_scrubbed_txg(spa_t *spa);
|
||||||
extern uint64_t spa_delegation(spa_t *spa);
|
extern uint64_t spa_delegation(spa_t *spa);
|
||||||
extern objset_t *spa_meta_objset(spa_t *spa);
|
extern objset_t *spa_meta_objset(spa_t *spa);
|
||||||
extern space_map_t *spa_syncing_log_sm(spa_t *spa);
|
extern space_map_t *spa_syncing_log_sm(spa_t *spa);
|
||||||
|
@ -318,6 +318,7 @@ struct spa {
|
|||||||
uint64_t spa_scan_pass_scrub_spent_paused; /* total paused */
|
uint64_t spa_scan_pass_scrub_spent_paused; /* total paused */
|
||||||
uint64_t spa_scan_pass_exam; /* examined bytes per pass */
|
uint64_t spa_scan_pass_exam; /* examined bytes per pass */
|
||||||
uint64_t spa_scan_pass_issued; /* issued bytes per pass */
|
uint64_t spa_scan_pass_issued; /* issued bytes per pass */
|
||||||
|
uint64_t spa_scrubbed_last_txg; /* last txg scrubbed */
|
||||||
|
|
||||||
/* error scrub pause time in milliseconds */
|
/* error scrub pause time in milliseconds */
|
||||||
uint64_t spa_scan_pass_errorscrub_pause;
|
uint64_t spa_scan_pass_errorscrub_pause;
|
||||||
@ -412,8 +413,12 @@ struct spa {
|
|||||||
uint64_t spa_dedup_dspace; /* Cache get_dedup_dspace() */
|
uint64_t spa_dedup_dspace; /* Cache get_dedup_dspace() */
|
||||||
uint64_t spa_dedup_checksum; /* default dedup checksum */
|
uint64_t spa_dedup_checksum; /* default dedup checksum */
|
||||||
uint64_t spa_dspace; /* dspace in normal class */
|
uint64_t spa_dspace; /* dspace in normal class */
|
||||||
|
uint64_t spa_rdspace; /* raw (non-dedup) --//-- */
|
||||||
boolean_t spa_active_ddt_prune; /* ddt prune process active */
|
boolean_t spa_active_ddt_prune; /* ddt prune process active */
|
||||||
struct brt *spa_brt; /* in-core BRT */
|
brt_vdev_t **spa_brt_vdevs; /* array of per-vdev BRTs */
|
||||||
|
uint64_t spa_brt_nvdevs; /* number of vdevs in BRT */
|
||||||
|
uint64_t spa_brt_rangesize; /* pool's BRT range size */
|
||||||
|
krwlock_t spa_brt_lock; /* Protects brt_vdevs/nvdevs */
|
||||||
kmutex_t spa_vdev_top_lock; /* dueling offline/remove */
|
kmutex_t spa_vdev_top_lock; /* dueling offline/remove */
|
||||||
kmutex_t spa_proc_lock; /* protects spa_proc* */
|
kmutex_t spa_proc_lock; /* protects spa_proc* */
|
||||||
kcondvar_t spa_proc_cv; /* spa_proc_state transitions */
|
kcondvar_t spa_proc_cv; /* spa_proc_state transitions */
|
||||||
|
@ -57,7 +57,7 @@ void vdev_raidz_reconstruct(struct raidz_map *, const int *, int);
|
|||||||
void vdev_raidz_child_done(zio_t *);
|
void vdev_raidz_child_done(zio_t *);
|
||||||
void vdev_raidz_io_done(zio_t *);
|
void vdev_raidz_io_done(zio_t *);
|
||||||
void vdev_raidz_checksum_error(zio_t *, struct raidz_col *, abd_t *);
|
void vdev_raidz_checksum_error(zio_t *, struct raidz_col *, abd_t *);
|
||||||
struct raidz_row *vdev_raidz_row_alloc(int);
|
struct raidz_row *vdev_raidz_row_alloc(int, zio_t *);
|
||||||
void vdev_raidz_reflow_copy_scratch(spa_t *);
|
void vdev_raidz_reflow_copy_scratch(spa_t *);
|
||||||
void raidz_dtl_reassessed(vdev_t *);
|
void raidz_dtl_reassessed(vdev_t *);
|
||||||
|
|
||||||
|
@ -223,11 +223,15 @@ int zap_lookup_norm(objset_t *ds, uint64_t zapobj, const char *name,
|
|||||||
boolean_t *normalization_conflictp);
|
boolean_t *normalization_conflictp);
|
||||||
int zap_lookup_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
|
int zap_lookup_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
|
||||||
int key_numints, uint64_t integer_size, uint64_t num_integers, void *buf);
|
int key_numints, uint64_t integer_size, uint64_t num_integers, void *buf);
|
||||||
|
int zap_lookup_uint64_by_dnode(dnode_t *dn, const uint64_t *key,
|
||||||
|
int key_numints, uint64_t integer_size, uint64_t num_integers, void *buf);
|
||||||
int zap_contains(objset_t *ds, uint64_t zapobj, const char *name);
|
int zap_contains(objset_t *ds, uint64_t zapobj, const char *name);
|
||||||
int zap_prefetch(objset_t *os, uint64_t zapobj, const char *name);
|
int zap_prefetch(objset_t *os, uint64_t zapobj, const char *name);
|
||||||
int zap_prefetch_object(objset_t *os, uint64_t zapobj);
|
int zap_prefetch_object(objset_t *os, uint64_t zapobj);
|
||||||
int zap_prefetch_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
|
int zap_prefetch_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
|
||||||
int key_numints);
|
int key_numints);
|
||||||
|
int zap_prefetch_uint64_by_dnode(dnode_t *dn, const uint64_t *key,
|
||||||
|
int key_numints);
|
||||||
|
|
||||||
int zap_lookup_by_dnode(dnode_t *dn, const char *name,
|
int zap_lookup_by_dnode(dnode_t *dn, const char *name,
|
||||||
uint64_t integer_size, uint64_t num_integers, void *buf);
|
uint64_t integer_size, uint64_t num_integers, void *buf);
|
||||||
@ -236,9 +240,6 @@ int zap_lookup_norm_by_dnode(dnode_t *dn, const char *name,
|
|||||||
matchtype_t mt, char *realname, int rn_len,
|
matchtype_t mt, char *realname, int rn_len,
|
||||||
boolean_t *ncp);
|
boolean_t *ncp);
|
||||||
|
|
||||||
int zap_count_write_by_dnode(dnode_t *dn, const char *name,
|
|
||||||
int add, zfs_refcount_t *towrite, zfs_refcount_t *tooverwrite);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create an attribute with the given name and value.
|
* Create an attribute with the given name and value.
|
||||||
*
|
*
|
||||||
|
@ -208,25 +208,25 @@ typedef uint64_t zio_flag_t;
|
|||||||
#define ZIO_FLAG_PROBE (1ULL << 16)
|
#define ZIO_FLAG_PROBE (1ULL << 16)
|
||||||
#define ZIO_FLAG_TRYHARD (1ULL << 17)
|
#define ZIO_FLAG_TRYHARD (1ULL << 17)
|
||||||
#define ZIO_FLAG_OPTIONAL (1ULL << 18)
|
#define ZIO_FLAG_OPTIONAL (1ULL << 18)
|
||||||
|
#define ZIO_FLAG_DIO_READ (1ULL << 19)
|
||||||
#define ZIO_FLAG_VDEV_INHERIT (ZIO_FLAG_DONT_QUEUE - 1)
|
#define ZIO_FLAG_VDEV_INHERIT (ZIO_FLAG_DONT_QUEUE - 1)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Flags not inherited by any children.
|
* Flags not inherited by any children.
|
||||||
*/
|
*/
|
||||||
#define ZIO_FLAG_DONT_QUEUE (1ULL << 19) /* must be first for INHERIT */
|
#define ZIO_FLAG_DONT_QUEUE (1ULL << 20) /* must be first for INHERIT */
|
||||||
#define ZIO_FLAG_DONT_PROPAGATE (1ULL << 20)
|
#define ZIO_FLAG_DONT_PROPAGATE (1ULL << 21)
|
||||||
#define ZIO_FLAG_IO_BYPASS (1ULL << 21)
|
#define ZIO_FLAG_IO_BYPASS (1ULL << 22)
|
||||||
#define ZIO_FLAG_IO_REWRITE (1ULL << 22)
|
#define ZIO_FLAG_IO_REWRITE (1ULL << 23)
|
||||||
#define ZIO_FLAG_RAW_COMPRESS (1ULL << 23)
|
#define ZIO_FLAG_RAW_COMPRESS (1ULL << 24)
|
||||||
#define ZIO_FLAG_RAW_ENCRYPT (1ULL << 24)
|
#define ZIO_FLAG_RAW_ENCRYPT (1ULL << 25)
|
||||||
#define ZIO_FLAG_GANG_CHILD (1ULL << 25)
|
#define ZIO_FLAG_GANG_CHILD (1ULL << 26)
|
||||||
#define ZIO_FLAG_DDT_CHILD (1ULL << 26)
|
#define ZIO_FLAG_DDT_CHILD (1ULL << 27)
|
||||||
#define ZIO_FLAG_GODFATHER (1ULL << 27)
|
#define ZIO_FLAG_GODFATHER (1ULL << 28)
|
||||||
#define ZIO_FLAG_NOPWRITE (1ULL << 28)
|
#define ZIO_FLAG_NOPWRITE (1ULL << 29)
|
||||||
#define ZIO_FLAG_REEXECUTED (1ULL << 29)
|
#define ZIO_FLAG_REEXECUTED (1ULL << 30)
|
||||||
#define ZIO_FLAG_DELEGATED (1ULL << 30)
|
#define ZIO_FLAG_DELEGATED (1ULL << 31)
|
||||||
#define ZIO_FLAG_DIO_CHKSUM_ERR (1ULL << 31)
|
#define ZIO_FLAG_DIO_CHKSUM_ERR (1ULL << 32)
|
||||||
|
|
||||||
#define ZIO_ALLOCATOR_NONE (-1)
|
#define ZIO_ALLOCATOR_NONE (-1)
|
||||||
#define ZIO_HAS_ALLOCATOR(zio) ((zio)->io_allocator != ZIO_ALLOCATOR_NONE)
|
#define ZIO_HAS_ALLOCATOR(zio) ((zio)->io_allocator != ZIO_ALLOCATOR_NONE)
|
||||||
@ -647,6 +647,7 @@ extern void zio_vdev_io_redone(zio_t *zio);
|
|||||||
extern void zio_change_priority(zio_t *pio, zio_priority_t priority);
|
extern void zio_change_priority(zio_t *pio, zio_priority_t priority);
|
||||||
|
|
||||||
extern void zio_checksum_verified(zio_t *zio);
|
extern void zio_checksum_verified(zio_t *zio);
|
||||||
|
extern void zio_dio_chksum_verify_error_report(zio_t *zio);
|
||||||
extern int zio_worst_error(int e1, int e2);
|
extern int zio_worst_error(int e1, int e2);
|
||||||
|
|
||||||
extern enum zio_checksum zio_checksum_select(enum zio_checksum child,
|
extern enum zio_checksum zio_checksum_select(enum zio_checksum child,
|
||||||
|
@ -88,6 +88,11 @@ int zvol_get_data(void *arg, uint64_t arg2, lr_write_t *lr, char *buf,
|
|||||||
int zvol_init_impl(void);
|
int zvol_init_impl(void);
|
||||||
void zvol_fini_impl(void);
|
void zvol_fini_impl(void);
|
||||||
void zvol_wait_close(zvol_state_t *zv);
|
void zvol_wait_close(zvol_state_t *zv);
|
||||||
|
int zvol_clone_range(zvol_state_handle_t *, uint64_t,
|
||||||
|
zvol_state_handle_t *, uint64_t, uint64_t);
|
||||||
|
void zvol_log_clone_range(zilog_t *zilog, dmu_tx_t *tx, int txtype,
|
||||||
|
uint64_t off, uint64_t len, uint64_t blksz, const blkptr_t *bps,
|
||||||
|
size_t nbps);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* platform dependent functions exported to platform independent code
|
* platform dependent functions exported to platform independent code
|
||||||
|
@ -35,7 +35,6 @@
|
|||||||
(void) __atomic_add_fetch(target, 1, __ATOMIC_SEQ_CST); \
|
(void) __atomic_add_fetch(target, 1, __ATOMIC_SEQ_CST); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BEGIN CSTYLED */
|
|
||||||
ATOMIC_INC(8, uint8_t)
|
ATOMIC_INC(8, uint8_t)
|
||||||
ATOMIC_INC(16, uint16_t)
|
ATOMIC_INC(16, uint16_t)
|
||||||
ATOMIC_INC(32, uint32_t)
|
ATOMIC_INC(32, uint32_t)
|
||||||
@ -44,7 +43,6 @@ ATOMIC_INC(uchar, uchar_t)
|
|||||||
ATOMIC_INC(ushort, ushort_t)
|
ATOMIC_INC(ushort, ushort_t)
|
||||||
ATOMIC_INC(uint, uint_t)
|
ATOMIC_INC(uint, uint_t)
|
||||||
ATOMIC_INC(ulong, ulong_t)
|
ATOMIC_INC(ulong, ulong_t)
|
||||||
/* END CSTYLED */
|
|
||||||
|
|
||||||
|
|
||||||
#define ATOMIC_DEC(name, type) \
|
#define ATOMIC_DEC(name, type) \
|
||||||
@ -53,7 +51,6 @@ ATOMIC_INC(ulong, ulong_t)
|
|||||||
(void) __atomic_sub_fetch(target, 1, __ATOMIC_SEQ_CST); \
|
(void) __atomic_sub_fetch(target, 1, __ATOMIC_SEQ_CST); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BEGIN CSTYLED */
|
|
||||||
ATOMIC_DEC(8, uint8_t)
|
ATOMIC_DEC(8, uint8_t)
|
||||||
ATOMIC_DEC(16, uint16_t)
|
ATOMIC_DEC(16, uint16_t)
|
||||||
ATOMIC_DEC(32, uint32_t)
|
ATOMIC_DEC(32, uint32_t)
|
||||||
@ -62,7 +59,6 @@ ATOMIC_DEC(uchar, uchar_t)
|
|||||||
ATOMIC_DEC(ushort, ushort_t)
|
ATOMIC_DEC(ushort, ushort_t)
|
||||||
ATOMIC_DEC(uint, uint_t)
|
ATOMIC_DEC(uint, uint_t)
|
||||||
ATOMIC_DEC(ulong, ulong_t)
|
ATOMIC_DEC(ulong, ulong_t)
|
||||||
/* END CSTYLED */
|
|
||||||
|
|
||||||
|
|
||||||
#define ATOMIC_ADD(name, type1, type2) \
|
#define ATOMIC_ADD(name, type1, type2) \
|
||||||
@ -77,7 +73,6 @@ atomic_add_ptr(volatile void *target, ssize_t bits)
|
|||||||
(void) __atomic_add_fetch((void **)target, bits, __ATOMIC_SEQ_CST);
|
(void) __atomic_add_fetch((void **)target, bits, __ATOMIC_SEQ_CST);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BEGIN CSTYLED */
|
|
||||||
ATOMIC_ADD(8, uint8_t, int8_t)
|
ATOMIC_ADD(8, uint8_t, int8_t)
|
||||||
ATOMIC_ADD(16, uint16_t, int16_t)
|
ATOMIC_ADD(16, uint16_t, int16_t)
|
||||||
ATOMIC_ADD(32, uint32_t, int32_t)
|
ATOMIC_ADD(32, uint32_t, int32_t)
|
||||||
@ -86,7 +81,6 @@ ATOMIC_ADD(char, uchar_t, signed char)
|
|||||||
ATOMIC_ADD(short, ushort_t, short)
|
ATOMIC_ADD(short, ushort_t, short)
|
||||||
ATOMIC_ADD(int, uint_t, int)
|
ATOMIC_ADD(int, uint_t, int)
|
||||||
ATOMIC_ADD(long, ulong_t, long)
|
ATOMIC_ADD(long, ulong_t, long)
|
||||||
/* END CSTYLED */
|
|
||||||
|
|
||||||
|
|
||||||
#define ATOMIC_SUB(name, type1, type2) \
|
#define ATOMIC_SUB(name, type1, type2) \
|
||||||
@ -101,7 +95,6 @@ atomic_sub_ptr(volatile void *target, ssize_t bits)
|
|||||||
(void) __atomic_sub_fetch((void **)target, bits, __ATOMIC_SEQ_CST);
|
(void) __atomic_sub_fetch((void **)target, bits, __ATOMIC_SEQ_CST);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BEGIN CSTYLED */
|
|
||||||
ATOMIC_SUB(8, uint8_t, int8_t)
|
ATOMIC_SUB(8, uint8_t, int8_t)
|
||||||
ATOMIC_SUB(16, uint16_t, int16_t)
|
ATOMIC_SUB(16, uint16_t, int16_t)
|
||||||
ATOMIC_SUB(32, uint32_t, int32_t)
|
ATOMIC_SUB(32, uint32_t, int32_t)
|
||||||
@ -110,7 +103,6 @@ ATOMIC_SUB(char, uchar_t, signed char)
|
|||||||
ATOMIC_SUB(short, ushort_t, short)
|
ATOMIC_SUB(short, ushort_t, short)
|
||||||
ATOMIC_SUB(int, uint_t, int)
|
ATOMIC_SUB(int, uint_t, int)
|
||||||
ATOMIC_SUB(long, ulong_t, long)
|
ATOMIC_SUB(long, ulong_t, long)
|
||||||
/* END CSTYLED */
|
|
||||||
|
|
||||||
|
|
||||||
#define ATOMIC_OR(name, type) \
|
#define ATOMIC_OR(name, type) \
|
||||||
@ -119,7 +111,6 @@ ATOMIC_SUB(long, ulong_t, long)
|
|||||||
(void) __atomic_or_fetch(target, bits, __ATOMIC_SEQ_CST); \
|
(void) __atomic_or_fetch(target, bits, __ATOMIC_SEQ_CST); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BEGIN CSTYLED */
|
|
||||||
ATOMIC_OR(8, uint8_t)
|
ATOMIC_OR(8, uint8_t)
|
||||||
ATOMIC_OR(16, uint16_t)
|
ATOMIC_OR(16, uint16_t)
|
||||||
ATOMIC_OR(32, uint32_t)
|
ATOMIC_OR(32, uint32_t)
|
||||||
@ -128,7 +119,6 @@ ATOMIC_OR(uchar, uchar_t)
|
|||||||
ATOMIC_OR(ushort, ushort_t)
|
ATOMIC_OR(ushort, ushort_t)
|
||||||
ATOMIC_OR(uint, uint_t)
|
ATOMIC_OR(uint, uint_t)
|
||||||
ATOMIC_OR(ulong, ulong_t)
|
ATOMIC_OR(ulong, ulong_t)
|
||||||
/* END CSTYLED */
|
|
||||||
|
|
||||||
|
|
||||||
#define ATOMIC_AND(name, type) \
|
#define ATOMIC_AND(name, type) \
|
||||||
@ -137,7 +127,6 @@ ATOMIC_OR(ulong, ulong_t)
|
|||||||
(void) __atomic_and_fetch(target, bits, __ATOMIC_SEQ_CST); \
|
(void) __atomic_and_fetch(target, bits, __ATOMIC_SEQ_CST); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BEGIN CSTYLED */
|
|
||||||
ATOMIC_AND(8, uint8_t)
|
ATOMIC_AND(8, uint8_t)
|
||||||
ATOMIC_AND(16, uint16_t)
|
ATOMIC_AND(16, uint16_t)
|
||||||
ATOMIC_AND(32, uint32_t)
|
ATOMIC_AND(32, uint32_t)
|
||||||
@ -146,7 +135,6 @@ ATOMIC_AND(uchar, uchar_t)
|
|||||||
ATOMIC_AND(ushort, ushort_t)
|
ATOMIC_AND(ushort, ushort_t)
|
||||||
ATOMIC_AND(uint, uint_t)
|
ATOMIC_AND(uint, uint_t)
|
||||||
ATOMIC_AND(ulong, ulong_t)
|
ATOMIC_AND(ulong, ulong_t)
|
||||||
/* END CSTYLED */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -159,7 +147,6 @@ ATOMIC_AND(ulong, ulong_t)
|
|||||||
return (__atomic_add_fetch(target, 1, __ATOMIC_SEQ_CST)); \
|
return (__atomic_add_fetch(target, 1, __ATOMIC_SEQ_CST)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BEGIN CSTYLED */
|
|
||||||
ATOMIC_INC_NV(8, uint8_t)
|
ATOMIC_INC_NV(8, uint8_t)
|
||||||
ATOMIC_INC_NV(16, uint16_t)
|
ATOMIC_INC_NV(16, uint16_t)
|
||||||
ATOMIC_INC_NV(32, uint32_t)
|
ATOMIC_INC_NV(32, uint32_t)
|
||||||
@ -168,7 +155,6 @@ ATOMIC_INC_NV(uchar, uchar_t)
|
|||||||
ATOMIC_INC_NV(ushort, ushort_t)
|
ATOMIC_INC_NV(ushort, ushort_t)
|
||||||
ATOMIC_INC_NV(uint, uint_t)
|
ATOMIC_INC_NV(uint, uint_t)
|
||||||
ATOMIC_INC_NV(ulong, ulong_t)
|
ATOMIC_INC_NV(ulong, ulong_t)
|
||||||
/* END CSTYLED */
|
|
||||||
|
|
||||||
|
|
||||||
#define ATOMIC_DEC_NV(name, type) \
|
#define ATOMIC_DEC_NV(name, type) \
|
||||||
@ -177,7 +163,6 @@ ATOMIC_INC_NV(ulong, ulong_t)
|
|||||||
return (__atomic_sub_fetch(target, 1, __ATOMIC_SEQ_CST)); \
|
return (__atomic_sub_fetch(target, 1, __ATOMIC_SEQ_CST)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BEGIN CSTYLED */
|
|
||||||
ATOMIC_DEC_NV(8, uint8_t)
|
ATOMIC_DEC_NV(8, uint8_t)
|
||||||
ATOMIC_DEC_NV(16, uint16_t)
|
ATOMIC_DEC_NV(16, uint16_t)
|
||||||
ATOMIC_DEC_NV(32, uint32_t)
|
ATOMIC_DEC_NV(32, uint32_t)
|
||||||
@ -186,7 +171,6 @@ ATOMIC_DEC_NV(uchar, uchar_t)
|
|||||||
ATOMIC_DEC_NV(ushort, ushort_t)
|
ATOMIC_DEC_NV(ushort, ushort_t)
|
||||||
ATOMIC_DEC_NV(uint, uint_t)
|
ATOMIC_DEC_NV(uint, uint_t)
|
||||||
ATOMIC_DEC_NV(ulong, ulong_t)
|
ATOMIC_DEC_NV(ulong, ulong_t)
|
||||||
/* END CSTYLED */
|
|
||||||
|
|
||||||
|
|
||||||
#define ATOMIC_ADD_NV(name, type1, type2) \
|
#define ATOMIC_ADD_NV(name, type1, type2) \
|
||||||
@ -201,7 +185,6 @@ atomic_add_ptr_nv(volatile void *target, ssize_t bits)
|
|||||||
return (__atomic_add_fetch((void **)target, bits, __ATOMIC_SEQ_CST));
|
return (__atomic_add_fetch((void **)target, bits, __ATOMIC_SEQ_CST));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BEGIN CSTYLED */
|
|
||||||
ATOMIC_ADD_NV(8, uint8_t, int8_t)
|
ATOMIC_ADD_NV(8, uint8_t, int8_t)
|
||||||
ATOMIC_ADD_NV(16, uint16_t, int16_t)
|
ATOMIC_ADD_NV(16, uint16_t, int16_t)
|
||||||
ATOMIC_ADD_NV(32, uint32_t, int32_t)
|
ATOMIC_ADD_NV(32, uint32_t, int32_t)
|
||||||
@ -210,7 +193,6 @@ ATOMIC_ADD_NV(char, uchar_t, signed char)
|
|||||||
ATOMIC_ADD_NV(short, ushort_t, short)
|
ATOMIC_ADD_NV(short, ushort_t, short)
|
||||||
ATOMIC_ADD_NV(int, uint_t, int)
|
ATOMIC_ADD_NV(int, uint_t, int)
|
||||||
ATOMIC_ADD_NV(long, ulong_t, long)
|
ATOMIC_ADD_NV(long, ulong_t, long)
|
||||||
/* END CSTYLED */
|
|
||||||
|
|
||||||
|
|
||||||
#define ATOMIC_SUB_NV(name, type1, type2) \
|
#define ATOMIC_SUB_NV(name, type1, type2) \
|
||||||
@ -225,7 +207,6 @@ atomic_sub_ptr_nv(volatile void *target, ssize_t bits)
|
|||||||
return (__atomic_sub_fetch((void **)target, bits, __ATOMIC_SEQ_CST));
|
return (__atomic_sub_fetch((void **)target, bits, __ATOMIC_SEQ_CST));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BEGIN CSTYLED */
|
|
||||||
ATOMIC_SUB_NV(8, uint8_t, int8_t)
|
ATOMIC_SUB_NV(8, uint8_t, int8_t)
|
||||||
ATOMIC_SUB_NV(char, uchar_t, signed char)
|
ATOMIC_SUB_NV(char, uchar_t, signed char)
|
||||||
ATOMIC_SUB_NV(16, uint16_t, int16_t)
|
ATOMIC_SUB_NV(16, uint16_t, int16_t)
|
||||||
@ -234,7 +215,6 @@ ATOMIC_SUB_NV(32, uint32_t, int32_t)
|
|||||||
ATOMIC_SUB_NV(int, uint_t, int)
|
ATOMIC_SUB_NV(int, uint_t, int)
|
||||||
ATOMIC_SUB_NV(long, ulong_t, long)
|
ATOMIC_SUB_NV(long, ulong_t, long)
|
||||||
ATOMIC_SUB_NV(64, uint64_t, int64_t)
|
ATOMIC_SUB_NV(64, uint64_t, int64_t)
|
||||||
/* END CSTYLED */
|
|
||||||
|
|
||||||
|
|
||||||
#define ATOMIC_OR_NV(name, type) \
|
#define ATOMIC_OR_NV(name, type) \
|
||||||
@ -243,7 +223,6 @@ ATOMIC_SUB_NV(64, uint64_t, int64_t)
|
|||||||
return (__atomic_or_fetch(target, bits, __ATOMIC_SEQ_CST)); \
|
return (__atomic_or_fetch(target, bits, __ATOMIC_SEQ_CST)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BEGIN CSTYLED */
|
|
||||||
ATOMIC_OR_NV(8, uint8_t)
|
ATOMIC_OR_NV(8, uint8_t)
|
||||||
ATOMIC_OR_NV(16, uint16_t)
|
ATOMIC_OR_NV(16, uint16_t)
|
||||||
ATOMIC_OR_NV(32, uint32_t)
|
ATOMIC_OR_NV(32, uint32_t)
|
||||||
@ -252,7 +231,6 @@ ATOMIC_OR_NV(uchar, uchar_t)
|
|||||||
ATOMIC_OR_NV(ushort, ushort_t)
|
ATOMIC_OR_NV(ushort, ushort_t)
|
||||||
ATOMIC_OR_NV(uint, uint_t)
|
ATOMIC_OR_NV(uint, uint_t)
|
||||||
ATOMIC_OR_NV(ulong, ulong_t)
|
ATOMIC_OR_NV(ulong, ulong_t)
|
||||||
/* END CSTYLED */
|
|
||||||
|
|
||||||
|
|
||||||
#define ATOMIC_AND_NV(name, type) \
|
#define ATOMIC_AND_NV(name, type) \
|
||||||
@ -261,7 +239,6 @@ ATOMIC_OR_NV(ulong, ulong_t)
|
|||||||
return (__atomic_and_fetch(target, bits, __ATOMIC_SEQ_CST)); \
|
return (__atomic_and_fetch(target, bits, __ATOMIC_SEQ_CST)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BEGIN CSTYLED */
|
|
||||||
ATOMIC_AND_NV(8, uint8_t)
|
ATOMIC_AND_NV(8, uint8_t)
|
||||||
ATOMIC_AND_NV(16, uint16_t)
|
ATOMIC_AND_NV(16, uint16_t)
|
||||||
ATOMIC_AND_NV(32, uint32_t)
|
ATOMIC_AND_NV(32, uint32_t)
|
||||||
@ -270,7 +247,6 @@ ATOMIC_AND_NV(uchar, uchar_t)
|
|||||||
ATOMIC_AND_NV(ushort, ushort_t)
|
ATOMIC_AND_NV(ushort, ushort_t)
|
||||||
ATOMIC_AND_NV(uint, uint_t)
|
ATOMIC_AND_NV(uint, uint_t)
|
||||||
ATOMIC_AND_NV(ulong, ulong_t)
|
ATOMIC_AND_NV(ulong, ulong_t)
|
||||||
/* END CSTYLED */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -300,7 +276,6 @@ atomic_cas_ptr(volatile void *target, void *exp, void *des)
|
|||||||
return (exp);
|
return (exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BEGIN CSTYLED */
|
|
||||||
ATOMIC_CAS(8, uint8_t)
|
ATOMIC_CAS(8, uint8_t)
|
||||||
ATOMIC_CAS(16, uint16_t)
|
ATOMIC_CAS(16, uint16_t)
|
||||||
ATOMIC_CAS(32, uint32_t)
|
ATOMIC_CAS(32, uint32_t)
|
||||||
@ -309,7 +284,6 @@ ATOMIC_CAS(uchar, uchar_t)
|
|||||||
ATOMIC_CAS(ushort, ushort_t)
|
ATOMIC_CAS(ushort, ushort_t)
|
||||||
ATOMIC_CAS(uint, uint_t)
|
ATOMIC_CAS(uint, uint_t)
|
||||||
ATOMIC_CAS(ulong, ulong_t)
|
ATOMIC_CAS(ulong, ulong_t)
|
||||||
/* END CSTYLED */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -322,7 +296,6 @@ ATOMIC_CAS(ulong, ulong_t)
|
|||||||
return (__atomic_exchange_n(target, bits, __ATOMIC_SEQ_CST)); \
|
return (__atomic_exchange_n(target, bits, __ATOMIC_SEQ_CST)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BEGIN CSTYLED */
|
|
||||||
ATOMIC_SWAP(8, uint8_t)
|
ATOMIC_SWAP(8, uint8_t)
|
||||||
ATOMIC_SWAP(16, uint16_t)
|
ATOMIC_SWAP(16, uint16_t)
|
||||||
ATOMIC_SWAP(32, uint32_t)
|
ATOMIC_SWAP(32, uint32_t)
|
||||||
@ -331,7 +304,6 @@ ATOMIC_SWAP(uchar, uchar_t)
|
|||||||
ATOMIC_SWAP(ushort, ushort_t)
|
ATOMIC_SWAP(ushort, ushort_t)
|
||||||
ATOMIC_SWAP(uint, uint_t)
|
ATOMIC_SWAP(uint, uint_t)
|
||||||
ATOMIC_SWAP(ulong, ulong_t)
|
ATOMIC_SWAP(ulong, ulong_t)
|
||||||
/* END CSTYLED */
|
|
||||||
|
|
||||||
void *
|
void *
|
||||||
atomic_swap_ptr(volatile void *target, void *bits)
|
atomic_swap_ptr(volatile void *target, void *bits)
|
||||||
|
@ -25,19 +25,32 @@
|
|||||||
|
|
||||||
#include <sys/backtrace.h>
|
#include <sys/backtrace.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/debug.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* libspl_backtrace() must be safe to call from inside a signal hander. This
|
* Output helpers. libspl_backtrace() must not block, must be thread-safe and
|
||||||
* mostly means it must not allocate, and so we can't use things like printf.
|
* must be safe to call from a signal handler. At least, that means not having
|
||||||
|
* printf, so we end up having to call write() directly on the fd. That's
|
||||||
|
* awkward, as we always have to pass through a length, and some systems will
|
||||||
|
* complain if we don't consume the return. So we have some macros to make
|
||||||
|
* things a little more palatable.
|
||||||
*/
|
*/
|
||||||
|
#define spl_bt_write_n(fd, s, n) \
|
||||||
|
do { ssize_t r __maybe_unused = write(fd, s, n); } while (0)
|
||||||
|
#define spl_bt_write(fd, s) spl_bt_write_n(fd, s, sizeof (s)-1)
|
||||||
|
|
||||||
#if defined(HAVE_LIBUNWIND)
|
#if defined(HAVE_LIBUNWIND)
|
||||||
#define UNW_LOCAL_ONLY
|
#define UNW_LOCAL_ONLY
|
||||||
#include <libunwind.h>
|
#include <libunwind.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert `v` to ASCII hex characters. The bottom `n` nybbles (4-bits ie one
|
||||||
|
* hex digit) will be written, up to `buflen`. The buffer will not be
|
||||||
|
* null-terminated. Returns the number of digits written.
|
||||||
|
*/
|
||||||
static size_t
|
static size_t
|
||||||
libspl_u64_to_hex_str(uint64_t v, size_t digits, char *buf, size_t buflen)
|
spl_bt_u64_to_hex_str(uint64_t v, size_t n, char *buf, size_t buflen)
|
||||||
{
|
{
|
||||||
static const char hexdigits[] = {
|
static const char hexdigits[] = {
|
||||||
'0', '1', '2', '3', '4', '5', '6', '7',
|
'0', '1', '2', '3', '4', '5', '6', '7',
|
||||||
@ -45,10 +58,10 @@ libspl_u64_to_hex_str(uint64_t v, size_t digits, char *buf, size_t buflen)
|
|||||||
};
|
};
|
||||||
|
|
||||||
size_t pos = 0;
|
size_t pos = 0;
|
||||||
boolean_t want = (digits == 0);
|
boolean_t want = (n == 0);
|
||||||
for (int i = 15; i >= 0; i--) {
|
for (int i = 15; i >= 0; i--) {
|
||||||
const uint64_t d = v >> (i * 4) & 0xf;
|
const uint64_t d = v >> (i * 4) & 0xf;
|
||||||
if (!want && (d != 0 || digits > i))
|
if (!want && (d != 0 || n > i))
|
||||||
want = B_TRUE;
|
want = B_TRUE;
|
||||||
if (want) {
|
if (want) {
|
||||||
buf[pos++] = hexdigits[d];
|
buf[pos++] = hexdigits[d];
|
||||||
@ -62,40 +75,181 @@ libspl_u64_to_hex_str(uint64_t v, size_t digits, char *buf, size_t buflen)
|
|||||||
void
|
void
|
||||||
libspl_backtrace(int fd)
|
libspl_backtrace(int fd)
|
||||||
{
|
{
|
||||||
ssize_t ret __attribute__((unused));
|
|
||||||
unw_context_t uc;
|
unw_context_t uc;
|
||||||
unw_cursor_t cp;
|
unw_cursor_t cp;
|
||||||
unw_word_t loc;
|
unw_word_t v;
|
||||||
char buf[128];
|
char buf[128];
|
||||||
size_t n;
|
size_t n;
|
||||||
|
int err;
|
||||||
|
|
||||||
ret = write(fd, "Call trace:\n", 12);
|
/* Snapshot the current frame and state. */
|
||||||
unw_getcontext(&uc);
|
unw_getcontext(&uc);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TODO: walk back to the frame that tripped the assertion / the place
|
||||||
|
* where the signal was recieved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Register dump. We're going to loop over all the registers in the
|
||||||
|
* top frame, and show them, with names, in a nice three-column
|
||||||
|
* layout, which keeps us within 80 columns.
|
||||||
|
*/
|
||||||
|
spl_bt_write(fd, "Registers:\n");
|
||||||
|
|
||||||
|
/* Initialise a frame cursor, starting at the current frame */
|
||||||
unw_init_local(&cp, &uc);
|
unw_init_local(&cp, &uc);
|
||||||
while (unw_step(&cp) > 0) {
|
|
||||||
unw_get_reg(&cp, UNW_REG_IP, &loc);
|
/*
|
||||||
ret = write(fd, " [0x", 5);
|
* libunwind's list of possible registers for this architecture is an
|
||||||
n = libspl_u64_to_hex_str(loc, 10, buf, sizeof (buf));
|
* enum, unw_regnum_t. UNW_TDEP_LAST_REG is the highest-numbered
|
||||||
ret = write(fd, buf, n);
|
* register in that list, however, not all register numbers in this
|
||||||
ret = write(fd, "] ", 2);
|
* range are defined by the architecture, and not all defined registers
|
||||||
unw_get_proc_name(&cp, buf, sizeof (buf), &loc);
|
* will be present on every implementation of that architecture.
|
||||||
for (n = 0; n < sizeof (buf) && buf[n] != '\0'; n++) {}
|
* Moreover, libunwind provides nice names for most, but not all
|
||||||
ret = write(fd, buf, n);
|
* registers, but these are hardcoded; a name being available does not
|
||||||
ret = write(fd, "+0x", 3);
|
* mean that register is available.
|
||||||
n = libspl_u64_to_hex_str(loc, 2, buf, sizeof (buf));
|
*
|
||||||
ret = write(fd, buf, n);
|
* So, we have to pull this all together here. We try to get the value
|
||||||
#ifdef HAVE_LIBUNWIND_ELF
|
* of every possible register. If we get a value for it, then the
|
||||||
ret = write(fd, " (in ", 5);
|
* register must exist, and so we get its name. If libunwind has no
|
||||||
unw_get_elf_filename(&cp, buf, sizeof (buf), &loc);
|
* name for it, we synthesize something. These cases should be rare,
|
||||||
for (n = 0; n < sizeof (buf) && buf[n] != '\0'; n++) {}
|
* and they're usually for uninteresting or niche registers, so it
|
||||||
ret = write(fd, buf, n);
|
* shouldn't really matter. We can see the value, and that's the main
|
||||||
ret = write(fd, " +0x", 4);
|
* thing.
|
||||||
n = libspl_u64_to_hex_str(loc, 2, buf, sizeof (buf));
|
*/
|
||||||
ret = write(fd, buf, n);
|
uint_t cols = 0;
|
||||||
ret = write(fd, ")", 1);
|
for (uint_t regnum = 0; regnum <= UNW_TDEP_LAST_REG; regnum++) {
|
||||||
#endif
|
/*
|
||||||
ret = write(fd, "\n", 1);
|
* Get the value. Any error probably means the register
|
||||||
|
* doesn't exist, and we skip it.
|
||||||
|
*/
|
||||||
|
if (unw_get_reg(&cp, regnum, &v) < 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Register name. If libunwind doesn't have a name for it,
|
||||||
|
* it will return "???". As a shortcut, we just treat '?'
|
||||||
|
* is an alternate end-of-string character.
|
||||||
|
*/
|
||||||
|
const char *name = unw_regname(regnum);
|
||||||
|
for (n = 0; name[n] != '\0' && name[n] != '?'; n++) {}
|
||||||
|
if (n == 0) {
|
||||||
|
/*
|
||||||
|
* No valid name, so make one of the form "?xx", where
|
||||||
|
* "xx" is the two-char hex of libunwind's register
|
||||||
|
* number.
|
||||||
|
*/
|
||||||
|
buf[0] = '?';
|
||||||
|
n = spl_bt_u64_to_hex_str(regnum, 2,
|
||||||
|
&buf[1], sizeof (buf)-1) + 1;
|
||||||
|
name = buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Two spaces of padding before each column, plus extra
|
||||||
|
* spaces to align register names shorter than three chars.
|
||||||
|
*/
|
||||||
|
spl_bt_write_n(fd, " ", 5-MIN(n, 3));
|
||||||
|
|
||||||
|
/* Register name and column punctuation */
|
||||||
|
spl_bt_write_n(fd, name, n);
|
||||||
|
spl_bt_write(fd, ": 0x");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert register value (from unw_get_reg()) to hex. We're
|
||||||
|
* assuming that all registers are 64-bits wide, which is
|
||||||
|
* probably fine for any general-purpose registers on any
|
||||||
|
* machine currently in use. A more generic way would be to
|
||||||
|
* look at the width of unw_word_t, but that would also
|
||||||
|
* complicate the column code a bit. This is fine.
|
||||||
|
*/
|
||||||
|
n = spl_bt_u64_to_hex_str(v, 16, buf, sizeof (buf));
|
||||||
|
spl_bt_write_n(fd, buf, n);
|
||||||
|
|
||||||
|
/* Every third column, emit a newline */
|
||||||
|
if (!(++cols % 3))
|
||||||
|
spl_bt_write(fd, "\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If we finished before the third column, emit a newline. */
|
||||||
|
if (cols % 3)
|
||||||
|
spl_bt_write(fd, "\n");
|
||||||
|
|
||||||
|
/* Now the main event, the backtrace. */
|
||||||
|
spl_bt_write(fd, "Call trace:\n");
|
||||||
|
|
||||||
|
/* Reset the cursor to the top again. */
|
||||||
|
unw_init_local(&cp, &uc);
|
||||||
|
|
||||||
|
do {
|
||||||
|
/*
|
||||||
|
* Getting the IP should never fail; libunwind handles it
|
||||||
|
* specially, because its used a lot internally. Still, no
|
||||||
|
* point being silly about it, as the last thing we want is
|
||||||
|
* our crash handler to crash. So if it ever does fail, we'll
|
||||||
|
* show an error line, but keep going to the next frame.
|
||||||
|
*/
|
||||||
|
if (unw_get_reg(&cp, UNW_REG_IP, &v) < 0) {
|
||||||
|
spl_bt_write(fd, " [couldn't get IP register; "
|
||||||
|
"corrupt frame?]");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IP & punctuation */
|
||||||
|
n = spl_bt_u64_to_hex_str(v, 16, buf, sizeof (buf));
|
||||||
|
spl_bt_write(fd, " [0x");
|
||||||
|
spl_bt_write_n(fd, buf, n);
|
||||||
|
spl_bt_write(fd, "] ");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function ("procedure") name for the current frame. `v`
|
||||||
|
* receives the offset from the named function to the IP, which
|
||||||
|
* we show as a "+offset" suffix.
|
||||||
|
*
|
||||||
|
* If libunwind can't determine the name, we just show "???"
|
||||||
|
* instead. We've already displayed the IP above; that will
|
||||||
|
* have to do.
|
||||||
|
*
|
||||||
|
* unw_get_proc_name() will return ENOMEM if the buffer is too
|
||||||
|
* small, instead truncating the name. So we treat that as a
|
||||||
|
* success and use whatever is in the buffer.
|
||||||
|
*/
|
||||||
|
err = unw_get_proc_name(&cp, buf, sizeof (buf), &v);
|
||||||
|
if (err == 0 || err == -UNW_ENOMEM) {
|
||||||
|
for (n = 0; n < sizeof (buf) && buf[n] != '\0'; n++) {}
|
||||||
|
spl_bt_write_n(fd, buf, n);
|
||||||
|
|
||||||
|
/* Offset from proc name */
|
||||||
|
spl_bt_write(fd, "+0x");
|
||||||
|
n = spl_bt_u64_to_hex_str(v, 2, buf, sizeof (buf));
|
||||||
|
spl_bt_write_n(fd, buf, n);
|
||||||
|
} else
|
||||||
|
spl_bt_write(fd, "???");
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBUNWIND_ELF
|
||||||
|
/*
|
||||||
|
* Newer libunwind has unw_get_elf_filename(), which gets
|
||||||
|
* the name of the ELF object that the frame was executing in.
|
||||||
|
* Like `unw_get_proc_name()`, `v` recieves the offset within
|
||||||
|
* the file, and UNW_ENOMEM indicates that a truncate filename
|
||||||
|
* was left in the buffer.
|
||||||
|
*/
|
||||||
|
err = unw_get_elf_filename(&cp, buf, sizeof (buf), &v);
|
||||||
|
if (err == 0 || err == -UNW_ENOMEM) {
|
||||||
|
for (n = 0; n < sizeof (buf) && buf[n] != '\0'; n++) {}
|
||||||
|
spl_bt_write(fd, " (in ");
|
||||||
|
spl_bt_write_n(fd, buf, n);
|
||||||
|
|
||||||
|
/* Offset within file */
|
||||||
|
spl_bt_write(fd, " +0x");
|
||||||
|
n = spl_bt_u64_to_hex_str(v, 2, buf, sizeof (buf));
|
||||||
|
spl_bt_write_n(fd, buf, n);
|
||||||
|
spl_bt_write(fd, ")");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
spl_bt_write(fd, "\n");
|
||||||
|
} while (unw_step(&cp) > 0);
|
||||||
}
|
}
|
||||||
#elif defined(HAVE_BACKTRACE)
|
#elif defined(HAVE_BACKTRACE)
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
@ -103,15 +257,12 @@ libspl_backtrace(int fd)
|
|||||||
void
|
void
|
||||||
libspl_backtrace(int fd)
|
libspl_backtrace(int fd)
|
||||||
{
|
{
|
||||||
ssize_t ret __attribute__((unused));
|
|
||||||
void *btptrs[64];
|
void *btptrs[64];
|
||||||
size_t nptrs = backtrace(btptrs, 64);
|
size_t nptrs = backtrace(btptrs, 64);
|
||||||
ret = write(fd, "Call trace:\n", 12);
|
spl_bt_write(fd, "Call trace:\n");
|
||||||
backtrace_symbols_fd(btptrs, nptrs, fd);
|
backtrace_symbols_fd(btptrs, nptrs, fd);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#include <sys/debug.h>
|
|
||||||
|
|
||||||
void
|
void
|
||||||
libspl_backtrace(int fd __maybe_unused)
|
libspl_backtrace(int fd __maybe_unused)
|
||||||
{
|
{
|
||||||
|
@ -57,8 +57,7 @@ typedef enum zfs_uio_rw {
|
|||||||
} zfs_uio_rw_t;
|
} zfs_uio_rw_t;
|
||||||
|
|
||||||
typedef enum zfs_uio_seg {
|
typedef enum zfs_uio_seg {
|
||||||
UIO_USERSPACE = 0,
|
UIO_SYSSPACE = 0,
|
||||||
UIO_SYSSPACE = 1,
|
|
||||||
} zfs_uio_seg_t;
|
} zfs_uio_seg_t;
|
||||||
|
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__)
|
||||||
@ -92,20 +91,20 @@ zfs_dio_page_aligned(void *buf)
|
|||||||
static inline boolean_t
|
static inline boolean_t
|
||||||
zfs_dio_offset_aligned(uint64_t offset, uint64_t blksz)
|
zfs_dio_offset_aligned(uint64_t offset, uint64_t blksz)
|
||||||
{
|
{
|
||||||
return (IS_P2ALIGNED(offset, blksz));
|
return ((IS_P2ALIGNED(offset, blksz)) ? B_TRUE : B_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline boolean_t
|
static inline boolean_t
|
||||||
zfs_dio_size_aligned(uint64_t size, uint64_t blksz)
|
zfs_dio_size_aligned(uint64_t size, uint64_t blksz)
|
||||||
{
|
{
|
||||||
return ((size % blksz) == 0);
|
return (((size % blksz) == 0) ? B_TRUE : B_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline boolean_t
|
static inline boolean_t
|
||||||
zfs_dio_aligned(uint64_t offset, uint64_t size, uint64_t blksz)
|
zfs_dio_aligned(uint64_t offset, uint64_t size, uint64_t blksz)
|
||||||
{
|
{
|
||||||
return (zfs_dio_offset_aligned(offset, blksz) &&
|
return ((zfs_dio_offset_aligned(offset, blksz) &&
|
||||||
zfs_dio_size_aligned(size, blksz));
|
zfs_dio_size_aligned(size, blksz)) ? B_TRUE : B_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
@ -70,7 +70,7 @@ if BUILD_FREEBSD
|
|||||||
libzfs_la_LIBADD += -lutil -lgeom
|
libzfs_la_LIBADD += -lutil -lgeom
|
||||||
endif
|
endif
|
||||||
|
|
||||||
libzfs_la_LDFLAGS += -version-info 5:0:1
|
libzfs_la_LDFLAGS += -version-info 6:0:0
|
||||||
|
|
||||||
pkgconfig_DATA += %D%/libzfs.pc
|
pkgconfig_DATA += %D%/libzfs.pc
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<abi-corpus version='2.0' architecture='elf-amd-x86_64' soname='libzfs.so.4'>
|
<abi-corpus version='2.0' architecture='elf-amd-x86_64' soname='libzfs.so.6'>
|
||||||
<elf-needed>
|
<elf-needed>
|
||||||
<dependency name='libzfs_core.so.3'/>
|
<dependency name='libzfs_core.so.3'/>
|
||||||
<dependency name='libnvpair.so.3'/>
|
<dependency name='libnvpair.so.3'/>
|
||||||
@ -3132,7 +3132,8 @@
|
|||||||
<enumerator name='ZPOOL_PROP_DEDUP_TABLE_SIZE' value='36'/>
|
<enumerator name='ZPOOL_PROP_DEDUP_TABLE_SIZE' value='36'/>
|
||||||
<enumerator name='ZPOOL_PROP_DEDUP_TABLE_QUOTA' value='37'/>
|
<enumerator name='ZPOOL_PROP_DEDUP_TABLE_QUOTA' value='37'/>
|
||||||
<enumerator name='ZPOOL_PROP_DEDUPCACHED' value='38'/>
|
<enumerator name='ZPOOL_PROP_DEDUPCACHED' value='38'/>
|
||||||
<enumerator name='ZPOOL_NUM_PROPS' value='39'/>
|
<enumerator name='ZPOOL_PROP_LAST_SCRUBBED_TXG' value='39'/>
|
||||||
|
<enumerator name='ZPOOL_NUM_PROPS' value='40'/>
|
||||||
</enum-decl>
|
</enum-decl>
|
||||||
<typedef-decl name='zpool_prop_t' type-id='af1ba157' id='5d0c23fb'/>
|
<typedef-decl name='zpool_prop_t' type-id='af1ba157' id='5d0c23fb'/>
|
||||||
<typedef-decl name='regoff_t' type-id='95e97e5e' id='54a2a2a8'/>
|
<typedef-decl name='regoff_t' type-id='95e97e5e' id='54a2a2a8'/>
|
||||||
@ -5984,7 +5985,8 @@
|
|||||||
<underlying-type type-id='9cac1fee'/>
|
<underlying-type type-id='9cac1fee'/>
|
||||||
<enumerator name='POOL_SCRUB_NORMAL' value='0'/>
|
<enumerator name='POOL_SCRUB_NORMAL' value='0'/>
|
||||||
<enumerator name='POOL_SCRUB_PAUSE' value='1'/>
|
<enumerator name='POOL_SCRUB_PAUSE' value='1'/>
|
||||||
<enumerator name='POOL_SCRUB_FLAGS_END' value='2'/>
|
<enumerator name='POOL_SCRUB_FROM_LAST_TXG' value='2'/>
|
||||||
|
<enumerator name='POOL_SCRUB_FLAGS_END' value='3'/>
|
||||||
</enum-decl>
|
</enum-decl>
|
||||||
<typedef-decl name='pool_scrub_cmd_t' type-id='a1474cbd' id='b51cf3c2'/>
|
<typedef-decl name='pool_scrub_cmd_t' type-id='a1474cbd' id='b51cf3c2'/>
|
||||||
<enum-decl name='zpool_errata' id='d9abbf54'>
|
<enum-decl name='zpool_errata' id='d9abbf54'>
|
||||||
|
@ -563,8 +563,15 @@ change_one(zfs_handle_t *zhp, void *data)
|
|||||||
cn = NULL;
|
cn = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!clp->cl_alldependents)
|
if (!clp->cl_alldependents) {
|
||||||
ret = zfs_iter_children_v2(zhp, 0, change_one, data);
|
if (clp->cl_prop != ZFS_PROP_MOUNTPOINT) {
|
||||||
|
ret = zfs_iter_filesystems_v2(zhp, 0,
|
||||||
|
change_one, data);
|
||||||
|
} else {
|
||||||
|
ret = zfs_iter_children_v2(zhp, 0, change_one,
|
||||||
|
data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we added the handle to the changelist, we will re-use it
|
* If we added the handle to the changelist, we will re-use it
|
||||||
@ -738,6 +745,11 @@ changelist_gather(zfs_handle_t *zhp, zfs_prop_t prop, int gather_flags,
|
|||||||
changelist_free(clp);
|
changelist_free(clp);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
} else if (clp->cl_prop != ZFS_PROP_MOUNTPOINT) {
|
||||||
|
if (zfs_iter_filesystems_v2(zhp, 0, change_one, clp) != 0) {
|
||||||
|
changelist_free(clp);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
} else if (zfs_iter_children_v2(zhp, 0, change_one, clp) != 0) {
|
} else if (zfs_iter_children_v2(zhp, 0, change_one, clp) != 0) {
|
||||||
changelist_free(clp);
|
changelist_free(clp);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
@ -471,13 +471,15 @@ int
|
|||||||
zpool_get_userprop(zpool_handle_t *zhp, const char *propname, char *buf,
|
zpool_get_userprop(zpool_handle_t *zhp, const char *propname, char *buf,
|
||||||
size_t len, zprop_source_t *srctype)
|
size_t len, zprop_source_t *srctype)
|
||||||
{
|
{
|
||||||
nvlist_t *nv, *nvl;
|
nvlist_t *nv;
|
||||||
uint64_t ival;
|
uint64_t ival;
|
||||||
const char *value;
|
const char *value;
|
||||||
zprop_source_t source = ZPROP_SRC_LOCAL;
|
zprop_source_t source = ZPROP_SRC_LOCAL;
|
||||||
|
|
||||||
nvl = zhp->zpool_props;
|
if (zhp->zpool_props == NULL)
|
||||||
if (nvlist_lookup_nvlist(nvl, propname, &nv) == 0) {
|
zpool_get_all_props(zhp);
|
||||||
|
|
||||||
|
if (nvlist_lookup_nvlist(zhp->zpool_props, propname, &nv) == 0) {
|
||||||
if (nvlist_lookup_uint64(nv, ZPROP_SOURCE, &ival) == 0)
|
if (nvlist_lookup_uint64(nv, ZPROP_SOURCE, &ival) == 0)
|
||||||
source = ival;
|
source = ival;
|
||||||
verify(nvlist_lookup_string(nv, ZPROP_VALUE, &value) == 0);
|
verify(nvlist_lookup_string(nv, ZPROP_VALUE, &value) == 0);
|
||||||
@ -2796,7 +2798,7 @@ zpool_scan(zpool_handle_t *zhp, pool_scan_func_t func, pool_scrub_cmd_t cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* With EBUSY, five cases are possible:
|
* With EBUSY, six cases are possible:
|
||||||
*
|
*
|
||||||
* Current state Requested
|
* Current state Requested
|
||||||
* 1. Normal Scrub Running Normal Scrub or Error Scrub
|
* 1. Normal Scrub Running Normal Scrub or Error Scrub
|
||||||
@ -5340,7 +5342,8 @@ zpool_get_vdev_prop_value(nvlist_t *nvprop, vdev_prop_t prop, char *prop_name,
|
|||||||
strval = fnvlist_lookup_string(nv, ZPROP_VALUE);
|
strval = fnvlist_lookup_string(nv, ZPROP_VALUE);
|
||||||
} else {
|
} else {
|
||||||
/* user prop not found */
|
/* user prop not found */
|
||||||
return (-1);
|
src = ZPROP_SRC_DEFAULT;
|
||||||
|
strval = "-";
|
||||||
}
|
}
|
||||||
(void) strlcpy(buf, strval, len);
|
(void) strlcpy(buf, strval, len);
|
||||||
if (srctype)
|
if (srctype)
|
||||||
|
@ -932,6 +932,7 @@ libzfs_run_process_impl(const char *path, char *argv[], char *env[], int flags,
|
|||||||
pid = fork();
|
pid = fork();
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
/* Child process */
|
/* Child process */
|
||||||
|
setpgid(0, 0);
|
||||||
devnull_fd = open("/dev/null", O_WRONLY | O_CLOEXEC);
|
devnull_fd = open("/dev/null", O_WRONLY | O_CLOEXEC);
|
||||||
|
|
||||||
if (devnull_fd < 0)
|
if (devnull_fd < 0)
|
||||||
|
@ -212,7 +212,7 @@ if BUILD_FREEBSD
|
|||||||
libzpool_la_LIBADD += -lgeom
|
libzpool_la_LIBADD += -lgeom
|
||||||
endif
|
endif
|
||||||
|
|
||||||
libzpool_la_LDFLAGS += -version-info 5:0:0
|
libzpool_la_LDFLAGS += -version-info 6:0:0
|
||||||
|
|
||||||
if TARGET_CPU_POWERPC
|
if TARGET_CPU_POWERPC
|
||||||
module/zfs/libzpool_la-vdev_raidz_math_powerpc_altivec.$(OBJEXT) : CFLAGS += -maltivec
|
module/zfs/libzpool_la-vdev_raidz_math_powerpc_altivec.$(OBJEXT) : CFLAGS += -maltivec
|
||||||
|
@ -35,9 +35,25 @@ typedef struct zfs_dbgmsg {
|
|||||||
|
|
||||||
static list_t zfs_dbgmsgs;
|
static list_t zfs_dbgmsgs;
|
||||||
static kmutex_t zfs_dbgmsgs_lock;
|
static kmutex_t zfs_dbgmsgs_lock;
|
||||||
|
static uint_t zfs_dbgmsg_size = 0;
|
||||||
|
static uint_t zfs_dbgmsg_maxsize = 4<<20; /* 4MB */
|
||||||
|
|
||||||
int zfs_dbgmsg_enable = B_TRUE;
|
int zfs_dbgmsg_enable = B_TRUE;
|
||||||
|
|
||||||
|
static void
|
||||||
|
zfs_dbgmsg_purge(uint_t max_size)
|
||||||
|
{
|
||||||
|
while (zfs_dbgmsg_size > max_size) {
|
||||||
|
zfs_dbgmsg_t *zdm = list_remove_head(&zfs_dbgmsgs);
|
||||||
|
if (zdm == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
uint_t size = zdm->zdm_size;
|
||||||
|
kmem_free(zdm, size);
|
||||||
|
zfs_dbgmsg_size -= size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
zfs_dbgmsg_init(void)
|
zfs_dbgmsg_init(void)
|
||||||
{
|
{
|
||||||
@ -74,6 +90,8 @@ __zfs_dbgmsg(char *buf)
|
|||||||
|
|
||||||
mutex_enter(&zfs_dbgmsgs_lock);
|
mutex_enter(&zfs_dbgmsgs_lock);
|
||||||
list_insert_tail(&zfs_dbgmsgs, zdm);
|
list_insert_tail(&zfs_dbgmsgs, zdm);
|
||||||
|
zfs_dbgmsg_size += size;
|
||||||
|
zfs_dbgmsg_purge(zfs_dbgmsg_maxsize);
|
||||||
mutex_exit(&zfs_dbgmsgs_lock);
|
mutex_exit(&zfs_dbgmsgs_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 2024, Klara, Inc.
|
.\" Copyright (c) 2024, Klara, Inc.
|
||||||
.\"
|
.\"
|
||||||
.Dd October 2, 2024
|
.Dd November 1, 2024
|
||||||
.Dt ZFS 4
|
.Dt ZFS 4
|
||||||
.Os
|
.Os
|
||||||
.
|
.
|
||||||
@ -436,7 +436,7 @@ write.
|
|||||||
It can also help to identify if reported checksum errors are tied to Direct I/O
|
It can also help to identify if reported checksum errors are tied to Direct I/O
|
||||||
writes.
|
writes.
|
||||||
Each verify error causes a
|
Each verify error causes a
|
||||||
.Sy dio_verify
|
.Sy dio_verify_wr
|
||||||
zevent.
|
zevent.
|
||||||
Direct Write I/O checkum verify errors can be seen with
|
Direct Write I/O checkum verify errors can be seen with
|
||||||
.Nm zpool Cm status Fl d .
|
.Nm zpool Cm status Fl d .
|
||||||
@ -867,14 +867,14 @@ where that percent may exceed
|
|||||||
This
|
This
|
||||||
only operates during memory pressure/reclaim.
|
only operates during memory pressure/reclaim.
|
||||||
.
|
.
|
||||||
.It Sy zfs_arc_shrinker_limit Ns = Ns Sy 10000 Pq int
|
.It Sy zfs_arc_shrinker_limit Ns = Ns Sy 0 Pq int
|
||||||
This is a limit on how many pages the ARC shrinker makes available for
|
This is a limit on how many pages the ARC shrinker makes available for
|
||||||
eviction in response to one page allocation attempt.
|
eviction in response to one page allocation attempt.
|
||||||
Note that in practice, the kernel's shrinker can ask us to evict
|
Note that in practice, the kernel's shrinker can ask us to evict
|
||||||
up to about four times this for one allocation attempt.
|
up to about four times this for one allocation attempt.
|
||||||
To reduce OOM risk, this limit is applied for kswapd reclaims only.
|
To reduce OOM risk, this limit is applied for kswapd reclaims only.
|
||||||
.Pp
|
.Pp
|
||||||
The default limit of
|
For example a value of
|
||||||
.Sy 10000 Pq in practice, Em 160 MiB No per allocation attempt with 4 KiB pages
|
.Sy 10000 Pq in practice, Em 160 MiB No per allocation attempt with 4 KiB pages
|
||||||
limits the amount of time spent attempting to reclaim ARC memory to
|
limits the amount of time spent attempting to reclaim ARC memory to
|
||||||
less than 100 ms per allocation attempt,
|
less than 100 ms per allocation attempt,
|
||||||
@ -1333,9 +1333,10 @@ results in vector instructions
|
|||||||
from the respective CPU instruction set being used.
|
from the respective CPU instruction set being used.
|
||||||
.
|
.
|
||||||
.It Sy zfs_bclone_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
|
.It Sy zfs_bclone_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
|
||||||
Enable the experimental block cloning feature.
|
Enables access to the block cloning feature.
|
||||||
If this setting is 0, then even if feature@block_cloning is enabled,
|
If this setting is 0, then even if feature@block_cloning is enabled,
|
||||||
attempts to clone blocks will act as though the feature is disabled.
|
using functions and system calls that attempt to clone blocks will act as
|
||||||
|
though the feature is disabled.
|
||||||
.
|
.
|
||||||
.It Sy zfs_bclone_wait_dirty Ns = Ns Sy 0 Ns | Ns 1 Pq int
|
.It Sy zfs_bclone_wait_dirty Ns = Ns Sy 0 Ns | Ns 1 Pq int
|
||||||
When set to 1 the FICLONE and FICLONERANGE ioctls wait for dirty data to be
|
When set to 1 the FICLONE and FICLONERANGE ioctls wait for dirty data to be
|
||||||
|
@ -92,6 +92,11 @@ before a generic mapping for the same slot.
|
|||||||
In this way a custom mapping may be applied to a particular channel
|
In this way a custom mapping may be applied to a particular channel
|
||||||
and a default mapping applied to the others.
|
and a default mapping applied to the others.
|
||||||
.
|
.
|
||||||
|
.It Sy zpad_slot Ar digits
|
||||||
|
Pad slot numbers with zeros to make them
|
||||||
|
.Ar digits
|
||||||
|
long, which can help to make disk names a consistent length and easier to sort.
|
||||||
|
.
|
||||||
.It Sy multipath Sy yes Ns | Ns Sy no
|
.It Sy multipath Sy yes Ns | Ns Sy no
|
||||||
Specifies whether
|
Specifies whether
|
||||||
.Xr vdev_id 8
|
.Xr vdev_id 8
|
||||||
@ -122,7 +127,7 @@ device is connected to.
|
|||||||
The default is
|
The default is
|
||||||
.Sy 4 .
|
.Sy 4 .
|
||||||
.
|
.
|
||||||
.It Sy slot Sy bay Ns | Ns Sy phy Ns | Ns Sy port Ns | Ns Sy id Ns | Ns Sy lun Ns | Ns Sy ses
|
.It Sy slot Sy bay Ns | Ns Sy phy Ns | Ns Sy port Ns | Ns Sy id Ns | Ns Sy lun Ns | Ns Sy bay_lun Ns | Ns Sy ses
|
||||||
Specifies from which element of a SAS identifier the slot number is
|
Specifies from which element of a SAS identifier the slot number is
|
||||||
taken.
|
taken.
|
||||||
The default is
|
The default is
|
||||||
@ -138,6 +143,9 @@ use the SAS port as the slot number.
|
|||||||
use the scsi id as the slot number.
|
use the scsi id as the slot number.
|
||||||
.It Sy lun
|
.It Sy lun
|
||||||
use the scsi lun as the slot number.
|
use the scsi lun as the slot number.
|
||||||
|
.It Sy bay_lun
|
||||||
|
read the slot number from the bay identifier and append the lun number.
|
||||||
|
Useful for multi-lun multi-actuator hard drives.
|
||||||
.It Sy ses
|
.It Sy ses
|
||||||
use the SCSI Enclosure Services (SES) enclosure device slot number,
|
use the SCSI Enclosure Services (SES) enclosure device slot number,
|
||||||
as reported by
|
as reported by
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
.\" Copyright (c) 2021, Colm Buckley <colm@tuatha.org>
|
.\" Copyright (c) 2021, Colm Buckley <colm@tuatha.org>
|
||||||
.\" Copyright (c) 2023, Klara Inc.
|
.\" Copyright (c) 2023, Klara Inc.
|
||||||
.\"
|
.\"
|
||||||
.Dd July 29, 2024
|
.Dd November 18, 2024
|
||||||
.Dt ZPOOLPROPS 7
|
.Dt ZPOOLPROPS 7
|
||||||
.Os
|
.Os
|
||||||
.
|
.
|
||||||
@ -135,6 +135,19 @@ A unique identifier for the pool.
|
|||||||
The current health of the pool.
|
The current health of the pool.
|
||||||
Health can be one of
|
Health can be one of
|
||||||
.Sy ONLINE , DEGRADED , FAULTED , OFFLINE, REMOVED , UNAVAIL .
|
.Sy ONLINE , DEGRADED , FAULTED , OFFLINE, REMOVED , UNAVAIL .
|
||||||
|
.It Sy last_scrubbed_txg
|
||||||
|
Indicates the transaction group (TXG) up to which the most recent scrub
|
||||||
|
operation has checked and repaired the dataset.
|
||||||
|
This provides insight into the data integrity status of their pool at
|
||||||
|
a specific point in time.
|
||||||
|
.Xr zpool-scrub 8
|
||||||
|
can utilize this property to scan only data that has changed since the last
|
||||||
|
scrub completed, when given the
|
||||||
|
.Fl C
|
||||||
|
flag.
|
||||||
|
This property is not updated when performing an error scrub with the
|
||||||
|
.Fl e
|
||||||
|
flag.
|
||||||
.It Sy leaked
|
.It Sy leaked
|
||||||
Space not released while
|
Space not released while
|
||||||
.Sy freeing
|
.Sy freeing
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
.\" Copyright (c) 2017 Lawrence Livermore National Security, LLC.
|
.\" Copyright (c) 2017 Lawrence Livermore National Security, LLC.
|
||||||
.\" Copyright (c) 2017 Intel Corporation.
|
.\" Copyright (c) 2017 Intel Corporation.
|
||||||
.\"
|
.\"
|
||||||
.Dd November 18, 2023
|
.Dd October 27, 2024
|
||||||
.Dt ZDB 8
|
.Dt ZDB 8
|
||||||
.Os
|
.Os
|
||||||
.
|
.
|
||||||
@ -408,6 +408,8 @@ blocks cloned, the space saving as a result of cloning, and the saving ratio.
|
|||||||
.It Fl TT
|
.It Fl TT
|
||||||
Display the per-vdev BRT statistics, including total references.
|
Display the per-vdev BRT statistics, including total references.
|
||||||
.It Fl TTT
|
.It Fl TTT
|
||||||
|
Display histograms of per-vdev BRT refcounts.
|
||||||
|
.It Fl TTTT
|
||||||
Dump the contents of the block reference tables.
|
Dump the contents of the block reference tables.
|
||||||
.It Fl u , -uberblock
|
.It Fl u , -uberblock
|
||||||
Display the current uberblock.
|
Display the current uberblock.
|
||||||
|
@ -71,7 +71,7 @@ The following fields are displayed:
|
|||||||
Used for scripting mode.
|
Used for scripting mode.
|
||||||
Do not print headers and separate fields by a single tab instead of arbitrary
|
Do not print headers and separate fields by a single tab instead of arbitrary
|
||||||
white space.
|
white space.
|
||||||
.It Fl j Op Ar --json-int
|
.It Fl j , -json Op Ar --json-int
|
||||||
Print the output in JSON format.
|
Print the output in JSON format.
|
||||||
Specify
|
Specify
|
||||||
.Sy --json-int
|
.Sy --json-int
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
.Xc
|
.Xc
|
||||||
Displays all ZFS file systems currently mounted.
|
Displays all ZFS file systems currently mounted.
|
||||||
.Bl -tag -width "-j"
|
.Bl -tag -width "-j"
|
||||||
.It Fl j
|
.It Fl j , -json
|
||||||
Displays all mounted file systems in JSON format.
|
Displays all mounted file systems in JSON format.
|
||||||
.El
|
.El
|
||||||
.It Xo
|
.It Xo
|
||||||
|
@ -50,7 +50,7 @@ and any attempts to access or modify other pools will cause an error.
|
|||||||
.
|
.
|
||||||
.Sh OPTIONS
|
.Sh OPTIONS
|
||||||
.Bl -tag -width "-t"
|
.Bl -tag -width "-t"
|
||||||
.It Fl j
|
.It Fl j , -json
|
||||||
Display channel program output in JSON format.
|
Display channel program output in JSON format.
|
||||||
When this flag is specified and standard output is empty -
|
When this flag is specified and standard output is empty -
|
||||||
channel program encountered an error.
|
channel program encountered an error.
|
||||||
|
@ -130,7 +130,7 @@ The value
|
|||||||
can be used to display all properties that apply to the given dataset's type
|
can be used to display all properties that apply to the given dataset's type
|
||||||
.Pq Sy filesystem , volume , snapshot , No or Sy bookmark .
|
.Pq Sy filesystem , volume , snapshot , No or Sy bookmark .
|
||||||
.Bl -tag -width "-s source"
|
.Bl -tag -width "-s source"
|
||||||
.It Fl j Op Ar --json-int
|
.It Fl j , -json Op Ar --json-int
|
||||||
Display the output in JSON format.
|
Display the output in JSON format.
|
||||||
Specify
|
Specify
|
||||||
.Sy --json-int
|
.Sy --json-int
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.\" lint-ok: WARNING: sections out of conventional order: Sh SYNOPSIS
|
.\" lint-ok: WARNING: sections out of conventional order: Sh SYNOPSIS
|
||||||
.\"
|
.\"
|
||||||
.Dd April 4, 2024
|
.Dd December 2, 2024
|
||||||
.Dt ZINJECT 8
|
.Dt ZINJECT 8
|
||||||
.Os
|
.Os
|
||||||
.
|
.
|
||||||
@ -268,7 +268,7 @@ Run for this many seconds before reporting failure.
|
|||||||
.It Fl T Ar failure
|
.It Fl T Ar failure
|
||||||
Set the failure type to one of
|
Set the failure type to one of
|
||||||
.Sy all ,
|
.Sy all ,
|
||||||
.Sy ioctl ,
|
.Sy flush ,
|
||||||
.Sy claim ,
|
.Sy claim ,
|
||||||
.Sy free ,
|
.Sy free ,
|
||||||
.Sy read ,
|
.Sy read ,
|
||||||
|
@ -98,7 +98,10 @@ This can be an indicator of problems with the underlying storage device.
|
|||||||
The number of delay events is ratelimited by the
|
The number of delay events is ratelimited by the
|
||||||
.Sy zfs_slow_io_events_per_second
|
.Sy zfs_slow_io_events_per_second
|
||||||
module parameter.
|
module parameter.
|
||||||
.It Sy dio_verify
|
.It Sy dio_verify_rd
|
||||||
|
Issued when there was a checksum verify error after a Direct I/O read has been
|
||||||
|
issued.
|
||||||
|
.It Sy dio_verify_wr
|
||||||
Issued when there was a checksum verify error after a Direct I/O write has been
|
Issued when there was a checksum verify error after a Direct I/O write has been
|
||||||
issued.
|
issued.
|
||||||
This event can only take place if the module parameter
|
This event can only take place if the module parameter
|
||||||
|
@ -98,7 +98,7 @@ See the
|
|||||||
.Xr zpoolprops 7
|
.Xr zpoolprops 7
|
||||||
manual page for more information on the available pool properties.
|
manual page for more information on the available pool properties.
|
||||||
.Bl -tag -compact -offset Ds -width "-o field"
|
.Bl -tag -compact -offset Ds -width "-o field"
|
||||||
.It Fl j Op Ar --json-int, --json-pool-key-guid
|
.It Fl j , -json Op Ar --json-int, --json-pool-key-guid
|
||||||
Display the list of properties in JSON format.
|
Display the list of properties in JSON format.
|
||||||
Specify
|
Specify
|
||||||
.Sy --json-int
|
.Sy --json-int
|
||||||
@ -157,7 +157,7 @@ See the
|
|||||||
.Xr vdevprops 7
|
.Xr vdevprops 7
|
||||||
manual page for more information on the available pool properties.
|
manual page for more information on the available pool properties.
|
||||||
.Bl -tag -compact -offset Ds -width "-o field"
|
.Bl -tag -compact -offset Ds -width "-o field"
|
||||||
.It Fl j Op Ar --json-int
|
.It Fl j , -json Op Ar --json-int
|
||||||
Display the list of properties in JSON format.
|
Display the list of properties in JSON format.
|
||||||
Specify
|
Specify
|
||||||
.Sy --json-int
|
.Sy --json-int
|
||||||
|
@ -59,7 +59,7 @@ is specified, the command exits after
|
|||||||
.Ar count
|
.Ar count
|
||||||
reports are printed.
|
reports are printed.
|
||||||
.Bl -tag -width Ds
|
.Bl -tag -width Ds
|
||||||
.It Fl j Op Ar --json-int, --json-pool-key-guid
|
.It Fl j , -json Op Ar --json-int, --json-pool-key-guid
|
||||||
Display the list of pools in JSON format.
|
Display the list of pools in JSON format.
|
||||||
Specify
|
Specify
|
||||||
.Sy --json-int
|
.Sy --json-int
|
||||||
|
@ -109,7 +109,7 @@ Stops and cancels an in-progress removal of a top-level vdev.
|
|||||||
.El
|
.El
|
||||||
.
|
.
|
||||||
.Sh EXAMPLES
|
.Sh EXAMPLES
|
||||||
.\" These are, respectively, examples 14 from zpool.8
|
.\" These are, respectively, examples 15 from zpool.8
|
||||||
.\" Make sure to update them bidirectionally
|
.\" Make sure to update them bidirectionally
|
||||||
.Ss Example 1 : No Removing a Mirrored top-level (Log or Data) Device
|
.Ss Example 1 : No Removing a Mirrored top-level (Log or Data) Device
|
||||||
The following commands remove the mirrored log device
|
The following commands remove the mirrored log device
|
||||||
@ -142,9 +142,43 @@ The command to remove the mirrored log
|
|||||||
.Ar mirror-2 No is :
|
.Ar mirror-2 No is :
|
||||||
.Dl # Nm zpool Cm remove Ar tank mirror-2
|
.Dl # Nm zpool Cm remove Ar tank mirror-2
|
||||||
.Pp
|
.Pp
|
||||||
|
At this point, the log device no longer exists
|
||||||
|
(both sides of the mirror have been removed):
|
||||||
|
.Bd -literal -compact -offset Ds
|
||||||
|
pool: tank
|
||||||
|
state: ONLINE
|
||||||
|
scan: none requested
|
||||||
|
config:
|
||||||
|
|
||||||
|
NAME STATE READ WRITE CKSUM
|
||||||
|
tank ONLINE 0 0 0
|
||||||
|
mirror-0 ONLINE 0 0 0
|
||||||
|
sda ONLINE 0 0 0
|
||||||
|
sdb ONLINE 0 0 0
|
||||||
|
mirror-1 ONLINE 0 0 0
|
||||||
|
sdc ONLINE 0 0 0
|
||||||
|
sdd ONLINE 0 0 0
|
||||||
|
.Ed
|
||||||
|
.Pp
|
||||||
The command to remove the mirrored data
|
The command to remove the mirrored data
|
||||||
.Ar mirror-1 No is :
|
.Ar mirror-1 No is :
|
||||||
.Dl # Nm zpool Cm remove Ar tank mirror-1
|
.Dl # Nm zpool Cm remove Ar tank mirror-1
|
||||||
|
.Pp
|
||||||
|
After
|
||||||
|
.Ar mirror-1 No has been evacuated, the pool remains redundant, but
|
||||||
|
the total amount of space is reduced:
|
||||||
|
.Bd -literal -compact -offset Ds
|
||||||
|
pool: tank
|
||||||
|
state: ONLINE
|
||||||
|
scan: none requested
|
||||||
|
config:
|
||||||
|
|
||||||
|
NAME STATE READ WRITE CKSUM
|
||||||
|
tank ONLINE 0 0 0
|
||||||
|
mirror-0 ONLINE 0 0 0
|
||||||
|
sda ONLINE 0 0 0
|
||||||
|
sdb ONLINE 0 0 0
|
||||||
|
.Ed
|
||||||
.
|
.
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr zpool-add 8 ,
|
.Xr zpool-add 8 ,
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
.\" Copyright 2017 Nexenta Systems, Inc.
|
.\" Copyright 2017 Nexenta Systems, Inc.
|
||||||
.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
|
.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
|
||||||
.\"
|
.\"
|
||||||
.Dd June 22, 2023
|
.Dd November 18, 2024
|
||||||
.Dt ZPOOL-SCRUB 8
|
.Dt ZPOOL-SCRUB 8
|
||||||
.Os
|
.Os
|
||||||
.
|
.
|
||||||
@ -36,9 +36,8 @@
|
|||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm zpool
|
.Nm zpool
|
||||||
.Cm scrub
|
.Cm scrub
|
||||||
.Op Fl s Ns | Ns Fl p
|
.Op Ns Fl e | Ns Fl p | Fl s Ns | Fl C Ns
|
||||||
.Op Fl w
|
.Op Fl w
|
||||||
.Op Fl e
|
|
||||||
.Ar pool Ns …
|
.Ar pool Ns …
|
||||||
.
|
.
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
@ -114,6 +113,10 @@ The pool must have been scrubbed at least once with the
|
|||||||
feature enabled to use this option.
|
feature enabled to use this option.
|
||||||
Error scrubbing cannot be run simultaneously with regular scrubbing or
|
Error scrubbing cannot be run simultaneously with regular scrubbing or
|
||||||
resilvering, nor can it be run when a regular scrub is paused.
|
resilvering, nor can it be run when a regular scrub is paused.
|
||||||
|
.It Fl C
|
||||||
|
Continue scrub from last saved txg (see zpool
|
||||||
|
.Sy last_scrubbed_txg
|
||||||
|
property).
|
||||||
.El
|
.El
|
||||||
.Sh EXAMPLES
|
.Sh EXAMPLES
|
||||||
.Ss Example 1
|
.Ss Example 1
|
||||||
|
@ -70,7 +70,7 @@ See the
|
|||||||
option of
|
option of
|
||||||
.Nm zpool Cm iostat
|
.Nm zpool Cm iostat
|
||||||
for complete details.
|
for complete details.
|
||||||
.It Fl j Op Ar --json-int, --json-flat-vdevs, --json-pool-key-guid
|
.It Fl j , -json Op Ar --json-int, --json-flat-vdevs, --json-pool-key-guid
|
||||||
Display the status for ZFS pools in JSON format.
|
Display the status for ZFS pools in JSON format.
|
||||||
Specify
|
Specify
|
||||||
.Sy --json-int
|
.Sy --json-int
|
||||||
@ -82,14 +82,18 @@ Specify
|
|||||||
.Sy --json-pool-key-guid
|
.Sy --json-pool-key-guid
|
||||||
to set pool GUID as key for pool objects instead of pool names.
|
to set pool GUID as key for pool objects instead of pool names.
|
||||||
.It Fl d
|
.It Fl d
|
||||||
Display the number of Direct I/O write checksum verify errors that have occured
|
Display the number of Direct I/O read/write checksum verify errors that have
|
||||||
on a top-level VDEV.
|
occured on a top-level VDEV.
|
||||||
See
|
See
|
||||||
.Sx zfs_vdev_direct_write_verify
|
.Sx zfs_vdev_direct_write_verify
|
||||||
in
|
in
|
||||||
.Xr zfs 4
|
.Xr zfs 4
|
||||||
for details about the conditions that can cause Direct I/O write checksum
|
for details about the conditions that can cause Direct I/O write checksum
|
||||||
verify failures to occur.
|
verify failures to occur.
|
||||||
|
Direct I/O reads checksum verify errors can also occur if the contents of the
|
||||||
|
buffer are being manipulated after the I/O has been issued and is in flight.
|
||||||
|
In the case of Direct I/O read checksum verify errors, the I/O will be reissued
|
||||||
|
through the ARC.
|
||||||
.It Fl D
|
.It Fl D
|
||||||
Display a histogram of deduplication statistics, showing the allocated
|
Display a histogram of deduplication statistics, showing the allocated
|
||||||
.Pq physically present on disk
|
.Pq physically present on disk
|
||||||
|
@ -405,9 +405,43 @@ The command to remove the mirrored log
|
|||||||
.Ar mirror-2 No is :
|
.Ar mirror-2 No is :
|
||||||
.Dl # Nm zpool Cm remove Ar tank mirror-2
|
.Dl # Nm zpool Cm remove Ar tank mirror-2
|
||||||
.Pp
|
.Pp
|
||||||
|
At this point, the log device no longer exists
|
||||||
|
(both sides of the mirror have been removed):
|
||||||
|
.Bd -literal -compact -offset Ds
|
||||||
|
pool: tank
|
||||||
|
state: ONLINE
|
||||||
|
scan: none requested
|
||||||
|
config:
|
||||||
|
|
||||||
|
NAME STATE READ WRITE CKSUM
|
||||||
|
tank ONLINE 0 0 0
|
||||||
|
mirror-0 ONLINE 0 0 0
|
||||||
|
sda ONLINE 0 0 0
|
||||||
|
sdb ONLINE 0 0 0
|
||||||
|
mirror-1 ONLINE 0 0 0
|
||||||
|
sdc ONLINE 0 0 0
|
||||||
|
sdd ONLINE 0 0 0
|
||||||
|
.Ed
|
||||||
|
.Pp
|
||||||
The command to remove the mirrored data
|
The command to remove the mirrored data
|
||||||
.Ar mirror-1 No is :
|
.Ar mirror-1 No is :
|
||||||
.Dl # Nm zpool Cm remove Ar tank mirror-1
|
.Dl # Nm zpool Cm remove Ar tank mirror-1
|
||||||
|
.Pp
|
||||||
|
After
|
||||||
|
.Ar mirror-1 No has been evacuated, the pool remains redundant, but
|
||||||
|
the total amount of space is reduced:
|
||||||
|
.Bd -literal -compact -offset Ds
|
||||||
|
pool: tank
|
||||||
|
state: ONLINE
|
||||||
|
scan: none requested
|
||||||
|
config:
|
||||||
|
|
||||||
|
NAME STATE READ WRITE CKSUM
|
||||||
|
tank ONLINE 0 0 0
|
||||||
|
mirror-0 ONLINE 0 0 0
|
||||||
|
sda ONLINE 0 0 0
|
||||||
|
sdb ONLINE 0 0 0
|
||||||
|
.Ed
|
||||||
.
|
.
|
||||||
.Ss Example 16 : No Displaying expanded space on a device
|
.Ss Example 16 : No Displaying expanded space on a device
|
||||||
The following command displays the detailed information for the pool
|
The following command displays the detailed information for the pool
|
||||||
|
@ -55,6 +55,8 @@ modules-Linux:
|
|||||||
mkdir -p $(sort $(dir $(zfs-objs) $(zfs-)))
|
mkdir -p $(sort $(dir $(zfs-objs) $(zfs-)))
|
||||||
$(MAKE) -C @LINUX_OBJ@ $(if @KERNEL_CC@,CC=@KERNEL_CC@) \
|
$(MAKE) -C @LINUX_OBJ@ $(if @KERNEL_CC@,CC=@KERNEL_CC@) \
|
||||||
$(if @KERNEL_LD@,LD=@KERNEL_LD@) $(if @KERNEL_LLVM@,LLVM=@KERNEL_LLVM@) \
|
$(if @KERNEL_LD@,LD=@KERNEL_LD@) $(if @KERNEL_LLVM@,LLVM=@KERNEL_LLVM@) \
|
||||||
|
$(if @KERNEL_CROSS_COMPILE@,CROSS_COMPILE=@KERNEL_CROSS_COMPILE@) \
|
||||||
|
$(if @KERNEL_ARCH@,ARCH=@KERNEL_ARCH@) \
|
||||||
M="$$PWD" @KERNEL_MAKE@ CONFIG_ZFS=m modules
|
M="$$PWD" @KERNEL_MAKE@ CONFIG_ZFS=m modules
|
||||||
|
|
||||||
modules-FreeBSD:
|
modules-FreeBSD:
|
||||||
|
@ -3281,7 +3281,6 @@ nvs_xdr_nvp_##type(XDR *xdrs, void *ptr, ...) \
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* BEGIN CSTYLED */
|
|
||||||
NVS_BUILD_XDRPROC_T(char);
|
NVS_BUILD_XDRPROC_T(char);
|
||||||
NVS_BUILD_XDRPROC_T(short);
|
NVS_BUILD_XDRPROC_T(short);
|
||||||
NVS_BUILD_XDRPROC_T(u_short);
|
NVS_BUILD_XDRPROC_T(u_short);
|
||||||
@ -3289,7 +3288,6 @@ NVS_BUILD_XDRPROC_T(int);
|
|||||||
NVS_BUILD_XDRPROC_T(u_int);
|
NVS_BUILD_XDRPROC_T(u_int);
|
||||||
NVS_BUILD_XDRPROC_T(longlong_t);
|
NVS_BUILD_XDRPROC_T(longlong_t);
|
||||||
NVS_BUILD_XDRPROC_T(u_longlong_t);
|
NVS_BUILD_XDRPROC_T(u_longlong_t);
|
||||||
/* END CSTYLED */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The format of xdr encoded nvpair is:
|
* The format of xdr encoded nvpair is:
|
||||||
|
@ -31,5 +31,4 @@
|
|||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
#include <sys/sdt.h>
|
#include <sys/sdt.h>
|
||||||
|
|
||||||
/* CSTYLED */
|
|
||||||
SDT_PROBE_DEFINE1(sdt, , , set__error, "int");
|
SDT_PROBE_DEFINE1(sdt, , , set__error, "int");
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user