mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 19:57:43 +03:00
Compare commits
177 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 34f96a15c7 | |||
| fdb5078d82 | |||
| 8cca55f18b | |||
| ef1ee9421d | |||
| 435006d81d | |||
| 725886d67a | |||
| bce049389d | |||
| c3d74a0d6f | |||
| 9cf069b366 | |||
| 3f87c9c276 | |||
| 9d14ce4db7 | |||
| 3b64a9619f | |||
| a072611eef | |||
| 0fe10361ba | |||
| 3e78905ffb | |||
| 46de04d2e9 | |||
| 41ca2296cd | |||
| 9651668457 | |||
| a49c957299 | |||
| d1d706350e | |||
| 11f844175e | |||
| 57b614e025 | |||
| 0c7d6e20e6 | |||
| b9c45fe68c | |||
| f72226a75c | |||
| 97fe86837c | |||
| df5e02d253 | |||
| 245adb6a4f | |||
| 82a0868ce4 | |||
| e7e0bb3b61 | |||
| 6af1f61ad4 | |||
| 8c4f625c12 | |||
| 7882e85a9b | |||
| 6b38d0f7ff | |||
| 80b6457fcd | |||
| 2518f4b124 | |||
| 90d2c4407a | |||
| f7698f47e8 | |||
| 6c1130a730 | |||
| 74b539d3dc | |||
| 024e60b927 | |||
| 5289f6f961 | |||
| 094305c937 | |||
| a826f7a993 | |||
| 86bf73c1eb | |||
| 1d293b377a | |||
| 22eb2bdce3 | |||
| 809b553940 | |||
| abb6211e7a | |||
| c405a7a35c | |||
| 4808641e71 | |||
| 30fa92bff3 | |||
| fd5a27c9db | |||
| 3ad3f439bb | |||
| a46ce73ca8 | |||
| 90790955a6 | |||
| 95abbc71c3 | |||
| fc658b9935 | |||
| 271b9797c5 | |||
| 582e7847f6 | |||
| 6d378564b4 | |||
| 0c928f7a37 | |||
| c79d5e4f33 | |||
| 347d68048a | |||
| acf3871ef8 | |||
| 21d5f25724 | |||
| 7e945a5b3f | |||
| 85ce6b8ab2 | |||
| 954894ee53 | |||
| a4e775d2ca | |||
| 661310ff5c | |||
| f9d59b579e | |||
| 1af41fd203 | |||
| faefa5ffc3 | |||
| 777d8ee345 | |||
| b00bc81b05 | |||
| f7e6dcc68d | |||
| e2de00ca44 | |||
| 8e9ffe1b4f | |||
| 6b67a5bdd3 | |||
| 4f1b91e343 | |||
| a65225ec7e | |||
| 9c0f5bc183 | |||
| e1dd433a44 | |||
| 08cec6532e | |||
| d944641502 | |||
| c758072b2f | |||
| 0c9cdd1606 | |||
| 23fad19818 | |||
| 3897e86bd1 | |||
| 4c8d0471fa | |||
| ea3a600bba | |||
| e9c1e08e07 | |||
| 1688d9991d | |||
| e0ad633c64 | |||
| da4dfa85eb | |||
| 7be33d2d40 | |||
| bf4baee81e | |||
| e93d15f112 | |||
| f292b0f146 | |||
| bda0bc6304 | |||
| 04493ca819 | |||
| 2c53fe7764 | |||
| d7bb6bbf13 | |||
| b8f80812a3 | |||
| 97696962b5 | |||
| 06fd6dc6f7 | |||
| 28ff5ff1c6 | |||
| e9002887e2 | |||
| 840b070ec7 | |||
| d02d3add0d | |||
| cc5724f38d | |||
| 8317244270 | |||
| 65cf521353 | |||
| 08caad8257 | |||
| d187e3e1a7 | |||
| 1215c3b609 | |||
| 2fe0d5df94 | |||
| fa545db846 | |||
| cfb9cba51c | |||
| b647336cc4 | |||
| b9324a1e75 | |||
| 64e77fdf3b | |||
| fd13ad0503 | |||
| b9f5227d2b | |||
| b7d14266f1 | |||
| 13768f46e6 | |||
| 999717c5ac | |||
| 25ad9ce692 | |||
| 6b70ca665d | |||
| 8c0f7619b2 | |||
| e64d4718a7 | |||
| a4de1d38da | |||
| f28c685a84 | |||
| 6517ebf4da | |||
| 97c1fb6ad5 | |||
| db290fd48b | |||
| a2bcf194f8 | |||
| 280c3c3ace | |||
| 2e1f95b6bc | |||
| 0dc3656a55 | |||
| f8bad9b1f9 | |||
| 56a61d54f4 | |||
| 1c11d3a54f | |||
| db988fabfb | |||
| fa2cdaa604 | |||
| 51ed9640e9 | |||
| 9b446fbb60 | |||
| ce9cd12c97 | |||
| 52749ebb49 | |||
| 101edf7ed9 | |||
| a2593c1610 | |||
| fcc7259789 | |||
| 4b014840ea | |||
| cd777ba5ad | |||
| ad63ab2d90 | |||
| edae295af9 | |||
| c85f2fd531 | |||
| aa9335bbbc | |||
| 4f34e8dcf6 | |||
| a33e8b05ee | |||
| fbff1ae9f6 | |||
| 273db246a4 | |||
| 28f0c5cfdc | |||
| a77d641f01 | |||
| 0956fd736c | |||
| 7bb7ff7b49 | |||
| 658526db99 | |||
| b590bfc6c8 | |||
| 03ac770008 | |||
| 95df01020d | |||
| 243a46f28d | |||
| 7fde3933fb | |||
| c2424f8d1a | |||
| 40b9ad19cc | |||
| 602fecc316 | |||
| 588fa16830 |
-21
@@ -1,21 +0,0 @@
|
|||||||
env:
|
|
||||||
CIRRUS_CLONE_DEPTH: 1
|
|
||||||
ARCH: amd64
|
|
||||||
|
|
||||||
build_task:
|
|
||||||
matrix:
|
|
||||||
freebsd_instance:
|
|
||||||
image_family: freebsd-13-5
|
|
||||||
freebsd_instance:
|
|
||||||
image_family: freebsd-14-2
|
|
||||||
freebsd_instance:
|
|
||||||
image_family: freebsd-15-0-snap
|
|
||||||
prepare_script:
|
|
||||||
- pkg install -y autoconf automake libtool gettext-runtime gmake ksh93 py311-packaging py311-cffi py311-sysctl
|
|
||||||
configure_script:
|
|
||||||
- env MAKE=gmake ./autogen.sh
|
|
||||||
- env MAKE=gmake ./configure --with-config="user" --with-python=3.11
|
|
||||||
build_script:
|
|
||||||
- gmake -j `sysctl -n kern.smp.cpus`
|
|
||||||
install_script:
|
|
||||||
- gmake install
|
|
||||||
@@ -27,6 +27,7 @@ https://openzfs.github.io/openzfs-docs/Developer%20Resources/Buildbot%20Options.
|
|||||||
- [ ] New feature (non-breaking change which adds functionality)
|
- [ ] New feature (non-breaking change which adds functionality)
|
||||||
- [ ] Performance enhancement (non-breaking change which improves efficiency)
|
- [ ] Performance enhancement (non-breaking change which improves efficiency)
|
||||||
- [ ] Code cleanup (non-breaking change which makes code smaller or more readable)
|
- [ ] Code cleanup (non-breaking change which makes code smaller or more readable)
|
||||||
|
- [ ] Quality assurance (non-breaking change which makes the code more robust against bugs)
|
||||||
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
|
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
|
||||||
- [ ] Library ABI change (libzfs, libzfs\_core, libnvpair, libuutil and libzfsbootenv)
|
- [ ] Library ABI change (libzfs, libzfs\_core, libnvpair, libuutil and libzfsbootenv)
|
||||||
- [ ] Documentation (a change to man pages or other documentation)
|
- [ ] Documentation (a change to man pages or other documentation)
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ name: "Custom CodeQL Analysis"
|
|||||||
|
|
||||||
queries:
|
queries:
|
||||||
- uses: ./.github/codeql/custom-queries/cpp/deprecatedFunctionUsage.ql
|
- uses: ./.github/codeql/custom-queries/cpp/deprecatedFunctionUsage.ql
|
||||||
|
- uses: ./.github/codeql/custom-queries/cpp/dslDatasetHoldReleMismatch.ql
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
/**
|
||||||
|
* @name Detect mismatched dsl_dataset_hold/_rele pairs
|
||||||
|
* @description Flags instances of issue #12014 where
|
||||||
|
* - a dataset held with dsl_dataset_hold_obj() ends up in dsl_dataset_rele_flags(), or
|
||||||
|
* - a dataset held with dsl_dataset_hold_obj_flags() ends up in dsl_dataset_rele().
|
||||||
|
* @kind problem
|
||||||
|
* @severity error
|
||||||
|
* @tags correctness
|
||||||
|
* @id cpp/dslDatasetHoldReleMismatch
|
||||||
|
*/
|
||||||
|
|
||||||
|
import cpp
|
||||||
|
|
||||||
|
from Variable ds, Call holdCall, Call releCall, string message
|
||||||
|
where
|
||||||
|
ds.getType().toString() = "dsl_dataset_t *" and
|
||||||
|
holdCall.getASuccessor*() = releCall and
|
||||||
|
(
|
||||||
|
(holdCall.getTarget().getName() = "dsl_dataset_hold_obj_flags" and
|
||||||
|
holdCall.getArgument(4).(AddressOfExpr).getOperand().(VariableAccess).getTarget() = ds and
|
||||||
|
releCall.getTarget().getName() = "dsl_dataset_rele" and
|
||||||
|
releCall.getArgument(0).(VariableAccess).getTarget() = ds and
|
||||||
|
message = "Held with dsl_dataset_hold_obj_flags but released with dsl_dataset_rele")
|
||||||
|
or
|
||||||
|
(holdCall.getTarget().getName() = "dsl_dataset_hold_obj" and
|
||||||
|
holdCall.getArgument(3).(AddressOfExpr).getOperand().(VariableAccess).getTarget() = ds and
|
||||||
|
releCall.getTarget().getName() = "dsl_dataset_rele_flags" and
|
||||||
|
releCall.getArgument(0).(VariableAccess).getTarget() = ds and
|
||||||
|
message = "Held with dsl_dataset_hold_obj but released with dsl_dataset_rele_flags")
|
||||||
|
)
|
||||||
|
select releCall,
|
||||||
|
"Mismatched release: held with $@ but released with " + releCall.getTarget().getName() + " for dataset $@",
|
||||||
|
holdCall, holdCall.getTarget().getName(),
|
||||||
|
ds, ds.toString()
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
name: labels
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [ opened, synchronize, reopened, converted_to_draft, ready_for_review ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
open:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event.action == 'opened' && github.event.pull_request.draft }}
|
||||||
|
steps:
|
||||||
|
- env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
ISSUE: ${{ github.event.pull_request.html_url }}
|
||||||
|
run: |
|
||||||
|
gh pr edit $ISSUE --add-label "Status: Work in Progress"
|
||||||
|
|
||||||
|
push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event.action == 'synchronize' || github.event.action == 'reopened' }}
|
||||||
|
steps:
|
||||||
|
- env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
ISSUE: ${{ github.event.pull_request.html_url }}
|
||||||
|
run: |
|
||||||
|
gh pr edit $ISSUE --remove-label "Status: Accepted,Status: Inactive,Status: Revision Needed,Status: Stale"
|
||||||
|
|
||||||
|
draft:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event.action == 'converted_to_draft' }}
|
||||||
|
steps:
|
||||||
|
- env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
ISSUE: ${{ github.event.pull_request.html_url }}
|
||||||
|
run: |
|
||||||
|
gh pr edit $ISSUE --remove-label "Status: Accepted,Status: Code Review Needed,Status: Inactive,Status: Revision Needed,Status: Stale" --add-label "Status: Work in Progress"
|
||||||
|
|
||||||
|
rfr:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event.action == 'ready_for_review' }}
|
||||||
|
steps:
|
||||||
|
- env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
ISSUE: ${{ github.event.pull_request.html_url }}
|
||||||
|
run: |
|
||||||
|
gh pr edit $ISSUE --remove-label "Status: Accepted,Status: Inactive,Status: Revision Needed,Status: Stale,Status: Work in Progress" --add-label "Status: Code Review Needed"
|
||||||
@@ -29,6 +29,7 @@ FULL_RUN_IGNORE_REGEX = list(map(re.compile, [
|
|||||||
Patterns of files that are considered to trigger full CI.
|
Patterns of files that are considered to trigger full CI.
|
||||||
"""
|
"""
|
||||||
FULL_RUN_REGEX = list(map(re.compile, [
|
FULL_RUN_REGEX = list(map(re.compile, [
|
||||||
|
r'\.github/workflows/scripts/.*',
|
||||||
r'cmd.*',
|
r'cmd.*',
|
||||||
r'configs/.*',
|
r'configs/.*',
|
||||||
r'META',
|
r'META',
|
||||||
|
|||||||
@@ -10,36 +10,12 @@ set -eu
|
|||||||
export DEBIAN_FRONTEND="noninteractive"
|
export DEBIAN_FRONTEND="noninteractive"
|
||||||
sudo apt-get -y update
|
sudo apt-get -y update
|
||||||
sudo apt-get install -y axel cloud-image-utils daemonize guestfs-tools \
|
sudo apt-get install -y axel cloud-image-utils daemonize guestfs-tools \
|
||||||
ksmtuned virt-manager linux-modules-extra-$(uname -r) zfsutils-linux
|
virt-manager linux-modules-extra-$(uname -r) zfsutils-linux
|
||||||
|
|
||||||
# generate ssh keys
|
# generate ssh keys
|
||||||
rm -f ~/.ssh/id_ed25519
|
rm -f ~/.ssh/id_ed25519
|
||||||
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -q -N ""
|
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -q -N ""
|
||||||
|
|
||||||
# we expect RAM shortage
|
|
||||||
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
|
|
||||||
KSM_MONITOR_INTERVAL=60
|
|
||||||
|
|
||||||
# Millisecond sleep between ksm scans for 16Gb server.
|
|
||||||
# Smaller servers sleep more, bigger sleep less.
|
|
||||||
KSM_SLEEP_MSEC=30
|
|
||||||
|
|
||||||
KSM_NPAGES_BOOST=0
|
|
||||||
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
|
|
||||||
DEBUG=1
|
|
||||||
EOF
|
|
||||||
sudo systemctl restart ksm
|
|
||||||
sudo systemctl restart ksmtuned
|
|
||||||
|
|
||||||
# not needed
|
# not needed
|
||||||
sudo systemctl stop docker.socket
|
sudo systemctl stop docker.socket
|
||||||
sudo systemctl stop multipathd.socket
|
sudo systemctl stop multipathd.socket
|
||||||
@@ -65,16 +41,14 @@ $DISK
|
|||||||
sync
|
sync
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
# swap with same size as RAM
|
# swap with same size as RAM (16GiB)
|
||||||
sudo mkswap $DISK-part1
|
sudo mkswap $DISK-part1
|
||||||
sudo swapon $DISK-part1
|
sudo swapon $DISK-part1
|
||||||
|
|
||||||
# 60GB data disk
|
# JBOD 2xdisk for OpenZFS storage (test vm's)
|
||||||
SSD1="$DISK-part2"
|
SSD1="$DISK-part2"
|
||||||
|
sudo fallocate -l 12G /test.ssd2
|
||||||
# 10GB data disk on ext4
|
SSD2=$(sudo losetup -b 4096 -f /test.ssd2 --show)
|
||||||
sudo fallocate -l 10G /test.ssd1
|
|
||||||
SSD2=$(sudo losetup -b 4096 -f /test.ssd1 --show)
|
|
||||||
|
|
||||||
# adjust zfs module parameter and create pool
|
# adjust zfs module parameter and create pool
|
||||||
exec 1>/dev/null
|
exec 1>/dev/null
|
||||||
@@ -83,11 +57,11 @@ ARC_MAX=$((1024*1024*512))
|
|||||||
echo $ARC_MIN | sudo tee /sys/module/zfs/parameters/zfs_arc_min
|
echo $ARC_MIN | sudo tee /sys/module/zfs/parameters/zfs_arc_min
|
||||||
echo $ARC_MAX | sudo tee /sys/module/zfs/parameters/zfs_arc_max
|
echo $ARC_MAX | sudo tee /sys/module/zfs/parameters/zfs_arc_max
|
||||||
echo 1 | sudo tee /sys/module/zfs/parameters/zvol_use_blk_mq
|
echo 1 | sudo tee /sys/module/zfs/parameters/zvol_use_blk_mq
|
||||||
sudo zpool create -f -o ashift=12 zpool $SSD1 $SSD2 \
|
sudo zpool create -f -o ashift=12 zpool $SSD1 $SSD2 -O relatime=off \
|
||||||
-O relatime=off -O atime=off -O xattr=sa -O compression=lz4 \
|
-O atime=off -O xattr=sa -O compression=lz4 -O sync=disabled \
|
||||||
-O mountpoint=/mnt/tests
|
-O redundant_metadata=none -O mountpoint=/mnt/tests
|
||||||
|
|
||||||
# no need for some scheduler
|
# no need for some scheduler
|
||||||
for i in /sys/block/s*/queue/scheduler; do
|
for i in /sys/block/s*/queue/scheduler; do
|
||||||
echo "none" | sudo tee $i > /dev/null
|
echo "none" | sudo tee $i
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -12,19 +12,23 @@ OS="$1"
|
|||||||
# OS variant (virt-install --os-variant list)
|
# OS variant (virt-install --os-variant list)
|
||||||
OSv=$OS
|
OSv=$OS
|
||||||
|
|
||||||
# compressed with .zst extension
|
# FreeBSD urls's
|
||||||
REPO="https://github.com/mcmilk/openzfs-freebsd-images"
|
FREEBSD_REL="https://download.freebsd.org/releases/CI-IMAGES"
|
||||||
FREEBSD="$REPO/releases/download/v2024-12-14"
|
FREEBSD_SNAP="https://download.freebsd.org/snapshots/CI-IMAGES"
|
||||||
URLzs=""
|
URLxz=""
|
||||||
|
|
||||||
# Ubuntu mirrors
|
# Ubuntu mirrors
|
||||||
#UBMIRROR="https://cloud-images.ubuntu.com"
|
UBMIRROR="https://cloud-images.ubuntu.com"
|
||||||
#UBMIRROR="https://mirrors.cloud.tencent.com/ubuntu-cloud-images"
|
#UBMIRROR="https://mirrors.cloud.tencent.com/ubuntu-cloud-images"
|
||||||
UBMIRROR="https://mirror.citrahost.com/ubuntu-cloud-images"
|
#UBMIRROR="https://mirror.citrahost.com/ubuntu-cloud-images"
|
||||||
|
|
||||||
# default nic model for vm's
|
# default nic model for vm's
|
||||||
NIC="virtio"
|
NIC="virtio"
|
||||||
|
|
||||||
|
# additional options for virt-install
|
||||||
|
OPTS[0]=""
|
||||||
|
OPTS[1]=""
|
||||||
|
|
||||||
case "$OS" in
|
case "$OS" in
|
||||||
almalinux8)
|
almalinux8)
|
||||||
OSNAME="AlmaLinux 8"
|
OSNAME="AlmaLinux 8"
|
||||||
@@ -34,11 +38,14 @@ case "$OS" in
|
|||||||
OSNAME="AlmaLinux 9"
|
OSNAME="AlmaLinux 9"
|
||||||
URL="https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2"
|
URL="https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2"
|
||||||
;;
|
;;
|
||||||
|
almalinux10)
|
||||||
|
OSNAME="AlmaLinux 10"
|
||||||
|
OSv="almalinux9"
|
||||||
|
URL="https://repo.almalinux.org/almalinux/10/cloud/x86_64/images/AlmaLinux-10-GenericCloud-latest.x86_64.qcow2"
|
||||||
|
;;
|
||||||
archlinux)
|
archlinux)
|
||||||
OSNAME="Archlinux"
|
OSNAME="Archlinux"
|
||||||
URL="https://geo.mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-cloudimg.qcow2"
|
URL="https://geo.mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-cloudimg.qcow2"
|
||||||
# dns sometimes fails with that url :/
|
|
||||||
echo "89.187.191.12 geo.mirror.pkgbuild.com" | sudo tee /etc/hosts > /dev/null
|
|
||||||
;;
|
;;
|
||||||
centos-stream10)
|
centos-stream10)
|
||||||
OSNAME="CentOS Stream 10"
|
OSNAME="CentOS Stream 10"
|
||||||
@@ -58,10 +65,13 @@ 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"
|
||||||
;;
|
;;
|
||||||
fedora40)
|
debian13)
|
||||||
OSNAME="Fedora 40"
|
OSNAME="Debian 13"
|
||||||
OSv="fedora-unknown"
|
# TODO: Overwrite OSv to debian13 for virt-install until it's added to osinfo
|
||||||
URL="https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2"
|
OSv="debian12"
|
||||||
|
URL="https://cloud.debian.org/images/cloud/trixie/latest/debian-13-generic-amd64.qcow2"
|
||||||
|
OPTS[0]="--boot"
|
||||||
|
OPTS[1]="uefi=on"
|
||||||
;;
|
;;
|
||||||
fedora41)
|
fedora41)
|
||||||
OSNAME="Fedora 41"
|
OSNAME="Fedora 41"
|
||||||
@@ -73,37 +83,49 @@ case "$OS" in
|
|||||||
OSv="fedora-unknown"
|
OSv="fedora-unknown"
|
||||||
URL="https://download.fedoraproject.org/pub/fedora/linux/releases/42/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-42-1.1.x86_64.qcow2"
|
URL="https://download.fedoraproject.org/pub/fedora/linux/releases/42/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-42-1.1.x86_64.qcow2"
|
||||||
;;
|
;;
|
||||||
freebsd13-4r)
|
freebsd13-5r)
|
||||||
OSNAME="FreeBSD 13.4-RELEASE"
|
FreeBSD="13.5-RELEASE"
|
||||||
|
OSNAME="FreeBSD $FreeBSD"
|
||||||
OSv="freebsd13.0"
|
OSv="freebsd13.0"
|
||||||
URLzs="$FREEBSD/amd64-freebsd-13.4-RELEASE.qcow2.zst"
|
URLxz="$FREEBSD_REL/$FreeBSD/amd64/Latest/FreeBSD-$FreeBSD-amd64-BASIC-CI.raw.xz"
|
||||||
BASH="/usr/local/bin/bash"
|
KSRC="$FREEBSD_REL/../amd64/$FreeBSD/src.txz"
|
||||||
NIC="rtl8139"
|
NIC="rtl8139"
|
||||||
;;
|
;;
|
||||||
freebsd14-2r)
|
freebsd14-2r)
|
||||||
OSNAME="FreeBSD 14.2-RELEASE"
|
FreeBSD="14.2-RELEASE"
|
||||||
|
OSNAME="FreeBSD $FreeBSD"
|
||||||
OSv="freebsd14.0"
|
OSv="freebsd14.0"
|
||||||
URLzs="$FREEBSD/amd64-freebsd-14.2-RELEASE.qcow2.zst"
|
KSRC="$FREEBSD_REL/../amd64/$FreeBSD/src.txz"
|
||||||
BASH="/usr/local/bin/bash"
|
URLxz="$FREEBSD_REL/$FreeBSD/amd64/Latest/FreeBSD-$FreeBSD-amd64-BASIC-CI.raw.xz"
|
||||||
;;
|
;;
|
||||||
freebsd13-4s)
|
freebsd14-3r)
|
||||||
OSNAME="FreeBSD 13.4-STABLE"
|
FreeBSD="14.3-RELEASE"
|
||||||
|
OSNAME="FreeBSD $FreeBSD"
|
||||||
|
OSv="freebsd14.0"
|
||||||
|
URLxz="$FREEBSD_REL/$FreeBSD/amd64/Latest/FreeBSD-$FreeBSD-amd64-BASIC-CI.raw.xz"
|
||||||
|
KSRC="$FREEBSD_REL/../amd64/$FreeBSD/src.txz"
|
||||||
|
;;
|
||||||
|
freebsd13-5s)
|
||||||
|
FreeBSD="13.5-STABLE"
|
||||||
|
OSNAME="FreeBSD $FreeBSD"
|
||||||
OSv="freebsd13.0"
|
OSv="freebsd13.0"
|
||||||
URLzs="$FREEBSD/amd64-freebsd-13.4-STABLE.qcow2.zst"
|
URLxz="$FREEBSD_SNAP/$FreeBSD/amd64/Latest/FreeBSD-$FreeBSD-amd64-BASIC-CI.raw.xz"
|
||||||
BASH="/usr/local/bin/bash"
|
KSRC="$FREEBSD_SNAP/../amd64/$FreeBSD/src.txz"
|
||||||
NIC="rtl8139"
|
NIC="rtl8139"
|
||||||
;;
|
;;
|
||||||
freebsd14-2s)
|
freebsd14-3s)
|
||||||
OSNAME="FreeBSD 14.2-STABLE"
|
FreeBSD="14.3-STABLE"
|
||||||
|
OSNAME="FreeBSD $FreeBSD"
|
||||||
OSv="freebsd14.0"
|
OSv="freebsd14.0"
|
||||||
URLzs="$FREEBSD/amd64-freebsd-14.2-STABLE.qcow2.zst"
|
URLxz="$FREEBSD_SNAP/$FreeBSD/amd64/Latest/FreeBSD-$FreeBSD-amd64-BASIC-CI-ufs.raw.xz"
|
||||||
BASH="/usr/local/bin/bash"
|
KSRC="$FREEBSD_SNAP/../amd64/$FreeBSD/src.txz"
|
||||||
;;
|
;;
|
||||||
freebsd15-0c)
|
freebsd15-0c)
|
||||||
OSNAME="FreeBSD 15.0-CURRENT"
|
FreeBSD="15.0-PRERELEASE"
|
||||||
|
OSNAME="FreeBSD $FreeBSD"
|
||||||
OSv="freebsd14.0"
|
OSv="freebsd14.0"
|
||||||
URLzs="$FREEBSD/amd64-freebsd-15.0-CURRENT.qcow2.zst"
|
URLxz="$FREEBSD_SNAP/$FreeBSD/amd64/Latest/FreeBSD-$FreeBSD-amd64-BASIC-CI-ufs.raw.xz"
|
||||||
BASH="/usr/local/bin/bash"
|
KSRC="$FREEBSD_SNAP/../amd64/$FreeBSD/src.txz"
|
||||||
;;
|
;;
|
||||||
tumbleweed)
|
tumbleweed)
|
||||||
OSNAME="openSUSE Tumbleweed"
|
OSNAME="openSUSE Tumbleweed"
|
||||||
@@ -111,11 +133,6 @@ case "$OS" in
|
|||||||
MIRROR="http://opensuse-mirror-gce-us.susecloud.net"
|
MIRROR="http://opensuse-mirror-gce-us.susecloud.net"
|
||||||
URL="$MIRROR/tumbleweed/appliances/openSUSE-MicroOS.x86_64-OpenStack-Cloud.qcow2"
|
URL="$MIRROR/tumbleweed/appliances/openSUSE-MicroOS.x86_64-OpenStack-Cloud.qcow2"
|
||||||
;;
|
;;
|
||||||
ubuntu20)
|
|
||||||
OSNAME="Ubuntu 20.04"
|
|
||||||
OSv="ubuntu20.04"
|
|
||||||
URL="$UBMIRROR/focal/current/focal-server-cloudimg-amd64.img"
|
|
||||||
;;
|
|
||||||
ubuntu22)
|
ubuntu22)
|
||||||
OSNAME="Ubuntu 22.04"
|
OSNAME="Ubuntu 22.04"
|
||||||
OSv="ubuntu22.04"
|
OSv="ubuntu22.04"
|
||||||
@@ -139,7 +156,7 @@ echo "ENV=$ENV" >> $ENV
|
|||||||
# result path
|
# result path
|
||||||
echo 'RESPATH="/var/tmp/test_results"' >> $ENV
|
echo 'RESPATH="/var/tmp/test_results"' >> $ENV
|
||||||
|
|
||||||
# FreeBSD 13 has problems with: e1000+virtio
|
# FreeBSD 13 has problems with: e1000 and virtio
|
||||||
echo "NIC=$NIC" >> $ENV
|
echo "NIC=$NIC" >> $ENV
|
||||||
|
|
||||||
# freebsd15 -> used in zfs-qemu.yml
|
# freebsd15 -> used in zfs-qemu.yml
|
||||||
@@ -151,34 +168,48 @@ echo "OSv=\"$OSv\"" >> $ENV
|
|||||||
# FreeBSD 15 (Current) -> used for summary
|
# FreeBSD 15 (Current) -> used for summary
|
||||||
echo "OSNAME=\"$OSNAME\"" >> $ENV
|
echo "OSNAME=\"$OSNAME\"" >> $ENV
|
||||||
|
|
||||||
|
# default vm count for testings
|
||||||
|
VMs=2
|
||||||
|
echo "VMs=\"$VMs\"" >> $ENV
|
||||||
|
|
||||||
|
# default cpu count for testing vm's
|
||||||
|
CPU=2
|
||||||
|
echo "CPU=\"$CPU\"" >> $ENV
|
||||||
|
|
||||||
sudo mkdir -p "/mnt/tests"
|
sudo mkdir -p "/mnt/tests"
|
||||||
sudo chown -R $(whoami) /mnt/tests
|
sudo chown -R $(whoami) /mnt/tests
|
||||||
|
|
||||||
|
DISK="/dev/zvol/zpool/openzfs"
|
||||||
|
sudo zfs create -ps -b 64k -V 80g zpool/openzfs
|
||||||
|
while true; do test -b $DISK && break; sleep 1; done
|
||||||
|
|
||||||
# we are downloading via axel, curl and wget are mostly slower and
|
# we are downloading via axel, curl and wget are mostly slower and
|
||||||
# require more return value checking
|
# require more return value checking
|
||||||
IMG="/mnt/tests/cloudimg.qcow2"
|
IMG="/mnt/tests/cloud-image"
|
||||||
if [ ! -z "$URLzs" ]; then
|
if [ ! -z "$URLxz" ]; then
|
||||||
echo "Loading image $URLzs ..."
|
echo "Loading $URLxz ..."
|
||||||
time axel -q -o "$IMG.zst" "$URLzs"
|
time axel -q -o "$IMG" "$URLxz"
|
||||||
zstd -q -d --rm "$IMG.zst"
|
echo "Loading $KSRC ..."
|
||||||
|
time axel -q -o ~/src.txz $KSRC
|
||||||
else
|
else
|
||||||
echo "Loading image $URL ..."
|
echo "Loading $URL ..."
|
||||||
time axel -q -o "$IMG" "$URL"
|
time axel -q -o "$IMG" "$URL"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DISK="/dev/zvol/zpool/openzfs"
|
|
||||||
FORMAT="raw"
|
|
||||||
sudo zfs create -ps -b 64k -V 80g zpool/openzfs
|
|
||||||
while true; do test -b $DISK && break; sleep 1; done
|
|
||||||
echo "Importing VM image to zvol..."
|
echo "Importing VM image to zvol..."
|
||||||
sudo qemu-img dd -f qcow2 -O raw if=$IMG of=$DISK bs=4M
|
if [ ! -z "$URLxz" ]; then
|
||||||
|
xzcat -T0 $IMG | sudo dd of=$DISK bs=4M
|
||||||
|
else
|
||||||
|
sudo qemu-img dd -f qcow2 -O raw if=$IMG of=$DISK bs=4M
|
||||||
|
fi
|
||||||
rm -f $IMG
|
rm -f $IMG
|
||||||
|
|
||||||
PUBKEY=$(cat ~/.ssh/id_ed25519.pub)
|
PUBKEY=$(cat ~/.ssh/id_ed25519.pub)
|
||||||
cat <<EOF > /tmp/user-data
|
if [ ${OS:0:7} != "freebsd" ]; then
|
||||||
|
cat <<EOF > /tmp/user-data
|
||||||
#cloud-config
|
#cloud-config
|
||||||
|
|
||||||
fqdn: $OS
|
hostname: $OS
|
||||||
|
|
||||||
users:
|
users:
|
||||||
- name: root
|
- name: root
|
||||||
@@ -194,6 +225,19 @@ growpart:
|
|||||||
devices: ['/']
|
devices: ['/']
|
||||||
ignore_growroot_disabled: false
|
ignore_growroot_disabled: false
|
||||||
EOF
|
EOF
|
||||||
|
else
|
||||||
|
cat <<EOF > /tmp/user-data
|
||||||
|
#cloud-config
|
||||||
|
|
||||||
|
hostname: $OS
|
||||||
|
|
||||||
|
# minimized config without sudo for nuageinit of FreeBSD
|
||||||
|
growpart:
|
||||||
|
mode: auto
|
||||||
|
devices: ['/']
|
||||||
|
ignore_growroot_disabled: false
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
sudo virsh net-update default add ip-dhcp-host \
|
sudo virsh net-update default add ip-dhcp-host \
|
||||||
"<host mac='52:54:00:83:79:00' ip='192.168.122.10'/>" --live --config
|
"<host mac='52:54:00:83:79:00' ip='192.168.122.10'/>" --live --config
|
||||||
@@ -209,15 +253,15 @@ sudo virt-install \
|
|||||||
--graphics none \
|
--graphics none \
|
||||||
--network bridge=virbr0,model=$NIC,mac='52:54:00:83:79:00' \
|
--network bridge=virbr0,model=$NIC,mac='52:54:00:83:79:00' \
|
||||||
--cloud-init user-data=/tmp/user-data \
|
--cloud-init user-data=/tmp/user-data \
|
||||||
--disk $DISK,bus=virtio,cache=none,format=$FORMAT,driver.discard=unmap \
|
--disk $DISK,bus=virtio,cache=none,format=raw,driver.discard=unmap \
|
||||||
--import --noautoconsole >/dev/null
|
--import --noautoconsole ${OPTS[0]} ${OPTS[1]} >/dev/null
|
||||||
|
|
||||||
# Give the VMs hostnames so we don't have to refer to them with
|
# Give the VMs hostnames so we don't have to refer to them with
|
||||||
# hardcoded IP addresses.
|
# hardcoded IP addresses.
|
||||||
#
|
#
|
||||||
# vm0: Initial VM we install dependencies and build ZFS on.
|
# vm0: Initial VM we install dependencies and build ZFS on.
|
||||||
# vm1..2 Testing VMs
|
# vm1..2 Testing VMs
|
||||||
for i in {0..9} ; do
|
for ((i=0; i<=VMs; i++)); do
|
||||||
echo "192.168.122.1$i vm$i" | sudo tee -a /etc/hosts
|
echo "192.168.122.1$i vm$i" | sudo tee -a /etc/hosts
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -231,3 +275,29 @@ StrictHostKeyChecking no
|
|||||||
# small timeout, used in while loops later
|
# small timeout, used in while loops later
|
||||||
ConnectTimeout 1
|
ConnectTimeout 1
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
if [ ${OS:0:7} != "freebsd" ]; then
|
||||||
|
# enable KSM on Linux
|
||||||
|
sudo virsh dommemstat --domain "openzfs" --period 5
|
||||||
|
sudo virsh node-memory-tune 100 50 1
|
||||||
|
echo 1 | sudo tee /sys/kernel/mm/ksm/run > /dev/null
|
||||||
|
else
|
||||||
|
# on FreeBSD we need some more init stuff, because of nuageinit
|
||||||
|
BASH="/usr/local/bin/bash"
|
||||||
|
while pidof /usr/bin/qemu-system-x86_64 >/dev/null; do
|
||||||
|
ssh 2>/dev/null root@vm0 "uname -a" && break
|
||||||
|
done
|
||||||
|
ssh root@vm0 "pkg install -y bash ca_root_nss git qemu-guest-agent python3 py311-cloud-init"
|
||||||
|
ssh root@vm0 "chsh -s $BASH root"
|
||||||
|
ssh root@vm0 'sysrc qemu_guest_agent_enable="YES"'
|
||||||
|
ssh root@vm0 'sysrc cloudinit_enable="YES"'
|
||||||
|
ssh root@vm0 "pw add user zfs -w no -s $BASH"
|
||||||
|
ssh root@vm0 'mkdir -p ~zfs/.ssh'
|
||||||
|
ssh root@vm0 'echo "zfs ALL=(ALL:ALL) NOPASSWD: ALL" >> /usr/local/etc/sudoers'
|
||||||
|
ssh root@vm0 'echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config'
|
||||||
|
scp ~/.ssh/id_ed25519.pub "root@vm0:~zfs/.ssh/authorized_keys"
|
||||||
|
ssh root@vm0 'chown -R zfs ~zfs'
|
||||||
|
ssh root@vm0 'service sshd restart'
|
||||||
|
scp ~/src.txz "root@vm0:/tmp/src.txz"
|
||||||
|
ssh root@vm0 'tar -C / -zxf /tmp/src.txz'
|
||||||
|
fi
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
# 3) install dependencies for compiling and loading
|
# 3) install dependencies for compiling and loading
|
||||||
#
|
#
|
||||||
# $1: OS name (like 'fedora41')
|
# $1: OS name (like 'fedora41')
|
||||||
|
# $2: (optional) Experimental Fedora kernel version, like "6.14" to
|
||||||
|
# install instead of Fedora defaults.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
@@ -26,6 +28,7 @@ function debian() {
|
|||||||
export DEBIAN_FRONTEND="noninteractive"
|
export DEBIAN_FRONTEND="noninteractive"
|
||||||
|
|
||||||
echo "##[group]Running apt-get update+upgrade"
|
echo "##[group]Running apt-get update+upgrade"
|
||||||
|
sudo sed -i '/[[:alpha:]]-backports/d' /etc/apt/sources.list
|
||||||
sudo apt-get update -y
|
sudo apt-get update -y
|
||||||
sudo apt-get upgrade -y
|
sudo apt-get upgrade -y
|
||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
@@ -38,7 +41,7 @@ function debian() {
|
|||||||
libelf-dev libffi-dev libmount-dev libpam0g-dev libselinux-dev libssl-dev \
|
libelf-dev libffi-dev libmount-dev libpam0g-dev libselinux-dev libssl-dev \
|
||||||
libtool 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 libtirpc-dev \
|
||||||
python3-setuptools python3-sphinx qemu-guest-agent rng-tools rpm2cpio \
|
python3-setuptools python3-sphinx qemu-guest-agent rng-tools rpm2cpio \
|
||||||
rsync samba sysstat uuid-dev watchdog wget xfslibs-dev xxhash zlib1g-dev
|
rsync samba sysstat uuid-dev watchdog wget xfslibs-dev xxhash zlib1g-dev
|
||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
@@ -49,12 +52,13 @@ function freebsd() {
|
|||||||
|
|
||||||
echo "##[group]Install Development Tools"
|
echo "##[group]Install Development Tools"
|
||||||
sudo pkg install -y autoconf automake autotools base64 checkbashisms fio \
|
sudo pkg install -y autoconf automake autotools base64 checkbashisms fio \
|
||||||
gdb gettext gettext-runtime git gmake gsed jq ksh93 lcov libtool lscpu \
|
gdb gettext gettext-runtime git gmake gsed jq ksh lcov libtool lscpu \
|
||||||
pkgconf python python3 pamtester pamtester qemu-guest-agent rsync xxhash
|
pkgconf python python3 pamtester pamtester qemu-guest-agent rsync xxhash
|
||||||
sudo pkg install -xy \
|
sudo pkg install -xy \
|
||||||
'^samba4[[:digit:]]+$' \
|
'^samba4[[:digit:]]+$' \
|
||||||
'^py3[[:digit:]]+-cffi$' \
|
'^py3[[:digit:]]+-cffi$' \
|
||||||
'^py3[[:digit:]]+-sysctl$' \
|
'^py3[[:digit:]]+-sysctl$' \
|
||||||
|
'^py3[[:digit:]]+-setuptools$' \
|
||||||
'^py3[[:digit:]]+-packaging$'
|
'^py3[[:digit:]]+-packaging$'
|
||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
}
|
}
|
||||||
@@ -94,6 +98,25 @@ function tumbleweed() {
|
|||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# $1: Kernel version to install (like '6.14rc7')
|
||||||
|
function install_fedora_experimental_kernel {
|
||||||
|
|
||||||
|
our_version="$1"
|
||||||
|
sudo dnf -y copr enable @kernel-vanilla/stable
|
||||||
|
sudo dnf -y copr enable @kernel-vanilla/mainline
|
||||||
|
all="$(sudo dnf list --showduplicates kernel-*)"
|
||||||
|
echo "Available versions:"
|
||||||
|
echo "$all"
|
||||||
|
|
||||||
|
# You can have a bunch of minor variants of the version we want '6.14'.
|
||||||
|
# Pick the newest variant (sorted by version number).
|
||||||
|
specific_version=$(echo "$all" | grep $our_version | awk '{print $2}' | sort -V | tail -n 1)
|
||||||
|
list="$(echo "$all" | grep $specific_version | grep -Ev 'kernel-rt|kernel-selftests|kernel-debuginfo' | sed 's/.x86_64//g' | awk '{print $1"-"$2}')"
|
||||||
|
sudo dnf install -y $list
|
||||||
|
sudo dnf -y copr disable @kernel-vanilla/stable
|
||||||
|
sudo dnf -y copr disable @kernel-vanilla/mainline
|
||||||
|
}
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
case "$1" in
|
case "$1" in
|
||||||
almalinux8)
|
almalinux8)
|
||||||
@@ -106,7 +129,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|centos-stream10)
|
almalinux9|almalinux10|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
|
||||||
@@ -132,6 +155,11 @@ case "$1" in
|
|||||||
|
|
||||||
# Fedora 42+ moves /usr/bin/script from 'util-linux' to 'util-linux-script'
|
# Fedora 42+ moves /usr/bin/script from 'util-linux' to 'util-linux-script'
|
||||||
sudo dnf install -y util-linux-script || true
|
sudo dnf install -y util-linux-script || true
|
||||||
|
|
||||||
|
# Optional: Install an experimental kernel ($2 = kernel version)
|
||||||
|
if [ -n "${2:-}" ] ; then
|
||||||
|
install_fedora_experimental_kernel "$2"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
freebsd*)
|
freebsd*)
|
||||||
freebsd
|
freebsd
|
||||||
@@ -144,9 +172,7 @@ case "$1" in
|
|||||||
echo "##[group]Install Ubuntu specific"
|
echo "##[group]Install Ubuntu specific"
|
||||||
sudo apt-get install -yq linux-tools-common libtirpc-dev \
|
sudo apt-get install -yq linux-tools-common libtirpc-dev \
|
||||||
linux-modules-extra-$(uname -r)
|
linux-modules-extra-$(uname -r)
|
||||||
if [ "$1" != "ubuntu20" ]; then
|
sudo apt-get install -yq dh-sequence-dkms
|
||||||
sudo apt-get install -yq dh-sequence-dkms
|
|
||||||
fi
|
|
||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
echo "##[group]Delete Ubuntu OpenZFS modules"
|
echo "##[group]Delete Ubuntu OpenZFS modules"
|
||||||
for i in $(find /lib/modules -name zfs -type d); do sudo rm -rvf $i; done
|
for i in $(find /lib/modules -name zfs -type d); do sudo rm -rvf $i; done
|
||||||
|
|||||||
@@ -3,12 +3,25 @@
|
|||||||
# script on it.
|
# script on it.
|
||||||
#
|
#
|
||||||
# $1: OS name (like 'fedora41')
|
# $1: OS name (like 'fedora41')
|
||||||
|
# $2: (optional) Experimental kernel version to install on fedora,
|
||||||
|
# like "6.14".
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
.github/workflows/scripts/qemu-wait-for-vm.sh vm0
|
.github/workflows/scripts/qemu-wait-for-vm.sh vm0
|
||||||
|
|
||||||
|
# SPECIAL CASE:
|
||||||
|
#
|
||||||
|
# If the user passed in an experimental kernel version to test on Fedora,
|
||||||
|
# we need to update the kernel version in zfs's META file to allow the
|
||||||
|
# build to happen. We update our local copy of META here, since we know
|
||||||
|
# it will be rsync'd up in the next step.
|
||||||
|
if [ -n "${2:-}" ] ; then
|
||||||
|
sed -i -E 's/Linux-Maximum: .+/Linux-Maximum: 99.99/g' META
|
||||||
|
fi
|
||||||
|
|
||||||
scp .github/workflows/scripts/qemu-3-deps-vm.sh zfs@vm0:qemu-3-deps-vm.sh
|
scp .github/workflows/scripts/qemu-3-deps-vm.sh zfs@vm0:qemu-3-deps-vm.sh
|
||||||
PID=`pidof /usr/bin/qemu-system-x86_64`
|
PID=`pidof /usr/bin/qemu-system-x86_64`
|
||||||
ssh zfs@vm0 '$HOME/qemu-3-deps-vm.sh' $1
|
ssh zfs@vm0 '$HOME/qemu-3-deps-vm.sh' "$@"
|
||||||
# wait for poweroff to succeed
|
# wait for poweroff to succeed
|
||||||
tail --pid=$PID -f /dev/null
|
tail --pid=$PID -f /dev/null
|
||||||
sleep 5 # avoid this: "error: Domain is already active"
|
sleep 5 # avoid this: "error: Domain is already active"
|
||||||
|
|||||||
@@ -5,12 +5,13 @@
|
|||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
#
|
#
|
||||||
# qemu-4-build-vm.sh OS [--enable-debug][--dkms][--poweroff]
|
# qemu-4-build-vm.sh OS [--enable-debug][--dkms][--patch-level NUM]
|
||||||
# [--release][--repo][--tarball]
|
# [--poweroff][--release][--repo][--tarball]
|
||||||
#
|
#
|
||||||
# OS: OS name like 'fedora41'
|
# OS: OS name like 'fedora41'
|
||||||
# --enable-debug: Build RPMs with '--enable-debug' (for testing)
|
# --enable-debug: Build RPMs with '--enable-debug' (for testing)
|
||||||
# --dkms: Build DKMS RPMs as well
|
# --dkms: Build DKMS RPMs as well
|
||||||
|
# --patch-level NUM: Use a custom patch level number for packages.
|
||||||
# --poweroff: Power-off the VM after building
|
# --poweroff: Power-off the VM after building
|
||||||
# --release Build zfs-release*.rpm as well
|
# --release Build zfs-release*.rpm as well
|
||||||
# --repo After building everything, copy RPMs into /tmp/repo
|
# --repo After building everything, copy RPMs into /tmp/repo
|
||||||
@@ -21,6 +22,7 @@
|
|||||||
|
|
||||||
ENABLE_DEBUG=""
|
ENABLE_DEBUG=""
|
||||||
DKMS=""
|
DKMS=""
|
||||||
|
PATCH_LEVEL=""
|
||||||
POWEROFF=""
|
POWEROFF=""
|
||||||
RELEASE=""
|
RELEASE=""
|
||||||
REPO=""
|
REPO=""
|
||||||
@@ -35,6 +37,11 @@ while [[ $# -gt 0 ]]; do
|
|||||||
DKMS=1
|
DKMS=1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--patch-level)
|
||||||
|
PATCH_LEVEL=$2
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
;;
|
||||||
--poweroff)
|
--poweroff)
|
||||||
POWEROFF=1
|
POWEROFF=1
|
||||||
shift
|
shift
|
||||||
@@ -215,6 +222,10 @@ function rpm_build_and_install() {
|
|||||||
run ./autogen.sh
|
run ./autogen.sh
|
||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
if [ -n "$PATCH_LEVEL" ] ; then
|
||||||
|
sed -i -E 's/(Release:\s+)1/\1'$PATCH_LEVEL'/g' META
|
||||||
|
fi
|
||||||
|
|
||||||
echo "##[group]Configure"
|
echo "##[group]Configure"
|
||||||
run ./configure --enable-debuginfo $extra
|
run ./configure --enable-debuginfo $extra
|
||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
@@ -326,9 +337,15 @@ fi
|
|||||||
#
|
#
|
||||||
# rhel8.10
|
# rhel8.10
|
||||||
# almalinux9.5
|
# almalinux9.5
|
||||||
# fedora40
|
# fedora42
|
||||||
source /etc/os-release
|
source /etc/os-release
|
||||||
sudo hostname "$ID$VERSION_ID"
|
if which hostnamectl &> /dev/null ; then
|
||||||
|
# Fedora 42+ use hostnamectl
|
||||||
|
sudo hostnamectl set-hostname "$ID$VERSION_ID"
|
||||||
|
sudo hostnamectl set-hostname --pretty "$ID$VERSION_ID"
|
||||||
|
else
|
||||||
|
sudo hostname "$ID$VERSION_ID"
|
||||||
|
fi
|
||||||
|
|
||||||
# save some sysinfo
|
# save some sysinfo
|
||||||
uname -a > /var/tmp/uname.txt
|
uname -a > /var/tmp/uname.txt
|
||||||
|
|||||||
@@ -12,41 +12,45 @@ source /var/tmp/env.txt
|
|||||||
# wait for poweroff to succeed
|
# wait for poweroff to succeed
|
||||||
PID=$(pidof /usr/bin/qemu-system-x86_64)
|
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 --nvram openzfs
|
||||||
|
|
||||||
# default values per test vm:
|
|
||||||
VMs=2
|
|
||||||
CPU=2
|
|
||||||
|
|
||||||
# cpu pinning
|
# cpu pinning
|
||||||
CPUSET=("0,1" "2,3")
|
CPUSET=("0,1" "2,3")
|
||||||
|
|
||||||
|
# additional options for virt-install
|
||||||
|
OPTS[0]=""
|
||||||
|
OPTS[1]=""
|
||||||
|
|
||||||
case "$OS" in
|
case "$OS" in
|
||||||
freebsd*)
|
freebsd*)
|
||||||
# FreeBSD can't be optimized via ksmtuned
|
# FreeBSD needs only 6GiB
|
||||||
RAM=6
|
RAM=6
|
||||||
;;
|
;;
|
||||||
|
debian13)
|
||||||
|
RAM=8
|
||||||
|
# Boot Debian 13 with uefi=on and secureboot=off (ZFS Kernel Module not signed)
|
||||||
|
OPTS[0]="--boot"
|
||||||
|
OPTS[1]="firmware=efi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
# Linux can be optimized via ksmtuned
|
# Linux needs more memory, but can be optimized to share it via KSM
|
||||||
RAM=8
|
RAM=8
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# this can be different for each distro
|
|
||||||
echo "VMs=$VMs" >> $ENV
|
|
||||||
|
|
||||||
# create snapshot we can clone later
|
# create snapshot we can clone later
|
||||||
sudo zfs snapshot zpool/openzfs@now
|
sudo zfs snapshot zpool/openzfs@now
|
||||||
|
|
||||||
# setup the testing vm's
|
# setup the testing vm's
|
||||||
PUBKEY=$(cat ~/.ssh/id_ed25519.pub)
|
PUBKEY=$(cat ~/.ssh/id_ed25519.pub)
|
||||||
for i in $(seq 1 $VMs); do
|
|
||||||
|
|
||||||
|
# start testing VMs
|
||||||
|
for ((i=1; i<=VMs; i++)); do
|
||||||
echo "Creating disk for vm$i..."
|
echo "Creating disk for vm$i..."
|
||||||
DISK="/dev/zvol/zpool/vm$i"
|
DISK="/dev/zvol/zpool/vm$i"
|
||||||
FORMAT="raw"
|
FORMAT="raw"
|
||||||
sudo zfs clone zpool/openzfs@now zpool/vm$i
|
sudo zfs clone zpool/openzfs@now zpool/vm$i-system
|
||||||
sudo zfs create -ps -b 64k -V 80g zpool/vm$i-2
|
sudo zfs create -ps -b 64k -V 64g zpool/vm$i-tests
|
||||||
|
|
||||||
cat <<EOF > /tmp/user-data
|
cat <<EOF > /tmp/user-data
|
||||||
#cloud-config
|
#cloud-config
|
||||||
@@ -83,23 +87,21 @@ EOF
|
|||||||
--graphics none \
|
--graphics none \
|
||||||
--cloud-init user-data=/tmp/user-data \
|
--cloud-init user-data=/tmp/user-data \
|
||||||
--network bridge=virbr0,model=$NIC,mac="52:54:00:83:79:0$i" \
|
--network bridge=virbr0,model=$NIC,mac="52:54:00:83:79:0$i" \
|
||||||
--disk $DISK,bus=virtio,cache=none,format=$FORMAT,driver.discard=unmap \
|
--disk $DISK-system,bus=virtio,cache=none,format=$FORMAT,driver.discard=unmap \
|
||||||
--disk $DISK-2,bus=virtio,cache=none,format=$FORMAT,driver.discard=unmap \
|
--disk $DISK-tests,bus=virtio,cache=none,format=$FORMAT,driver.discard=unmap \
|
||||||
--import --noautoconsole >/dev/null
|
--import --noautoconsole ${OPTS[0]} ${OPTS[1]}
|
||||||
done
|
done
|
||||||
|
|
||||||
# check the memory state from time to time
|
# generate some memory stats
|
||||||
cat <<EOF > cronjob.sh
|
cat <<EOF > cronjob.sh
|
||||||
# $OS
|
|
||||||
exec 1>>/var/tmp/stats.txt
|
exec 1>>/var/tmp/stats.txt
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
echo "*******************************************************"
|
echo "********************************************************************************"
|
||||||
date
|
|
||||||
uptime
|
uptime
|
||||||
free -m
|
free -m
|
||||||
df -h /mnt/tests
|
|
||||||
zfs list
|
zfs list
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
sudo chmod +x cronjob.sh
|
sudo chmod +x cronjob.sh
|
||||||
sudo mv -f cronjob.sh /root/cronjob.sh
|
sudo mv -f cronjob.sh /root/cronjob.sh
|
||||||
echo '*/5 * * * * /root/cronjob.sh' > crontab.txt
|
echo '*/5 * * * * /root/cronjob.sh' > crontab.txt
|
||||||
@@ -108,7 +110,7 @@ rm crontab.txt
|
|||||||
|
|
||||||
# check if the machines are okay
|
# check if the machines are okay
|
||||||
echo "Waiting for vm's to come up... (${VMs}x CPU=$CPU RAM=$RAM)"
|
echo "Waiting for vm's to come up... (${VMs}x CPU=$CPU RAM=$RAM)"
|
||||||
for i in $(seq 1 $VMs); do
|
for ((i=1; i<=VMs; i++)); do
|
||||||
.github/workflows/scripts/qemu-wait-for-vm.sh vm$i
|
.github/workflows/scripts/qemu-wait-for-vm.sh vm$i
|
||||||
done
|
done
|
||||||
echo "All $VMs VMs are up now."
|
echo "All $VMs VMs are up now."
|
||||||
@@ -116,7 +118,7 @@ echo "All $VMs VMs are up now."
|
|||||||
# Save the VM's serial output (ttyS0) to /var/tmp/console.txt
|
# Save the VM's serial output (ttyS0) to /var/tmp/console.txt
|
||||||
# - ttyS0 on the VM corresponds to a local /dev/pty/N entry
|
# - ttyS0 on the VM corresponds to a local /dev/pty/N entry
|
||||||
# - use 'virsh ttyconsole' to lookup the /dev/pty/N entry
|
# - use 'virsh ttyconsole' to lookup the /dev/pty/N entry
|
||||||
for i in $(seq 1 $VMs); do
|
for ((i=1; i<=VMs; i++)); do
|
||||||
mkdir -p $RESPATH/vm$i
|
mkdir -p $RESPATH/vm$i
|
||||||
read "pty" <<< $(sudo virsh ttyconsole vm$i)
|
read "pty" <<< $(sudo virsh ttyconsole vm$i)
|
||||||
sudo nohup bash -c "cat $pty > $RESPATH/vm$i/console.txt" &
|
sudo nohup bash -c "cat $pty > $RESPATH/vm$i/console.txt" &
|
||||||
|
|||||||
@@ -21,11 +21,13 @@ function prefix() {
|
|||||||
S=$((DIFF-(M*60)))
|
S=$((DIFF-(M*60)))
|
||||||
|
|
||||||
CTR=$(cat /tmp/ctr)
|
CTR=$(cat /tmp/ctr)
|
||||||
echo $LINE| grep -q "^Test[: ]" && CTR=$((CTR+1)) && echo $CTR > /tmp/ctr
|
echo $LINE| grep -q '^\[.*] Test[: ]' && CTR=$((CTR+1)) && echo $CTR > /tmp/ctr
|
||||||
|
|
||||||
BASE="$HOME/work/zfs/zfs"
|
BASE="$HOME/work/zfs/zfs"
|
||||||
COLOR="$BASE/scripts/zfs-tests-color.sh"
|
COLOR="$BASE/scripts/zfs-tests-color.sh"
|
||||||
CLINE=$(echo $LINE| grep "^Test[ :]" | sed -e 's|/usr/local|/usr|g' \
|
CLINE=$(echo $LINE| grep '^\[.*] Test[: ]' \
|
||||||
|
| sed -e 's|^\[.*] Test|Test|g' \
|
||||||
|
| sed -e 's|/usr/local|/usr|g' \
|
||||||
| sed -e 's| /usr/share/zfs/zfs-tests/tests/| |g' | $COLOR)
|
| sed -e 's| /usr/share/zfs/zfs-tests/tests/| |g' | $COLOR)
|
||||||
if [ -z "$CLINE" ]; then
|
if [ -z "$CLINE" ]; then
|
||||||
printf "vm${ID}: %s\n" "$LINE"
|
printf "vm${ID}: %s\n" "$LINE"
|
||||||
@@ -45,7 +47,7 @@ if [ -z ${1:-} ]; then
|
|||||||
echo 0 > /tmp/ctr
|
echo 0 > /tmp/ctr
|
||||||
date "+%s" > /tmp/tsstart
|
date "+%s" > /tmp/tsstart
|
||||||
|
|
||||||
for i in $(seq 1 $VMs); do
|
for ((i=1; i<=VMs; i++)); do
|
||||||
IP="192.168.122.1$i"
|
IP="192.168.122.1$i"
|
||||||
daemonize -c /var/tmp -p vm${i}.pid -o vm${i}log.txt -- \
|
daemonize -c /var/tmp -p vm${i}.pid -o vm${i}log.txt -- \
|
||||||
$SSH zfs@$IP $TESTS $OS $i $VMs $CI_TYPE
|
$SSH zfs@$IP $TESTS $OS $i $VMs $CI_TYPE
|
||||||
@@ -58,7 +60,7 @@ if [ -z ${1:-} ]; then
|
|||||||
done
|
done
|
||||||
|
|
||||||
# wait for all vm's to finish
|
# wait for all vm's to finish
|
||||||
for i in $(seq 1 $VMs); do
|
for ((i=1; i<=VMs; i++)); do
|
||||||
tail --pid=$(cat vm${i}.pid) -f /dev/null
|
tail --pid=$(cat vm${i}.pid) -f /dev/null
|
||||||
pid=$(cat vm${i}log.pid)
|
pid=$(cat vm${i}log.pid)
|
||||||
rm -f vm${i}log.pid
|
rm -f vm${i}log.pid
|
||||||
@@ -72,19 +74,31 @@ fi
|
|||||||
export PATH="$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin"
|
export PATH="$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin"
|
||||||
case "$1" in
|
case "$1" in
|
||||||
freebsd*)
|
freebsd*)
|
||||||
|
TDIR="/usr/local/share/zfs"
|
||||||
sudo kldstat -n zfs 2>/dev/null && sudo kldunload zfs
|
sudo kldstat -n zfs 2>/dev/null && sudo kldunload zfs
|
||||||
sudo -E ./zfs/scripts/zfs.sh
|
sudo -E ./zfs/scripts/zfs.sh
|
||||||
TDIR="/usr/local/share/zfs"
|
sudo mv -f /var/tmp/*.txt /tmp
|
||||||
|
sudo newfs -U -t -L tmp /dev/vtbd1 >/dev/null
|
||||||
|
sudo mount -o noatime /dev/vtbd1 /var/tmp
|
||||||
|
sudo chmod 1777 /var/tmp
|
||||||
|
sudo mv -f /tmp/*.txt /var/tmp
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# use xfs @ /var/tmp for all distros
|
# use xfs @ /var/tmp for all distros
|
||||||
|
TDIR="/usr/share/zfs"
|
||||||
|
sudo -E modprobe zfs
|
||||||
sudo mv -f /var/tmp/*.txt /tmp
|
sudo mv -f /var/tmp/*.txt /tmp
|
||||||
sudo mkfs.xfs -fq /dev/vdb
|
sudo mkfs.xfs -fq /dev/vdb
|
||||||
sudo mount -o noatime /dev/vdb /var/tmp
|
sudo mount -o noatime /dev/vdb /var/tmp
|
||||||
sudo chmod 1777 /var/tmp
|
sudo chmod 1777 /var/tmp
|
||||||
sudo mv -f /tmp/*.txt /var/tmp
|
sudo mv -f /tmp/*.txt /var/tmp
|
||||||
sudo -E modprobe zfs
|
;;
|
||||||
TDIR="/usr/share/zfs"
|
esac
|
||||||
|
|
||||||
|
# enable io_uring on el9/el10
|
||||||
|
case "$1" in
|
||||||
|
almalinux9|almalinux10|centos-stream*)
|
||||||
|
sudo sysctl kernel.io_uring_disabled=0 > /dev/null
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ BASE="$HOME/work/zfs/zfs"
|
|||||||
MERGE="$BASE/.github/workflows/scripts/merge_summary.awk"
|
MERGE="$BASE/.github/workflows/scripts/merge_summary.awk"
|
||||||
|
|
||||||
# catch result files of testings (vm's should be there)
|
# catch result files of testings (vm's should be there)
|
||||||
for i in $(seq 1 $VMs); do
|
for ((i=1; i<=VMs; i++)); do
|
||||||
rsync -arL zfs@vm$i:$RESPATH/current $RESPATH/vm$i || true
|
rsync -arL zfs@vm$i:$RESPATH/current $RESPATH/vm$i || true
|
||||||
scp zfs@vm$i:"/var/tmp/*.txt" $RESPATH/vm$i || true
|
scp zfs@vm$i:"/var/tmp/*.txt" $RESPATH/vm$i || true
|
||||||
scp zfs@vm$i:"/var/tmp/*.rpm" $RESPATH/vm$i || true
|
scp zfs@vm$i:"/var/tmp/*.rpm" $RESPATH/vm$i || true
|
||||||
@@ -37,7 +37,7 @@ cp -f /var/tmp/*.txt $RESPATH || true
|
|||||||
cd $RESPATH
|
cd $RESPATH
|
||||||
|
|
||||||
# prepare result files for summary
|
# prepare result files for summary
|
||||||
for i in $(seq 1 $VMs); do
|
for ((i=1; i<=VMs; i++)); do
|
||||||
file="vm$i/build-stderr.txt"
|
file="vm$i/build-stderr.txt"
|
||||||
test -s $file && mv -f $file build-stderr.txt
|
test -s $file && mv -f $file build-stderr.txt
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ fi
|
|||||||
|
|
||||||
echo -e "\nFull logs for download:\n $1\n"
|
echo -e "\nFull logs for download:\n $1\n"
|
||||||
|
|
||||||
for i in $(seq 1 $VMs); do
|
for ((i=1; i<=VMs; i++)); do
|
||||||
rv=$(cat vm$i/tests-exitcode.txt)
|
rv=$(cat vm$i/tests-exitcode.txt)
|
||||||
|
|
||||||
if [ $rv = 0 ]; then
|
if [ $rv = 0 ]; then
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ on:
|
|||||||
options:
|
options:
|
||||||
- "Build RPMs"
|
- "Build RPMs"
|
||||||
- "Test repo"
|
- "Test repo"
|
||||||
|
patch_level:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
description: "(optional) patch level number"
|
||||||
repo_url:
|
repo_url:
|
||||||
type: string
|
type: string
|
||||||
required: false
|
required: false
|
||||||
@@ -47,7 +52,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: ['almalinux8', 'almalinux9', 'fedora40', 'fedora41', 'fedora42']
|
os: ['almalinux8', 'almalinux9', 'almalinux10', 'fedora41', 'fedora42']
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -78,7 +83,13 @@ jobs:
|
|||||||
mkdir -p /tmp/repo
|
mkdir -p /tmp/repo
|
||||||
ssh zfs@vm0 '$HOME/zfs/.github/workflows/scripts/qemu-test-repo-vm.sh' ${{ github.event.inputs.repo_url }}
|
ssh zfs@vm0 '$HOME/zfs/.github/workflows/scripts/qemu-test-repo-vm.sh' ${{ github.event.inputs.repo_url }}
|
||||||
else
|
else
|
||||||
.github/workflows/scripts/qemu-4-build.sh --repo --release --dkms --tarball ${{ matrix.os }}
|
EXTRA=""
|
||||||
|
if [ -n "${{ github.event.inputs.patch_level }}" ] ; then
|
||||||
|
EXTRA="--patch-level ${{ github.event.inputs.patch_level }}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
.github/workflows/scripts/qemu-4-build.sh $EXTRA \
|
||||||
|
--repo --release --dkms --tarball ${{ matrix.os }}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Prepare artifacts
|
- name: Prepare artifacts
|
||||||
|
|||||||
@@ -5,16 +5,11 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
include_stream9:
|
fedora_kernel_ver:
|
||||||
type: boolean
|
type: string
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: ""
|
||||||
description: 'Test on CentOS 9 stream'
|
description: "(optional) Experimental kernel version to install on Fedora (like '6.14' or '6.13.3-0.rc3')"
|
||||||
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 }}
|
||||||
@@ -34,8 +29,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", "debian11", "debian12", "fedora40", "fedora41", "fedora42", "freebsd13-4r", "freebsd14-2r", "freebsd15-0c", "ubuntu20", "ubuntu22", "ubuntu24"]'
|
FULL_OS='["almalinux8", "almalinux9", "almalinux10", "centos-stream9", "centos-stream10", "debian12", "debian13", "fedora41", "fedora42", "freebsd13-5r", "freebsd14-3s", "freebsd15-0c", "ubuntu22", "ubuntu24"]'
|
||||||
QUICK_OS='["almalinux8", "almalinux9", "debian12", "fedora42", "freebsd14-2r", "ubuntu24"]'
|
QUICK_OS='["almalinux8", "almalinux9", "almalinux10", "debian12", "fedora42", "freebsd14-3s", "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
|
||||||
@@ -48,14 +43,14 @@ jobs:
|
|||||||
else
|
else
|
||||||
os_selection="$FULL_OS"
|
os_selection="$FULL_OS"
|
||||||
fi
|
fi
|
||||||
os_json=$(echo ${os_selection} | jq -c)
|
|
||||||
|
|
||||||
# Add optional runners
|
if [ ${{ github.event.inputs.fedora_kernel_ver }} != "" ] ; then
|
||||||
if [ "${{ github.event.inputs.include_stream9 }}" == 'true' ]; then
|
# They specified a custom kernel version for Fedora. Use only
|
||||||
os_json=$(echo $os_json | jq -c '. += ["centos-stream9"]')
|
# Fedora runners.
|
||||||
fi
|
os_json=$(echo ${os_selection} | jq -c '[.[] | select(startswith("fedora"))]')
|
||||||
if [ "${{ github.event.inputs.include_stream10 }}" == 'true' ]; then
|
else
|
||||||
os_json=$(echo $os_json | jq -c '. += ["centos-stream10"]')
|
# Normal case
|
||||||
|
os_json=$(echo ${os_selection} | jq -c)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $os_json
|
echo $os_json
|
||||||
@@ -68,12 +63,12 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
# rhl: almalinux8, almalinux9, centos-stream9, fedora40, fedora41
|
# rhl: almalinux8, almalinux9, centos-stream9, fedora4x
|
||||||
# debian: debian11, debian12, ubuntu20, ubuntu22, ubuntu24
|
# debian: debian12, debian13, ubuntu22, ubuntu24
|
||||||
# misc: archlinux, tumbleweed
|
# misc: archlinux, tumbleweed
|
||||||
# FreeBSD variants of 2024-12:
|
# FreeBSD variants of 2025-06:
|
||||||
# FreeBSD Release: freebsd13-4r, freebsd14-2r
|
# FreeBSD Release: freebsd13-5r, freebsd14-2r, freebsd14-3r
|
||||||
# FreeBSD Stable: freebsd13-4s, freebsd14-2s
|
# FreeBSD Stable: freebsd13-5s, freebsd14-3s
|
||||||
# FreeBSD Current: freebsd15-0c
|
# 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
|
||||||
@@ -92,7 +87,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
run: .github/workflows/scripts/qemu-3-deps.sh ${{ matrix.os }}
|
run: .github/workflows/scripts/qemu-3-deps.sh ${{ matrix.os }} ${{ github.event.inputs.fedora_kernel_ver }}
|
||||||
|
|
||||||
- name: Build modules
|
- name: Build modules
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
|
|||||||
+12
-12
@@ -12,7 +12,8 @@ jobs:
|
|||||||
zloop:
|
zloop:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
env:
|
env:
|
||||||
TEST_DIR: /var/tmp/zloop
|
WORK_DIR: /mnt/zloop
|
||||||
|
CORE_DIR: /mnt/zloop/cores
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -40,38 +41,37 @@ jobs:
|
|||||||
sudo modprobe zfs
|
sudo modprobe zfs
|
||||||
- name: Tests
|
- name: Tests
|
||||||
run: |
|
run: |
|
||||||
sudo mkdir -p $TEST_DIR
|
sudo truncate -s 256G /mnt/vdev
|
||||||
# run for 10 minutes or at most 6 iterations for a maximum runner
|
sudo zpool create cipool -m $WORK_DIR -O compression=on -o autotrim=on /mnt/vdev
|
||||||
# time of 60 minutes.
|
sudo /usr/share/zfs/zloop.sh -t 600 -I 6 -l -m 1 -c $CORE_DIR -f $WORK_DIR -- -T 120 -P 60
|
||||||
sudo /usr/share/zfs/zloop.sh -t 600 -I 6 -l -m 1 -- -T 120 -P 60
|
|
||||||
- name: Prepare artifacts
|
- name: Prepare artifacts
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
sudo chmod +r -R $TEST_DIR/
|
sudo chmod +r -R $WORK_DIR/
|
||||||
- name: Ztest log
|
- name: Ztest log
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
grep -B10 -A1000 'ASSERT' $TEST_DIR/*/ztest.out || tail -n 1000 $TEST_DIR/*/ztest.out
|
grep -B10 -A1000 'ASSERT' $CORE_DIR/*/ztest.out || tail -n 1000 $CORE_DIR/*/ztest.out
|
||||||
- name: Gdb log
|
- name: Gdb log
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
sed -n '/Backtraces (full)/q;p' $TEST_DIR/*/ztest.gdb
|
sed -n '/Backtraces (full)/q;p' $CORE_DIR/*/ztest.gdb
|
||||||
- name: Zdb log
|
- name: Zdb log
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
cat $TEST_DIR/*/ztest.zdb
|
cat $CORE_DIR/*/ztest.zdb
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: Logs
|
name: Logs
|
||||||
path: |
|
path: |
|
||||||
/var/tmp/zloop/*/
|
/mnt/zloop/*/
|
||||||
!/var/tmp/zloop/*/vdev/
|
!/mnt/zloop/cores/*/vdev/
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: Pool files
|
name: Pool files
|
||||||
path: |
|
path: |
|
||||||
/var/tmp/zloop/*/vdev/
|
/mnt/zloop/cores/*/vdev/
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
|
|||||||
@@ -80,11 +80,13 @@ Youzhong Yang <youzhong@gmail.com>
|
|||||||
|
|
||||||
# Signed-off-by: overriding Author:
|
# Signed-off-by: overriding Author:
|
||||||
Alexander Ziaee <ziaee@FreeBSD.org> <concussious@runbox.com>
|
Alexander Ziaee <ziaee@FreeBSD.org> <concussious@runbox.com>
|
||||||
Ryan <errornointernet@envs.net> <error.nointernet@gmail.com>
|
Felix Schmidt <felixschmidt20@aol.com> <f.sch.prototype@gmail.com>
|
||||||
Sietse <sietse@wizdom.nu> <uglymotha@wizdom.nu>
|
Olivier Certner <olce@FreeBSD.org> <olce.freebsd@certner.fr>
|
||||||
Phil Sutter <phil@nwl.cc> <p.github@nwl.cc>
|
Phil Sutter <phil@nwl.cc> <p.github@nwl.cc>
|
||||||
poscat <poscat@poscat.moe> <poscat0x04@outlook.com>
|
poscat <poscat@poscat.moe> <poscat0x04@outlook.com>
|
||||||
Qiuhao Chen <chenqiuhao1997@gmail.com> <haohao0924@126.com>
|
Qiuhao Chen <chenqiuhao1997@gmail.com> <haohao0924@126.com>
|
||||||
|
Ryan <errornointernet@envs.net> <error.nointernet@gmail.com>
|
||||||
|
Sietse <sietse@wizdom.nu> <uglymotha@wizdom.nu>
|
||||||
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>
|
||||||
|
|
||||||
@@ -101,6 +103,7 @@ Tulsi Jain <tulsi.jain@delphix.com> <tulsi.jain@Tulsi-Jains-MacBook-Pro.local>
|
|||||||
# Mappings from Github no-reply addresses
|
# Mappings from Github no-reply addresses
|
||||||
ajs124 <git@ajs124.de> <ajs124@users.noreply.github.com>
|
ajs124 <git@ajs124.de> <ajs124@users.noreply.github.com>
|
||||||
Alek Pinchuk <apinchuk@axcient.com> <alek-p@users.noreply.github.com>
|
Alek Pinchuk <apinchuk@axcient.com> <alek-p@users.noreply.github.com>
|
||||||
|
Aleksandr Liber <aleksandr.liber@perforce.com> <61714074+AleksandrLiber@users.noreply.github.com>
|
||||||
Alexander Lobakin <alobakin@pm.me> <solbjorn@users.noreply.github.com>
|
Alexander Lobakin <alobakin@pm.me> <solbjorn@users.noreply.github.com>
|
||||||
Alexey Smirnoff <fling@member.fsf.org> <fling-@users.noreply.github.com>
|
Alexey Smirnoff <fling@member.fsf.org> <fling-@users.noreply.github.com>
|
||||||
Allen Holl <allen.m.holl@gmail.com> <65494904+allen-4@users.noreply.github.com>
|
Allen Holl <allen.m.holl@gmail.com> <65494904+allen-4@users.noreply.github.com>
|
||||||
@@ -137,6 +140,7 @@ Fedor Uporov <fuporov.vstack@gmail.com> <60701163+fuporovvStack@users.noreply.gi
|
|||||||
Felix Dörre <felix@dogcraft.de> <felixdoerre@users.noreply.github.com>
|
Felix Dörre <felix@dogcraft.de> <felixdoerre@users.noreply.github.com>
|
||||||
Felix Neumärker <xdch47@posteo.de> <34678034+xdch47@users.noreply.github.com>
|
Felix Neumärker <xdch47@posteo.de> <34678034+xdch47@users.noreply.github.com>
|
||||||
Finix Yan <yancw@info2soft.com> <Finix1979@users.noreply.github.com>
|
Finix Yan <yancw@info2soft.com> <Finix1979@users.noreply.github.com>
|
||||||
|
Friedrich Weber <f.weber@proxmox.com> <56110206+frwbr@users.noreply.github.com>
|
||||||
Gaurav Kumar <gauravk.18@gmail.com> <gaurkuma@users.noreply.github.com>
|
Gaurav Kumar <gauravk.18@gmail.com> <gaurkuma@users.noreply.github.com>
|
||||||
George Gaydarov <git@gg7.io> <gg7@users.noreply.github.com>
|
George Gaydarov <git@gg7.io> <gg7@users.noreply.github.com>
|
||||||
Georgy Yakovlev <gyakovlev@gentoo.org> <168902+gyakovlev@users.noreply.github.com>
|
Georgy Yakovlev <gyakovlev@gentoo.org> <168902+gyakovlev@users.noreply.github.com>
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ CONTRIBUTORS:
|
|||||||
Alejandro Colomar <Colomar.6.4.3@GMail.com>
|
Alejandro Colomar <Colomar.6.4.3@GMail.com>
|
||||||
Alejandro R. Sedeño <asedeno@mit.edu>
|
Alejandro R. Sedeño <asedeno@mit.edu>
|
||||||
Alek Pinchuk <alek@nexenta.com>
|
Alek Pinchuk <alek@nexenta.com>
|
||||||
|
Aleksandr Liber <aleksandr.liber@perforce.com>
|
||||||
Aleksa Sarai <cyphar@cyphar.com>
|
Aleksa Sarai <cyphar@cyphar.com>
|
||||||
Alexander Eremin <a.eremin@nexenta.com>
|
Alexander Eremin <a.eremin@nexenta.com>
|
||||||
Alexander Lobakin <alobakin@pm.me>
|
Alexander Lobakin <alobakin@pm.me>
|
||||||
@@ -81,6 +82,7 @@ CONTRIBUTORS:
|
|||||||
Arne Jansen <arne@die-jansens.de>
|
Arne Jansen <arne@die-jansens.de>
|
||||||
Aron Xu <happyaron.xu@gmail.com>
|
Aron Xu <happyaron.xu@gmail.com>
|
||||||
Arshad Hussain <arshad.hussain@aeoncomputing.com>
|
Arshad Hussain <arshad.hussain@aeoncomputing.com>
|
||||||
|
Artem <artem.vlasenko@ossrevival.org>
|
||||||
Arun KV <arun.kv@datacore.com>
|
Arun KV <arun.kv@datacore.com>
|
||||||
Arvind Sankar <nivedita@alum.mit.edu>
|
Arvind Sankar <nivedita@alum.mit.edu>
|
||||||
Attila Fülöp <attila@fueloep.org>
|
Attila Fülöp <attila@fueloep.org>
|
||||||
@@ -227,10 +229,12 @@ CONTRIBUTORS:
|
|||||||
Fedor Uporov <fuporov.vstack@gmail.com>
|
Fedor Uporov <fuporov.vstack@gmail.com>
|
||||||
Felix Dörre <felix@dogcraft.de>
|
Felix Dörre <felix@dogcraft.de>
|
||||||
Felix Neumärker <xdch47@posteo.de>
|
Felix Neumärker <xdch47@posteo.de>
|
||||||
|
Felix Schmidt <felixschmidt20@aol.com>
|
||||||
Feng Sun <loyou85@gmail.com>
|
Feng Sun <loyou85@gmail.com>
|
||||||
Finix Yan <yancw@info2soft.com>
|
Finix Yan <yancw@info2soft.com>
|
||||||
Francesco Mazzoli <f@mazzo.li>
|
Francesco Mazzoli <f@mazzo.li>
|
||||||
Frederik Wessels <wessels147@gmail.com>
|
Frederik Wessels <wessels147@gmail.com>
|
||||||
|
Friedrich Weber <f.weber@proxmox.com>
|
||||||
Frédéric Vanniere <f.vanniere@planet-work.com>
|
Frédéric Vanniere <f.vanniere@planet-work.com>
|
||||||
Gabriel A. Devenyi <gdevenyi@gmail.com>
|
Gabriel A. Devenyi <gdevenyi@gmail.com>
|
||||||
Garrett D'Amore <garrett@nexenta.com>
|
Garrett D'Amore <garrett@nexenta.com>
|
||||||
@@ -484,7 +488,7 @@ CONTRIBUTORS:
|
|||||||
Olaf Faaland <faaland1@llnl.gov>
|
Olaf Faaland <faaland1@llnl.gov>
|
||||||
Oleg Drokin <green@linuxhacker.ru>
|
Oleg Drokin <green@linuxhacker.ru>
|
||||||
Oleg Stepura <oleg@stepura.com>
|
Oleg Stepura <oleg@stepura.com>
|
||||||
Olivier Certner <olce.freebsd@certner.fr>
|
Olivier Certner <olce@FreeBSD.org>
|
||||||
Olivier Mazouffre <olivier.mazouffre@ims-bordeaux.fr>
|
Olivier Mazouffre <olivier.mazouffre@ims-bordeaux.fr>
|
||||||
omni <omni+vagant@hack.org>
|
omni <omni+vagant@hack.org>
|
||||||
Orivej Desh <orivej@gmx.fr>
|
Orivej Desh <orivej@gmx.fr>
|
||||||
@@ -522,6 +526,7 @@ CONTRIBUTORS:
|
|||||||
P.SCH <p88@yahoo.com>
|
P.SCH <p88@yahoo.com>
|
||||||
Qiuhao Chen <chenqiuhao1997@gmail.com>
|
Qiuhao Chen <chenqiuhao1997@gmail.com>
|
||||||
Quartz <yyhran@163.com>
|
Quartz <yyhran@163.com>
|
||||||
|
Quentin Thébault <quentin.thebault@defenso.fr>
|
||||||
Quentin Zdanis <zdanisq@gmail.com>
|
Quentin Zdanis <zdanisq@gmail.com>
|
||||||
Rafael Kitover <rkitover@gmail.com>
|
Rafael Kitover <rkitover@gmail.com>
|
||||||
RageLtMan <sempervictus@users.noreply.github.com>
|
RageLtMan <sempervictus@users.noreply.github.com>
|
||||||
@@ -573,6 +578,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 Pauka <me@spauka.se>
|
||||||
Sebastian Wuerl <s.wuerl@mailbox.org>
|
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>
|
||||||
@@ -589,6 +595,7 @@ CONTRIBUTORS:
|
|||||||
Shen Yan <shenyanxxxy@qq.com>
|
Shen Yan <shenyanxxxy@qq.com>
|
||||||
Sietse <sietse@wizdom.nu>
|
Sietse <sietse@wizdom.nu>
|
||||||
Simon Guest <simon.guest@tesujimath.org>
|
Simon Guest <simon.guest@tesujimath.org>
|
||||||
|
Simon Howard <fraggle@soulsphere.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>
|
||||||
Spencer Kinny <spencerkinny1995@gmail.com>
|
Spencer Kinny <spencerkinny1995@gmail.com>
|
||||||
@@ -610,6 +617,7 @@ CONTRIBUTORS:
|
|||||||
Stéphane Lesimple <speed47_github@speed47.net>
|
Stéphane Lesimple <speed47_github@speed47.net>
|
||||||
Suman Chakravartula <schakrava@gmail.com>
|
Suman Chakravartula <schakrava@gmail.com>
|
||||||
Sydney Vanda <sydney.m.vanda@intel.com>
|
Sydney Vanda <sydney.m.vanda@intel.com>
|
||||||
|
Syed Shahrukh Hussain <syed.shahrukh@ossrevival.org>
|
||||||
Sören Tempel <soeren+git@soeren-tempel.net>
|
Sören Tempel <soeren+git@soeren-tempel.net>
|
||||||
Tamas TEVESZ <ice@extreme.hu>
|
Tamas TEVESZ <ice@extreme.hu>
|
||||||
Teodor Spæren <teodor_spaeren@riseup.net>
|
Teodor Spæren <teodor_spaeren@riseup.net>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
Meta: 1
|
Meta: 1
|
||||||
Name: zfs
|
Name: zfs
|
||||||
Branch: 1.0
|
Branch: 1.0
|
||||||
Version: 2.3.2
|
Version: 2.3.4
|
||||||
Release: 1
|
Release: 1
|
||||||
Release-Tags: relext
|
Release-Tags: relext
|
||||||
License: CDDL
|
License: CDDL
|
||||||
Author: OpenZFS
|
Author: OpenZFS
|
||||||
Linux-Maximum: 6.14
|
Linux-Maximum: 6.16
|
||||||
Linux-Minimum: 4.18
|
Linux-Minimum: 4.18
|
||||||
|
|||||||
@@ -559,6 +559,7 @@ def section_arc(kstats_dict):
|
|||||||
print()
|
print()
|
||||||
|
|
||||||
compressed_size = arc_stats['compressed_size']
|
compressed_size = arc_stats['compressed_size']
|
||||||
|
uncompressed_size = arc_stats['uncompressed_size']
|
||||||
overhead_size = arc_stats['overhead_size']
|
overhead_size = arc_stats['overhead_size']
|
||||||
bonus_size = arc_stats['bonus_size']
|
bonus_size = arc_stats['bonus_size']
|
||||||
dnode_size = arc_stats['dnode_size']
|
dnode_size = arc_stats['dnode_size']
|
||||||
@@ -671,6 +672,8 @@ def section_arc(kstats_dict):
|
|||||||
print()
|
print()
|
||||||
|
|
||||||
print('ARC misc:')
|
print('ARC misc:')
|
||||||
|
prt_i2('Uncompressed size:', f_perc(uncompressed_size, compressed_size),
|
||||||
|
f_bytes(uncompressed_size))
|
||||||
prt_i1('Memory throttles:', arc_stats['memory_throttle_count'])
|
prt_i1('Memory throttles:', arc_stats['memory_throttle_count'])
|
||||||
prt_i1('Memory direct reclaims:', arc_stats['memory_direct_count'])
|
prt_i1('Memory direct reclaims:', arc_stats['memory_direct_count'])
|
||||||
prt_i1('Memory indirect reclaims:', arc_stats['memory_indirect_count'])
|
prt_i1('Memory indirect reclaims:', arc_stats['memory_indirect_count'])
|
||||||
|
|||||||
+7
-6
@@ -735,13 +735,14 @@ def calculate():
|
|||||||
v[group["percent"]] if v[group["percent"]] > 0 else 0
|
v[group["percent"]] if v[group["percent"]] > 0 else 0
|
||||||
|
|
||||||
if l2exist:
|
if l2exist:
|
||||||
|
l2asize = cur["l2_asize"]
|
||||||
v["l2hits"] = d["l2_hits"] / sint
|
v["l2hits"] = d["l2_hits"] / sint
|
||||||
v["l2miss"] = d["l2_misses"] / sint
|
v["l2miss"] = d["l2_misses"] / sint
|
||||||
v["l2read"] = v["l2hits"] + v["l2miss"]
|
v["l2read"] = v["l2hits"] + v["l2miss"]
|
||||||
v["l2hit%"] = 100 * v["l2hits"] / v["l2read"] if v["l2read"] > 0 else 0
|
v["l2hit%"] = 100 * v["l2hits"] / v["l2read"] if v["l2read"] > 0 else 0
|
||||||
|
|
||||||
v["l2miss%"] = 100 - v["l2hit%"] if v["l2read"] > 0 else 0
|
v["l2miss%"] = 100 - v["l2hit%"] if v["l2read"] > 0 else 0
|
||||||
v["l2asize"] = cur["l2_asize"]
|
v["l2asize"] = l2asize
|
||||||
v["l2size"] = cur["l2_size"]
|
v["l2size"] = cur["l2_size"]
|
||||||
v["l2bytes"] = d["l2_read_bytes"] / sint
|
v["l2bytes"] = d["l2_read_bytes"] / sint
|
||||||
v["l2wbytes"] = d["l2_write_bytes"] / sint
|
v["l2wbytes"] = d["l2_write_bytes"] / sint
|
||||||
@@ -751,11 +752,11 @@ def calculate():
|
|||||||
v["l2mru"] = cur["l2_mru_asize"]
|
v["l2mru"] = cur["l2_mru_asize"]
|
||||||
v["l2data"] = cur["l2_bufc_data_asize"]
|
v["l2data"] = cur["l2_bufc_data_asize"]
|
||||||
v["l2meta"] = cur["l2_bufc_metadata_asize"]
|
v["l2meta"] = cur["l2_bufc_metadata_asize"]
|
||||||
v["l2pref%"] = 100 * v["l2pref"] / v["l2asize"]
|
v["l2pref%"] = 100 * v["l2pref"] / l2asize if l2asize > 0 else 0
|
||||||
v["l2mfu%"] = 100 * v["l2mfu"] / v["l2asize"]
|
v["l2mfu%"] = 100 * v["l2mfu"] / l2asize if l2asize > 0 else 0
|
||||||
v["l2mru%"] = 100 * v["l2mru"] / v["l2asize"]
|
v["l2mru%"] = 100 * v["l2mru"] / l2asize if l2asize > 0 else 0
|
||||||
v["l2data%"] = 100 * v["l2data"] / v["l2asize"]
|
v["l2data%"] = 100 * v["l2data"] / l2asize if l2asize > 0 else 0
|
||||||
v["l2meta%"] = 100 * v["l2meta"] / v["l2asize"]
|
v["l2meta%"] = 100 * v["l2meta"] / l2asize if l2asize > 0 else 0
|
||||||
|
|
||||||
v["grow"] = 0 if cur["arc_no_grow"] else 1
|
v["grow"] = 0 if cur["arc_no_grow"] else 1
|
||||||
v["need"] = cur["arc_need_free"]
|
v["need"] = cur["arc_need_free"]
|
||||||
|
|||||||
+28
-21
@@ -619,8 +619,9 @@ livelist_metaslab_validate(spa_t *spa)
|
|||||||
metaslab_calculate_range_tree_type(vd, m,
|
metaslab_calculate_range_tree_type(vd, m,
|
||||||
&start, &shift);
|
&start, &shift);
|
||||||
metaslab_verify_t mv;
|
metaslab_verify_t mv;
|
||||||
mv.mv_allocated = zfs_range_tree_create(NULL,
|
mv.mv_allocated = zfs_range_tree_create_flags(
|
||||||
type, NULL, start, shift);
|
NULL, type, NULL, start, shift,
|
||||||
|
0, "livelist_metaslab_validate:mv_allocated");
|
||||||
mv.mv_vdid = vd->vdev_id;
|
mv.mv_vdid = vd->vdev_id;
|
||||||
mv.mv_msid = m->ms_id;
|
mv.mv_msid = m->ms_id;
|
||||||
mv.mv_start = m->ms_start;
|
mv.mv_start = m->ms_start;
|
||||||
@@ -2545,12 +2546,14 @@ snprintf_blkptr_compact(char *blkbuf, size_t buflen, const blkptr_t *bp,
|
|||||||
|
|
||||||
blkbuf[0] = '\0';
|
blkbuf[0] = '\0';
|
||||||
|
|
||||||
for (i = 0; i < ndvas; i++)
|
for (i = 0; i < ndvas; i++) {
|
||||||
(void) snprintf(blkbuf + strlen(blkbuf),
|
(void) snprintf(blkbuf + strlen(blkbuf),
|
||||||
buflen - strlen(blkbuf), "%llu:%llx:%llx ",
|
buflen - strlen(blkbuf), "%llu:%llx:%llx%s ",
|
||||||
(u_longlong_t)DVA_GET_VDEV(&dva[i]),
|
(u_longlong_t)DVA_GET_VDEV(&dva[i]),
|
||||||
(u_longlong_t)DVA_GET_OFFSET(&dva[i]),
|
(u_longlong_t)DVA_GET_OFFSET(&dva[i]),
|
||||||
(u_longlong_t)DVA_GET_ASIZE(&dva[i]));
|
(u_longlong_t)DVA_GET_ASIZE(&dva[i]),
|
||||||
|
(DVA_GET_GANG(&dva[i]) ? "G" : ""));
|
||||||
|
}
|
||||||
|
|
||||||
if (BP_IS_HOLE(bp)) {
|
if (BP_IS_HOLE(bp)) {
|
||||||
(void) snprintf(blkbuf + strlen(blkbuf),
|
(void) snprintf(blkbuf + strlen(blkbuf),
|
||||||
@@ -6320,8 +6323,9 @@ zdb_claim_removing(spa_t *spa, zdb_cb_t *zcb)
|
|||||||
|
|
||||||
ASSERT0(zfs_range_tree_space(svr->svr_allocd_segs));
|
ASSERT0(zfs_range_tree_space(svr->svr_allocd_segs));
|
||||||
|
|
||||||
zfs_range_tree_t *allocs = zfs_range_tree_create(NULL, ZFS_RANGE_SEG64,
|
zfs_range_tree_t *allocs = zfs_range_tree_create_flags(
|
||||||
NULL, 0, 0);
|
NULL, ZFS_RANGE_SEG64, NULL, 0, 0,
|
||||||
|
0, "zdb_claim_removing:allocs");
|
||||||
for (uint64_t msi = 0; msi < vd->vdev_ms_count; msi++) {
|
for (uint64_t msi = 0; msi < vd->vdev_ms_count; msi++) {
|
||||||
metaslab_t *msp = vd->vdev_ms[msi];
|
metaslab_t *msp = vd->vdev_ms[msi];
|
||||||
|
|
||||||
@@ -7704,7 +7708,8 @@ zdb_set_skip_mmp(char *target)
|
|||||||
* applies to the new_path parameter if allocated.
|
* applies to the new_path parameter if allocated.
|
||||||
*/
|
*/
|
||||||
static char *
|
static char *
|
||||||
import_checkpointed_state(char *target, nvlist_t *cfg, char **new_path)
|
import_checkpointed_state(char *target, nvlist_t *cfg, boolean_t target_is_spa,
|
||||||
|
char **new_path)
|
||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
char *poolname, *bogus_name = NULL;
|
char *poolname, *bogus_name = NULL;
|
||||||
@@ -7712,11 +7717,11 @@ import_checkpointed_state(char *target, nvlist_t *cfg, char **new_path)
|
|||||||
|
|
||||||
/* If the target is not a pool, the extract the pool name */
|
/* If the target is not a pool, the extract the pool name */
|
||||||
char *path_start = strchr(target, '/');
|
char *path_start = strchr(target, '/');
|
||||||
if (path_start != NULL) {
|
if (target_is_spa || path_start == NULL) {
|
||||||
|
poolname = target;
|
||||||
|
} else {
|
||||||
size_t poolname_len = path_start - target;
|
size_t poolname_len = path_start - target;
|
||||||
poolname = strndup(target, poolname_len);
|
poolname = strndup(target, poolname_len);
|
||||||
} else {
|
|
||||||
poolname = target;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg == NULL) {
|
if (cfg == NULL) {
|
||||||
@@ -7747,10 +7752,11 @@ import_checkpointed_state(char *target, nvlist_t *cfg, char **new_path)
|
|||||||
"with error %d\n", bogus_name, error);
|
"with error %d\n", bogus_name, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new_path != NULL && path_start != NULL) {
|
if (new_path != NULL && !target_is_spa) {
|
||||||
if (asprintf(new_path, "%s%s", bogus_name, path_start) == -1) {
|
if (asprintf(new_path, "%s%s", bogus_name,
|
||||||
|
path_start != NULL ? path_start : "") == -1) {
|
||||||
free(bogus_name);
|
free(bogus_name);
|
||||||
if (path_start != NULL)
|
if (!target_is_spa && path_start != NULL)
|
||||||
free(poolname);
|
free(poolname);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
@@ -7979,7 +7985,7 @@ verify_checkpoint_blocks(spa_t *spa)
|
|||||||
* name) so we can do verification on it against the current state
|
* name) so we can do verification on it against the current state
|
||||||
* of the pool.
|
* of the pool.
|
||||||
*/
|
*/
|
||||||
checkpoint_pool = import_checkpointed_state(spa->spa_name, NULL,
|
checkpoint_pool = import_checkpointed_state(spa->spa_name, NULL, B_TRUE,
|
||||||
NULL);
|
NULL);
|
||||||
ASSERT(strcmp(spa->spa_name, checkpoint_pool) != 0);
|
ASSERT(strcmp(spa->spa_name, checkpoint_pool) != 0);
|
||||||
|
|
||||||
@@ -8449,8 +8455,9 @@ dump_zpool(spa_t *spa)
|
|||||||
|
|
||||||
if (dump_opt['d'] || dump_opt['i']) {
|
if (dump_opt['d'] || dump_opt['i']) {
|
||||||
spa_feature_t f;
|
spa_feature_t f;
|
||||||
mos_refd_objs = zfs_range_tree_create(NULL, ZFS_RANGE_SEG64,
|
mos_refd_objs = zfs_range_tree_create_flags(
|
||||||
NULL, 0, 0);
|
NULL, ZFS_RANGE_SEG64, NULL, 0, 0,
|
||||||
|
0, "dump_zpool:mos_refd_objs");
|
||||||
dump_objset(dp->dp_meta_objset);
|
dump_objset(dp->dp_meta_objset);
|
||||||
|
|
||||||
if (dump_opt['d'] >= 3) {
|
if (dump_opt['d'] >= 3) {
|
||||||
@@ -8981,7 +8988,7 @@ zdb_read_block(char *thing, spa_t *spa)
|
|||||||
|
|
||||||
DVA_SET_VDEV(&dva[0], vd->vdev_id);
|
DVA_SET_VDEV(&dva[0], vd->vdev_id);
|
||||||
DVA_SET_OFFSET(&dva[0], offset);
|
DVA_SET_OFFSET(&dva[0], offset);
|
||||||
DVA_SET_GANG(&dva[0], !!(flags & ZDB_FLAG_GBH));
|
DVA_SET_GANG(&dva[0], 0);
|
||||||
DVA_SET_ASIZE(&dva[0], vdev_psize_to_asize(vd, psize));
|
DVA_SET_ASIZE(&dva[0], vdev_psize_to_asize(vd, psize));
|
||||||
|
|
||||||
BP_SET_BIRTH(bp, TXG_INITIAL, TXG_INITIAL);
|
BP_SET_BIRTH(bp, TXG_INITIAL, TXG_INITIAL);
|
||||||
@@ -8996,7 +9003,7 @@ zdb_read_block(char *thing, spa_t *spa)
|
|||||||
BP_SET_BYTEORDER(bp, ZFS_HOST_BYTEORDER);
|
BP_SET_BYTEORDER(bp, ZFS_HOST_BYTEORDER);
|
||||||
|
|
||||||
spa_config_enter(spa, SCL_STATE, FTAG, RW_READER);
|
spa_config_enter(spa, SCL_STATE, FTAG, RW_READER);
|
||||||
zio = zio_root(spa, NULL, NULL, 0);
|
zio = zio_root(spa, NULL, NULL, ZIO_FLAG_CANFAIL);
|
||||||
|
|
||||||
if (vd == vd->vdev_top) {
|
if (vd == vd->vdev_top) {
|
||||||
/*
|
/*
|
||||||
@@ -9118,7 +9125,7 @@ zdb_read_block(char *thing, spa_t *spa)
|
|||||||
ck_zio->io_offset =
|
ck_zio->io_offset =
|
||||||
DVA_GET_OFFSET(&bp->blk_dva[0]);
|
DVA_GET_OFFSET(&bp->blk_dva[0]);
|
||||||
ck_zio->io_bp = bp;
|
ck_zio->io_bp = bp;
|
||||||
zio_checksum_compute(ck_zio, ck, pabd, lsize);
|
zio_checksum_compute(ck_zio, ck, pabd, psize);
|
||||||
printf(
|
printf(
|
||||||
"%12s\t"
|
"%12s\t"
|
||||||
"cksum=%016llx:%016llx:%016llx:%016llx\n",
|
"cksum=%016llx:%016llx:%016llx:%016llx\n",
|
||||||
@@ -9695,7 +9702,7 @@ main(int argc, char **argv)
|
|||||||
char *checkpoint_target = NULL;
|
char *checkpoint_target = NULL;
|
||||||
if (dump_opt['k']) {
|
if (dump_opt['k']) {
|
||||||
checkpoint_pool = import_checkpointed_state(target, cfg,
|
checkpoint_pool = import_checkpointed_state(target, cfg,
|
||||||
&checkpoint_target);
|
target_is_spa, &checkpoint_target);
|
||||||
|
|
||||||
if (checkpoint_target != NULL)
|
if (checkpoint_target != NULL)
|
||||||
target = checkpoint_target;
|
target = checkpoint_target;
|
||||||
|
|||||||
+36
-31
@@ -134,11 +134,13 @@ zfs_agent_iter_vdev(zpool_handle_t *zhp, nvlist_t *nvl, void *arg)
|
|||||||
* of blkid cache and L2ARC VDEV does not contain pool guid in its
|
* of blkid cache and L2ARC VDEV does not contain pool guid in its
|
||||||
* blkid, so this is a special case for L2ARC VDEV.
|
* blkid, so this is a special case for L2ARC VDEV.
|
||||||
*/
|
*/
|
||||||
else if (gsp->gs_vdev_guid != 0 && gsp->gs_devid == NULL &&
|
else if (gsp->gs_vdev_guid != 0 &&
|
||||||
nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_GUID, &vdev_guid) == 0 &&
|
nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_GUID, &vdev_guid) == 0 &&
|
||||||
gsp->gs_vdev_guid == vdev_guid) {
|
gsp->gs_vdev_guid == vdev_guid) {
|
||||||
(void) nvlist_lookup_string(nvl, ZPOOL_CONFIG_DEVID,
|
if (gsp->gs_devid == NULL) {
|
||||||
&gsp->gs_devid);
|
(void) nvlist_lookup_string(nvl, ZPOOL_CONFIG_DEVID,
|
||||||
|
&gsp->gs_devid);
|
||||||
|
}
|
||||||
(void) nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_EXPANSION_TIME,
|
(void) nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_EXPANSION_TIME,
|
||||||
&gsp->gs_vdev_expandtime);
|
&gsp->gs_vdev_expandtime);
|
||||||
return (B_TRUE);
|
return (B_TRUE);
|
||||||
@@ -156,22 +158,28 @@ zfs_agent_iter_pool(zpool_handle_t *zhp, void *arg)
|
|||||||
/*
|
/*
|
||||||
* For each vdev in this pool, look for a match by devid
|
* For each vdev in this pool, look for a match by devid
|
||||||
*/
|
*/
|
||||||
if ((config = zpool_get_config(zhp, NULL)) != NULL) {
|
boolean_t found = B_FALSE;
|
||||||
if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
|
uint64_t pool_guid;
|
||||||
&nvl) == 0) {
|
|
||||||
(void) zfs_agent_iter_vdev(zhp, nvl, gsp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* if a match was found then grab the pool guid
|
|
||||||
*/
|
|
||||||
if (gsp->gs_vdev_guid && gsp->gs_devid) {
|
|
||||||
(void) nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID,
|
|
||||||
&gsp->gs_pool_guid);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/* Get pool configuration and extract pool GUID */
|
||||||
|
if ((config = zpool_get_config(zhp, NULL)) == NULL ||
|
||||||
|
nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID,
|
||||||
|
&pool_guid) != 0)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
/* Skip this pool if we're looking for a specific pool */
|
||||||
|
if (gsp->gs_pool_guid != 0 && pool_guid != gsp->gs_pool_guid)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &nvl) == 0)
|
||||||
|
found = zfs_agent_iter_vdev(zhp, nvl, gsp);
|
||||||
|
|
||||||
|
if (found && gsp->gs_pool_guid == 0)
|
||||||
|
gsp->gs_pool_guid = pool_guid;
|
||||||
|
|
||||||
|
out:
|
||||||
zpool_close(zhp);
|
zpool_close(zhp);
|
||||||
return (gsp->gs_devid != NULL && gsp->gs_vdev_guid != 0);
|
return (found);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -233,20 +241,17 @@ zfs_agent_post_event(const char *class, const char *subclass, nvlist_t *nvl)
|
|||||||
* For multipath, spare and l2arc devices ZFS_EV_VDEV_GUID or
|
* For multipath, spare and l2arc devices ZFS_EV_VDEV_GUID or
|
||||||
* ZFS_EV_POOL_GUID may be missing so find them.
|
* ZFS_EV_POOL_GUID may be missing so find them.
|
||||||
*/
|
*/
|
||||||
if (devid == NULL || pool_guid == 0 || vdev_guid == 0) {
|
search.gs_devid = devid;
|
||||||
if (devid == NULL)
|
search.gs_vdev_guid = vdev_guid;
|
||||||
search.gs_vdev_guid = vdev_guid;
|
search.gs_pool_guid = pool_guid;
|
||||||
else
|
zpool_iter(g_zfs_hdl, zfs_agent_iter_pool, &search);
|
||||||
search.gs_devid = devid;
|
if (devid == NULL)
|
||||||
zpool_iter(g_zfs_hdl, zfs_agent_iter_pool, &search);
|
devid = search.gs_devid;
|
||||||
if (devid == NULL)
|
if (pool_guid == 0)
|
||||||
devid = search.gs_devid;
|
pool_guid = search.gs_pool_guid;
|
||||||
if (pool_guid == 0)
|
if (vdev_guid == 0)
|
||||||
pool_guid = search.gs_pool_guid;
|
vdev_guid = search.gs_vdev_guid;
|
||||||
if (vdev_guid == 0)
|
devtype = search.gs_vdev_type;
|
||||||
vdev_guid = search.gs_vdev_guid;
|
|
||||||
devtype = search.gs_vdev_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We want to avoid reporting "remove" events coming from
|
* We want to avoid reporting "remove" events coming from
|
||||||
|
|||||||
@@ -441,8 +441,9 @@ zed_notify_slack_webhook()
|
|||||||
"${pathname}")"
|
"${pathname}")"
|
||||||
|
|
||||||
# Construct the JSON message for posting.
|
# Construct the JSON message for posting.
|
||||||
|
# shellcheck disable=SC2016
|
||||||
#
|
#
|
||||||
msg_json="$(printf '{"text": "*%s*\\n%s"}' "${subject}" "${msg_body}" )"
|
msg_json="$(printf '{"text": "*%s*\\n```%s```"}' "${subject}" "${msg_body}" )"
|
||||||
|
|
||||||
# Send the POST request and check for errors.
|
# Send the POST request and check for errors.
|
||||||
#
|
#
|
||||||
|
|||||||
+220
-5
@@ -37,6 +37,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <sys/debug.h>
|
#include <sys/debug.h>
|
||||||
|
#include <dirent.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <libgen.h>
|
#include <libgen.h>
|
||||||
@@ -121,6 +122,7 @@ static int zfs_do_change_key(int argc, char **argv);
|
|||||||
static int zfs_do_project(int argc, char **argv);
|
static int zfs_do_project(int argc, char **argv);
|
||||||
static int zfs_do_version(int argc, char **argv);
|
static int zfs_do_version(int argc, char **argv);
|
||||||
static int zfs_do_redact(int argc, char **argv);
|
static int zfs_do_redact(int argc, char **argv);
|
||||||
|
static int zfs_do_rewrite(int argc, char **argv);
|
||||||
static int zfs_do_wait(int argc, char **argv);
|
static int zfs_do_wait(int argc, char **argv);
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
@@ -193,6 +195,7 @@ typedef enum {
|
|||||||
HELP_CHANGE_KEY,
|
HELP_CHANGE_KEY,
|
||||||
HELP_VERSION,
|
HELP_VERSION,
|
||||||
HELP_REDACT,
|
HELP_REDACT,
|
||||||
|
HELP_REWRITE,
|
||||||
HELP_JAIL,
|
HELP_JAIL,
|
||||||
HELP_UNJAIL,
|
HELP_UNJAIL,
|
||||||
HELP_WAIT,
|
HELP_WAIT,
|
||||||
@@ -227,7 +230,7 @@ static zfs_command_t command_table[] = {
|
|||||||
{ "promote", zfs_do_promote, HELP_PROMOTE },
|
{ "promote", zfs_do_promote, HELP_PROMOTE },
|
||||||
{ "rename", zfs_do_rename, HELP_RENAME },
|
{ "rename", zfs_do_rename, HELP_RENAME },
|
||||||
{ "bookmark", zfs_do_bookmark, HELP_BOOKMARK },
|
{ "bookmark", zfs_do_bookmark, HELP_BOOKMARK },
|
||||||
{ "program", zfs_do_channel_program, HELP_CHANNEL_PROGRAM },
|
{ "diff", zfs_do_diff, HELP_DIFF },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
{ "list", zfs_do_list, HELP_LIST },
|
{ "list", zfs_do_list, HELP_LIST },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
@@ -249,27 +252,31 @@ static zfs_command_t command_table[] = {
|
|||||||
{ NULL },
|
{ NULL },
|
||||||
{ "send", zfs_do_send, HELP_SEND },
|
{ "send", zfs_do_send, HELP_SEND },
|
||||||
{ "receive", zfs_do_receive, HELP_RECEIVE },
|
{ "receive", zfs_do_receive, HELP_RECEIVE },
|
||||||
|
{ "redact", zfs_do_redact, HELP_REDACT },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
{ "allow", zfs_do_allow, HELP_ALLOW },
|
{ "allow", zfs_do_allow, HELP_ALLOW },
|
||||||
{ NULL },
|
|
||||||
{ "unallow", zfs_do_unallow, HELP_UNALLOW },
|
{ "unallow", zfs_do_unallow, HELP_UNALLOW },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
{ "hold", zfs_do_hold, HELP_HOLD },
|
{ "hold", zfs_do_hold, HELP_HOLD },
|
||||||
{ "holds", zfs_do_holds, HELP_HOLDS },
|
{ "holds", zfs_do_holds, HELP_HOLDS },
|
||||||
{ "release", zfs_do_release, HELP_RELEASE },
|
{ "release", zfs_do_release, HELP_RELEASE },
|
||||||
{ "diff", zfs_do_diff, HELP_DIFF },
|
{ NULL },
|
||||||
{ "load-key", zfs_do_load_key, HELP_LOAD_KEY },
|
{ "load-key", zfs_do_load_key, HELP_LOAD_KEY },
|
||||||
{ "unload-key", zfs_do_unload_key, HELP_UNLOAD_KEY },
|
{ "unload-key", zfs_do_unload_key, HELP_UNLOAD_KEY },
|
||||||
{ "change-key", zfs_do_change_key, HELP_CHANGE_KEY },
|
{ "change-key", zfs_do_change_key, HELP_CHANGE_KEY },
|
||||||
{ "redact", zfs_do_redact, HELP_REDACT },
|
{ NULL },
|
||||||
|
{ "program", zfs_do_channel_program, HELP_CHANNEL_PROGRAM },
|
||||||
|
{ "rewrite", zfs_do_rewrite, HELP_REWRITE },
|
||||||
{ "wait", zfs_do_wait, HELP_WAIT },
|
{ "wait", zfs_do_wait, HELP_WAIT },
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
|
{ NULL },
|
||||||
{ "jail", zfs_do_jail, HELP_JAIL },
|
{ "jail", zfs_do_jail, HELP_JAIL },
|
||||||
{ "unjail", zfs_do_unjail, HELP_UNJAIL },
|
{ "unjail", zfs_do_unjail, HELP_UNJAIL },
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
|
{ NULL },
|
||||||
{ "zone", zfs_do_zone, HELP_ZONE },
|
{ "zone", zfs_do_zone, HELP_ZONE },
|
||||||
{ "unzone", zfs_do_unzone, HELP_UNZONE },
|
{ "unzone", zfs_do_unzone, HELP_UNZONE },
|
||||||
#endif
|
#endif
|
||||||
@@ -432,6 +439,9 @@ get_usage(zfs_help_t idx)
|
|||||||
case HELP_REDACT:
|
case HELP_REDACT:
|
||||||
return (gettext("\tredact <snapshot> <bookmark> "
|
return (gettext("\tredact <snapshot> <bookmark> "
|
||||||
"<redaction_snapshot> ...\n"));
|
"<redaction_snapshot> ...\n"));
|
||||||
|
case HELP_REWRITE:
|
||||||
|
return (gettext("\trewrite [-rvx] [-o <offset>] [-l <length>] "
|
||||||
|
"<directory|file ...>\n"));
|
||||||
case HELP_JAIL:
|
case HELP_JAIL:
|
||||||
return (gettext("\tjail <jailid|jailname> <filesystem>\n"));
|
return (gettext("\tjail <jailid|jailname> <filesystem>\n"));
|
||||||
case HELP_UNJAIL:
|
case HELP_UNJAIL:
|
||||||
@@ -4440,7 +4450,7 @@ zfs_do_rollback(int argc, char **argv)
|
|||||||
if (cb.cb_create > 0)
|
if (cb.cb_create > 0)
|
||||||
min_txg = cb.cb_create;
|
min_txg = cb.cb_create;
|
||||||
|
|
||||||
if ((ret = zfs_iter_snapshots_v2(zhp, 0, rollback_check, &cb,
|
if ((ret = zfs_iter_snapshots_sorted_v2(zhp, 0, rollback_check, &cb,
|
||||||
min_txg, 0)) != 0)
|
min_txg, 0)) != 0)
|
||||||
goto out;
|
goto out;
|
||||||
if ((ret = zfs_iter_bookmarks_v2(zhp, 0, rollback_check, &cb)) != 0)
|
if ((ret = zfs_iter_bookmarks_v2(zhp, 0, rollback_check, &cb)) != 0)
|
||||||
@@ -7716,6 +7726,7 @@ unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual)
|
|||||||
struct extmnttab entry;
|
struct extmnttab entry;
|
||||||
const char *cmdname = (op == OP_SHARE) ? "unshare" : "unmount";
|
const char *cmdname = (op == OP_SHARE) ? "unshare" : "unmount";
|
||||||
ino_t path_inode;
|
ino_t path_inode;
|
||||||
|
char *zfs_mntpnt, *entry_mntpnt;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Search for the given (major,minor) pair in the mount table.
|
* Search for the given (major,minor) pair in the mount table.
|
||||||
@@ -7757,6 +7768,24 @@ unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the filesystem is mounted, check that the mountpoint matches
|
||||||
|
* the one in the mnttab entry w.r.t. provided path. If it doesn't,
|
||||||
|
* then we should not proceed further.
|
||||||
|
*/
|
||||||
|
entry_mntpnt = strdup(entry.mnt_mountp);
|
||||||
|
if (zfs_is_mounted(zhp, &zfs_mntpnt)) {
|
||||||
|
if (strcmp(zfs_mntpnt, entry_mntpnt) != 0) {
|
||||||
|
(void) fprintf(stderr, gettext("cannot %s '%s': "
|
||||||
|
"not an original mountpoint\n"), cmdname, path);
|
||||||
|
free(zfs_mntpnt);
|
||||||
|
free(entry_mntpnt);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
free(zfs_mntpnt);
|
||||||
|
}
|
||||||
|
free(entry_mntpnt);
|
||||||
|
|
||||||
if (op == OP_SHARE) {
|
if (op == OP_SHARE) {
|
||||||
char nfs_mnt_prop[ZFS_MAXPROPLEN];
|
char nfs_mnt_prop[ZFS_MAXPROPLEN];
|
||||||
char smbshare_prop[ZFS_MAXPROPLEN];
|
char smbshare_prop[ZFS_MAXPROPLEN];
|
||||||
@@ -9013,6 +9042,192 @@ zfs_do_project(int argc, char **argv)
|
|||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
zfs_rewrite_file(const char *path, boolean_t verbose, zfs_rewrite_args_t *args)
|
||||||
|
{
|
||||||
|
int fd, ret = 0;
|
||||||
|
|
||||||
|
fd = open(path, O_WRONLY);
|
||||||
|
if (fd < 0) {
|
||||||
|
ret = errno;
|
||||||
|
(void) fprintf(stderr, gettext("failed to open %s: %s\n"),
|
||||||
|
path, strerror(errno));
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ioctl(fd, ZFS_IOC_REWRITE, args) < 0) {
|
||||||
|
ret = errno;
|
||||||
|
(void) fprintf(stderr, gettext("failed to rewrite %s: %s\n"),
|
||||||
|
path, strerror(errno));
|
||||||
|
} else if (verbose) {
|
||||||
|
printf("%s\n", path);
|
||||||
|
}
|
||||||
|
|
||||||
|
close(fd);
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
zfs_rewrite_dir(const char *path, boolean_t verbose, boolean_t xdev, dev_t dev,
|
||||||
|
zfs_rewrite_args_t *args, nvlist_t *dirs)
|
||||||
|
{
|
||||||
|
struct dirent *ent;
|
||||||
|
DIR *dir;
|
||||||
|
int ret = 0, err;
|
||||||
|
|
||||||
|
dir = opendir(path);
|
||||||
|
if (dir == NULL) {
|
||||||
|
if (errno == ENOENT)
|
||||||
|
return (0);
|
||||||
|
ret = errno;
|
||||||
|
(void) fprintf(stderr, gettext("failed to opendir %s: %s\n"),
|
||||||
|
path, strerror(errno));
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t plen = strlen(path) + 1;
|
||||||
|
while ((ent = readdir(dir)) != NULL) {
|
||||||
|
char *fullname;
|
||||||
|
struct stat st;
|
||||||
|
|
||||||
|
if (ent->d_type != DT_REG && ent->d_type != DT_DIR)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (strcmp(ent->d_name, ".") == 0 ||
|
||||||
|
strcmp(ent->d_name, "..") == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (plen + strlen(ent->d_name) >= PATH_MAX) {
|
||||||
|
(void) fprintf(stderr, gettext("path too long %s/%s\n"),
|
||||||
|
path, ent->d_name);
|
||||||
|
ret = ENAMETOOLONG;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (asprintf(&fullname, "%s/%s", path, ent->d_name) == -1) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
gettext("failed to allocate memory\n"));
|
||||||
|
ret = ENOMEM;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (xdev) {
|
||||||
|
if (lstat(fullname, &st) < 0) {
|
||||||
|
ret = errno;
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
gettext("failed to stat %s: %s\n"),
|
||||||
|
fullname, strerror(errno));
|
||||||
|
free(fullname);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (st.st_dev != dev) {
|
||||||
|
free(fullname);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ent->d_type == DT_REG) {
|
||||||
|
err = zfs_rewrite_file(fullname, verbose, args);
|
||||||
|
if (err)
|
||||||
|
ret = err;
|
||||||
|
} else { /* DT_DIR */
|
||||||
|
fnvlist_add_uint64(dirs, fullname, dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
free(fullname);
|
||||||
|
}
|
||||||
|
|
||||||
|
closedir(dir);
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
zfs_rewrite_path(const char *path, boolean_t verbose, boolean_t recurse,
|
||||||
|
boolean_t xdev, zfs_rewrite_args_t *args, nvlist_t *dirs)
|
||||||
|
{
|
||||||
|
struct stat st;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
|
if (lstat(path, &st) < 0) {
|
||||||
|
ret = errno;
|
||||||
|
(void) fprintf(stderr, gettext("failed to stat %s: %s\n"),
|
||||||
|
path, strerror(errno));
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (S_ISREG(st.st_mode)) {
|
||||||
|
ret = zfs_rewrite_file(path, verbose, args);
|
||||||
|
} else if (S_ISDIR(st.st_mode) && recurse) {
|
||||||
|
ret = zfs_rewrite_dir(path, verbose, xdev, st.st_dev, args,
|
||||||
|
dirs);
|
||||||
|
}
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
zfs_do_rewrite(int argc, char **argv)
|
||||||
|
{
|
||||||
|
int ret = 0, err, c;
|
||||||
|
boolean_t recurse = B_FALSE, verbose = B_FALSE, xdev = B_FALSE;
|
||||||
|
|
||||||
|
if (argc < 2)
|
||||||
|
usage(B_FALSE);
|
||||||
|
|
||||||
|
zfs_rewrite_args_t args;
|
||||||
|
memset(&args, 0, sizeof (args));
|
||||||
|
|
||||||
|
while ((c = getopt(argc, argv, "l:o:rvx")) != -1) {
|
||||||
|
switch (c) {
|
||||||
|
case 'l':
|
||||||
|
args.len = strtoll(optarg, NULL, 0);
|
||||||
|
break;
|
||||||
|
case 'o':
|
||||||
|
args.off = strtoll(optarg, NULL, 0);
|
||||||
|
break;
|
||||||
|
case 'r':
|
||||||
|
recurse = B_TRUE;
|
||||||
|
break;
|
||||||
|
case 'v':
|
||||||
|
verbose = B_TRUE;
|
||||||
|
break;
|
||||||
|
case 'x':
|
||||||
|
xdev = B_TRUE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
|
||||||
|
optopt);
|
||||||
|
usage(B_FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
argv += optind;
|
||||||
|
argc -= optind;
|
||||||
|
if (argc == 0) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
gettext("missing file or directory target(s)\n"));
|
||||||
|
usage(B_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
nvlist_t *dirs = fnvlist_alloc();
|
||||||
|
for (int i = 0; i < argc; i++) {
|
||||||
|
err = zfs_rewrite_path(argv[i], verbose, recurse, xdev, &args,
|
||||||
|
dirs);
|
||||||
|
if (err)
|
||||||
|
ret = err;
|
||||||
|
}
|
||||||
|
nvpair_t *dir;
|
||||||
|
while ((dir = nvlist_next_nvpair(dirs, NULL)) != NULL) {
|
||||||
|
err = zfs_rewrite_dir(nvpair_name(dir), verbose, xdev,
|
||||||
|
fnvpair_value_uint64(dir), &args, dirs);
|
||||||
|
if (err)
|
||||||
|
ret = err;
|
||||||
|
fnvlist_remove_nvpair(dirs, dir);
|
||||||
|
}
|
||||||
|
fnvlist_free(dirs);
|
||||||
|
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
zfs_do_wait(int argc, char **argv)
|
zfs_do_wait(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
|||||||
+20
-19
@@ -521,11 +521,11 @@ get_usage(zpool_help_t idx)
|
|||||||
return (gettext("\ttrim [-dw] [-r <rate>] [-c | -s] <pool> "
|
return (gettext("\ttrim [-dw] [-r <rate>] [-c | -s] <pool> "
|
||||||
"[<device> ...]\n"));
|
"[<device> ...]\n"));
|
||||||
case HELP_STATUS:
|
case HELP_STATUS:
|
||||||
return (gettext("\tstatus [--power] [-j [--json-int, "
|
return (gettext("\tstatus [-DdegiLPpstvx] "
|
||||||
"--json-flat-vdevs, ...\n"
|
"[-c script1[,script2,...]] ...\n"
|
||||||
"\t --json-pool-key-guid]] [-c [script1,script2,...]] "
|
"\t [-j|--json [--json-flat-vdevs] [--json-int] "
|
||||||
"[-dDegiLpPstvx] ...\n"
|
"[--json-pool-key-guid]] ...\n"
|
||||||
"\t [-T d|u] [pool] [interval [count]]\n"));
|
"\t [-T d|u] [--power] [pool] [interval [count]]\n"));
|
||||||
case HELP_UPGRADE:
|
case HELP_UPGRADE:
|
||||||
return (gettext("\tupgrade\n"
|
return (gettext("\tupgrade\n"
|
||||||
"\tupgrade -v\n"
|
"\tupgrade -v\n"
|
||||||
@@ -10432,10 +10432,9 @@ print_status_reason(zpool_handle_t *zhp, status_cbdata_t *cbp,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ZPOOL_STATUS_REMOVED_DEV:
|
case ZPOOL_STATUS_REMOVED_DEV:
|
||||||
snprintf(status, ST_SIZE, gettext("One or more devices has "
|
snprintf(status, ST_SIZE, gettext("One or more devices have "
|
||||||
"been removed by the administrator.\n\tSufficient "
|
"been removed.\n\tSufficient replicas exist for the pool "
|
||||||
"replicas exist for the pool to continue functioning in "
|
"to continue functioning in a\n\tdegraded state.\n"));
|
||||||
"a\n\tdegraded state.\n"));
|
|
||||||
snprintf(action, AC_SIZE, gettext("Online the device "
|
snprintf(action, AC_SIZE, gettext("Online the device "
|
||||||
"using zpool online' or replace the device with\n\t'zpool "
|
"using zpool online' or replace the device with\n\t'zpool "
|
||||||
"replace'.\n"));
|
"replace'.\n"));
|
||||||
@@ -10980,28 +10979,30 @@ status_callback(zpool_handle_t *zhp, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* zpool status [-c [script1,script2,...]] [-dDegiLpPstvx] [--power] ...
|
* zpool status [-dDegiLpPstvx] [-c [script1,script2,...]] ...
|
||||||
* [-T d|u] [pool] [interval [count]]
|
* [-j|--json [--json-flat-vdevs] [--json-int] ...
|
||||||
|
* [--json-pool-key-guid]] [--power] [-T d|u] ...
|
||||||
|
* [pool] [interval [count]]
|
||||||
*
|
*
|
||||||
* -c CMD For each vdev, run command CMD
|
* -c CMD For each vdev, run command CMD
|
||||||
* -d Display Direct I/O write verify errors
|
|
||||||
* -D Display dedup status (undocumented)
|
* -D Display dedup status (undocumented)
|
||||||
|
* -d Display Direct I/O write verify errors
|
||||||
* -e Display only unhealthy vdevs
|
* -e Display only unhealthy vdevs
|
||||||
* -g Display guid for individual vdev name.
|
* -g Display guid for individual vdev name.
|
||||||
* -i Display vdev initialization status.
|
* -i Display vdev initialization status.
|
||||||
|
* -j [...] Display output in JSON format
|
||||||
|
* --json-flat-vdevs Display vdevs in flat hierarchy
|
||||||
|
* --json-int Display numbers in integer format instead of string
|
||||||
|
* --json-pool-key-guid Use pool GUID as key for pool objects
|
||||||
* -L Follow links when resolving vdev path name.
|
* -L Follow links when resolving vdev path name.
|
||||||
* -p Display values in parsable (exact) format.
|
|
||||||
* -P Display full path for vdev name.
|
* -P Display full path for vdev name.
|
||||||
|
* -p Display values in parsable (exact) format.
|
||||||
|
* --power Display vdev enclosure slot power status
|
||||||
* -s Display slow IOs column.
|
* -s Display slow IOs column.
|
||||||
* -t Display vdev TRIM status.
|
|
||||||
* -T Display a timestamp in date(1) or Unix format
|
* -T Display a timestamp in date(1) or Unix format
|
||||||
|
* -t Display vdev TRIM status.
|
||||||
* -v Display complete error logs
|
* -v Display complete error logs
|
||||||
* -x Display only pools with potential problems
|
* -x Display only pools with potential problems
|
||||||
* -j Display output in JSON format
|
|
||||||
* --power Display vdev enclosure slot power status
|
|
||||||
* --json-int Display numbers in inteeger format instead of string
|
|
||||||
* --json-flat-vdevs Display vdevs in flat hierarchy
|
|
||||||
* --json-pool-key-guid Use pool GUID as key for pool objects
|
|
||||||
*
|
*
|
||||||
* Describes the health status of all pools or some subset.
|
* Describes the health status of all pools or some subset.
|
||||||
*/
|
*/
|
||||||
|
|||||||
+25
-18
@@ -3881,7 +3881,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
|
|||||||
* If newvd is too small, it should fail with EOVERFLOW.
|
* If newvd is too small, it should fail with EOVERFLOW.
|
||||||
*
|
*
|
||||||
* If newvd is a distributed spare and it's being attached to a
|
* If newvd is a distributed spare and it's being attached to a
|
||||||
* dRAID which is not its parent it should fail with EINVAL.
|
* dRAID which is not its parent it should fail with ENOTSUP.
|
||||||
*/
|
*/
|
||||||
if (pvd->vdev_ops != &vdev_mirror_ops &&
|
if (pvd->vdev_ops != &vdev_mirror_ops &&
|
||||||
pvd->vdev_ops != &vdev_root_ops && (!replacing ||
|
pvd->vdev_ops != &vdev_root_ops && (!replacing ||
|
||||||
@@ -3900,7 +3900,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
|
|||||||
else if (ashift > oldvd->vdev_top->vdev_ashift)
|
else if (ashift > oldvd->vdev_top->vdev_ashift)
|
||||||
expected_error = EDOM;
|
expected_error = EDOM;
|
||||||
else if (newvd_is_dspare && pvd != vdev_draid_spare_get_parent(newvd))
|
else if (newvd_is_dspare && pvd != vdev_draid_spare_get_parent(newvd))
|
||||||
expected_error = EINVAL;
|
expected_error = ENOTSUP;
|
||||||
else
|
else
|
||||||
expected_error = 0;
|
expected_error = 0;
|
||||||
|
|
||||||
@@ -7812,6 +7812,9 @@ ztest_dataset_open(int d)
|
|||||||
|
|
||||||
ztest_dataset_name(name, ztest_opts.zo_pool, d);
|
ztest_dataset_name(name, ztest_opts.zo_pool, d);
|
||||||
|
|
||||||
|
if (ztest_opts.zo_verbose >= 6)
|
||||||
|
(void) printf("Opening %s\n", name);
|
||||||
|
|
||||||
(void) pthread_rwlock_rdlock(&ztest_name_lock);
|
(void) pthread_rwlock_rdlock(&ztest_name_lock);
|
||||||
|
|
||||||
error = ztest_dataset_create(name);
|
error = ztest_dataset_create(name);
|
||||||
@@ -8307,41 +8310,44 @@ static void
|
|||||||
ztest_generic_run(ztest_shared_t *zs, spa_t *spa)
|
ztest_generic_run(ztest_shared_t *zs, spa_t *spa)
|
||||||
{
|
{
|
||||||
kthread_t **run_threads;
|
kthread_t **run_threads;
|
||||||
int t;
|
int i, ndatasets;
|
||||||
|
|
||||||
run_threads = umem_zalloc(ztest_opts.zo_threads * sizeof (kthread_t *),
|
run_threads = umem_zalloc(ztest_opts.zo_threads * sizeof (kthread_t *),
|
||||||
UMEM_NOFAIL);
|
UMEM_NOFAIL);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actual number of datasets to be used.
|
||||||
|
*/
|
||||||
|
ndatasets = MIN(ztest_opts.zo_datasets, ztest_opts.zo_threads);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Prepare the datasets first.
|
||||||
|
*/
|
||||||
|
for (i = 0; i < ndatasets; i++)
|
||||||
|
VERIFY0(ztest_dataset_open(i));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Kick off all the tests that run in parallel.
|
* Kick off all the tests that run in parallel.
|
||||||
*/
|
*/
|
||||||
for (t = 0; t < ztest_opts.zo_threads; t++) {
|
for (i = 0; i < ztest_opts.zo_threads; i++) {
|
||||||
if (t < ztest_opts.zo_datasets && ztest_dataset_open(t) != 0) {
|
run_threads[i] = thread_create(NULL, 0, ztest_thread,
|
||||||
umem_free(run_threads, ztest_opts.zo_threads *
|
(void *)(uintptr_t)i, 0, NULL, TS_RUN | TS_JOINABLE,
|
||||||
sizeof (kthread_t *));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
run_threads[t] = thread_create(NULL, 0, ztest_thread,
|
|
||||||
(void *)(uintptr_t)t, 0, NULL, TS_RUN | TS_JOINABLE,
|
|
||||||
defclsyspri);
|
defclsyspri);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Wait for all of the tests to complete.
|
* Wait for all of the tests to complete.
|
||||||
*/
|
*/
|
||||||
for (t = 0; t < ztest_opts.zo_threads; t++)
|
for (i = 0; i < ztest_opts.zo_threads; i++)
|
||||||
VERIFY0(thread_join(run_threads[t]));
|
VERIFY0(thread_join(run_threads[i]));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Close all datasets. This must be done after all the threads
|
* Close all datasets. This must be done after all the threads
|
||||||
* are joined so we can be sure none of the datasets are in-use
|
* are joined so we can be sure none of the datasets are in-use
|
||||||
* by any of the threads.
|
* by any of the threads.
|
||||||
*/
|
*/
|
||||||
for (t = 0; t < ztest_opts.zo_threads; t++) {
|
for (i = 0; i < ndatasets; i++)
|
||||||
if (t < ztest_opts.zo_datasets)
|
ztest_dataset_close(i);
|
||||||
ztest_dataset_close(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
txg_wait_synced(spa_get_dsl(spa), 0);
|
txg_wait_synced(spa_get_dsl(spa), 0);
|
||||||
|
|
||||||
@@ -8464,6 +8470,7 @@ ztest_run(ztest_shared_t *zs)
|
|||||||
|
|
||||||
int d = ztest_random(ztest_opts.zo_datasets);
|
int d = ztest_random(ztest_opts.zo_datasets);
|
||||||
ztest_dataset_destroy(d);
|
ztest_dataset_destroy(d);
|
||||||
|
txg_wait_synced(spa_get_dsl(spa), 0);
|
||||||
}
|
}
|
||||||
zs->zs_enospc_count = 0;
|
zs->zs_enospc_count = 0;
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -10,8 +10,7 @@ AM_CPPFLAGS = \
|
|||||||
-I$(top_srcdir)/include \
|
-I$(top_srcdir)/include \
|
||||||
-I$(top_srcdir)/module/icp/include \
|
-I$(top_srcdir)/module/icp/include \
|
||||||
-I$(top_srcdir)/lib/libspl/include \
|
-I$(top_srcdir)/lib/libspl/include \
|
||||||
-I$(top_srcdir)/lib/libspl/include/os/@ac_system_l@ \
|
-I$(top_srcdir)/lib/libspl/include/os/@ac_system_l@
|
||||||
-I$(top_srcdir)/lib/libzpool/include
|
|
||||||
|
|
||||||
AM_LIBTOOLFLAGS = --silent
|
AM_LIBTOOLFLAGS = --silent
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
# modified version of the Autoconf Macro, you may extend this special
|
# modified version of the Autoconf Macro, you may extend this special
|
||||||
# exception to the GPL to apply to your modified version as well.
|
# exception to the GPL to apply to your modified version as well.
|
||||||
|
|
||||||
#serial 36
|
#serial 37
|
||||||
|
|
||||||
AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL])
|
AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL])
|
||||||
AC_DEFUN([AX_PYTHON_DEVEL],[
|
AC_DEFUN([AX_PYTHON_DEVEL],[
|
||||||
@@ -316,7 +316,7 @@ EOD`
|
|||||||
PYTHON_LIBS="-L$ac_python_libdir -lpython$ac_python_version"
|
PYTHON_LIBS="-L$ac_python_libdir -lpython$ac_python_version"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -z "PYTHON_LIBS"; then
|
if test -z "$PYTHON_LIBS"; then
|
||||||
AC_MSG_WARN([
|
AC_MSG_WARN([
|
||||||
Cannot determine location of your Python DSO. Please check it was installed with
|
Cannot determine location of your Python DSO. Please check it was installed with
|
||||||
dynamic libraries enabled, or try setting PYTHON_LIBS by hand.
|
dynamic libraries enabled, or try setting PYTHON_LIBS by hand.
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Linux 5.2 API change
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_SOPS_FREE_INODE], [
|
||||||
|
ZFS_LINUX_TEST_SRC([super_operations_free_inode], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
|
||||||
|
static void free_inode(struct inode *) { }
|
||||||
|
|
||||||
|
static struct super_operations sops __attribute__ ((unused)) = {
|
||||||
|
.free_inode = free_inode,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SOPS_FREE_INODE], [
|
||||||
|
AC_MSG_CHECKING([whether sops->free_inode() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([super_operations_free_inode], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_SOPS_FREE_INODE, 1, [sops->free_inode() exists])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
+42
-15
@@ -2,6 +2,22 @@ dnl #
|
|||||||
dnl # Supported mkdir() interfaces checked newest to oldest.
|
dnl # Supported mkdir() interfaces checked newest to oldest.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_MKDIR], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_MKDIR], [
|
||||||
|
dnl #
|
||||||
|
dnl # 6.15 API change
|
||||||
|
dnl # mkdir() returns struct dentry *
|
||||||
|
dnl #
|
||||||
|
ZFS_LINUX_TEST_SRC([mkdir_return_dentry], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
|
||||||
|
static struct dentry *mkdir(struct mnt_idmap *idmap,
|
||||||
|
struct inode *inode, struct dentry *dentry,
|
||||||
|
umode_t umode) { return dentry; }
|
||||||
|
static const struct inode_operations
|
||||||
|
iops __attribute__ ((unused)) = {
|
||||||
|
.mkdir = mkdir,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 6.3 API change
|
dnl # 6.3 API change
|
||||||
dnl # mkdir() takes struct mnt_idmap * as the first arg
|
dnl # mkdir() takes struct mnt_idmap * as the first arg
|
||||||
@@ -59,29 +75,40 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_MKDIR], [
|
|||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_MKDIR], [
|
AC_DEFUN([ZFS_AC_KERNEL_MKDIR], [
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 6.3 API change
|
dnl # 6.15 API change
|
||||||
dnl # mkdir() takes struct mnt_idmap * as the first arg
|
dnl # mkdir() returns struct dentry *
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_CHECKING([whether iops->mkdir() takes struct mnt_idmap*])
|
AC_MSG_CHECKING([whether iops->mkdir() returns struct dentry*])
|
||||||
ZFS_LINUX_TEST_RESULT([mkdir_mnt_idmap], [
|
ZFS_LINUX_TEST_RESULT([mkdir_return_dentry], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_IOPS_MKDIR_IDMAP, 1,
|
AC_DEFINE(HAVE_IOPS_MKDIR_DENTRY, 1,
|
||||||
[iops->mkdir() takes struct mnt_idmap*])
|
[iops->mkdir() returns struct dentry*])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 5.12 API change
|
dnl # 6.3 API change
|
||||||
dnl # The struct user_namespace arg was added as the first argument to
|
dnl # mkdir() takes struct mnt_idmap * as the first arg
|
||||||
dnl # mkdir() of the iops structure.
|
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_CHECKING([whether iops->mkdir() takes struct user_namespace*])
|
AC_MSG_CHECKING([whether iops->mkdir() takes struct mnt_idmap*])
|
||||||
ZFS_LINUX_TEST_RESULT([mkdir_user_namespace], [
|
ZFS_LINUX_TEST_RESULT([mkdir_mnt_idmap], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_IOPS_MKDIR_USERNS, 1,
|
AC_DEFINE(HAVE_IOPS_MKDIR_IDMAP, 1,
|
||||||
[iops->mkdir() takes struct user_namespace*])
|
[iops->mkdir() takes struct mnt_idmap*])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 5.12 API change
|
||||||
|
dnl # The struct user_namespace arg was added as the first argument to
|
||||||
|
dnl # mkdir() of the iops structure.
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([whether iops->mkdir() takes struct user_namespace*])
|
||||||
|
ZFS_LINUX_TEST_RESULT([mkdir_user_namespace], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOPS_MKDIR_USERNS, 1,
|
||||||
|
[iops->mkdir() takes struct user_namespace*])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -11,10 +11,12 @@ AC_DEFUN([ZFS_AC_KERNEL_OBJTOOL_HEADER], [
|
|||||||
#include <linux/objtool.h>
|
#include <linux/objtool.h>
|
||||||
],[
|
],[
|
||||||
],[
|
],[
|
||||||
|
objtool_header=$LINUX/include/linux/objtool.h
|
||||||
AC_DEFINE(HAVE_KERNEL_OBJTOOL_HEADER, 1,
|
AC_DEFINE(HAVE_KERNEL_OBJTOOL_HEADER, 1,
|
||||||
[kernel has linux/objtool.h])
|
[kernel has linux/objtool.h])
|
||||||
AC_MSG_RESULT(linux/objtool.h)
|
AC_MSG_RESULT(linux/objtool.h)
|
||||||
],[
|
],[
|
||||||
|
objtool_header=$LINUX/include/linux/frame.h
|
||||||
AC_MSG_RESULT(linux/frame.h)
|
AC_MSG_RESULT(linux/frame.h)
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
@@ -47,6 +49,15 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_OBJTOOL], [
|
|||||||
#error "STACK_FRAME_NON_STANDARD is not defined."
|
#error "STACK_FRAME_NON_STANDARD is not defined."
|
||||||
#endif
|
#endif
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl # 6.15 made CONFIG_OBJTOOL_WERROR=y the default. We need to handle
|
||||||
|
dnl # this or our build will fail.
|
||||||
|
ZFS_LINUX_TEST_SRC([config_objtool_werror], [
|
||||||
|
#if !defined(CONFIG_OBJTOOL_WERROR)
|
||||||
|
#error "CONFIG_OBJTOOL_WERROR is not defined."
|
||||||
|
#endif
|
||||||
|
])
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_OBJTOOL], [
|
AC_DEFUN([ZFS_AC_KERNEL_OBJTOOL], [
|
||||||
@@ -62,6 +73,31 @@ AC_DEFUN([ZFS_AC_KERNEL_OBJTOOL], [
|
|||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_STACK_FRAME_NON_STANDARD, 1,
|
AC_DEFINE(HAVE_STACK_FRAME_NON_STANDARD, 1,
|
||||||
[STACK_FRAME_NON_STANDARD is defined])
|
[STACK_FRAME_NON_STANDARD is defined])
|
||||||
|
|
||||||
|
dnl # Needed for kernels missing the asm macro. We grep
|
||||||
|
dnl # for it in the header file since there is currently
|
||||||
|
dnl # no test to check the result of assembling a file.
|
||||||
|
AC_MSG_CHECKING(
|
||||||
|
[whether STACK_FRAME_NON_STANDARD asm macro is defined])
|
||||||
|
dnl # Escape square brackets.
|
||||||
|
sp='@<:@@<:@:space:@:>@@:>@'
|
||||||
|
dotmacro='@<:@.@:>@macro'
|
||||||
|
regexp="^$sp*$dotmacro$sp+STACK_FRAME_NON_STANDARD$sp"
|
||||||
|
AS_IF([$EGREP -s -q "$regexp" $objtool_header],[
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_STACK_FRAME_NON_STANDARD_ASM, 1,
|
||||||
|
[STACK_FRAME_NON_STANDARD asm macro is defined])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether CONFIG_OBJTOOL_WERROR is defined])
|
||||||
|
ZFS_LINUX_TEST_RESULT([config_objtool_werror],[
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
CONFIG_OBJTOOL_WERROR_DEFINED=yes
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Linux 6.16 removed readahead_page
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_PAGEMAP_READAHEAD_PAGE], [
|
||||||
|
ZFS_LINUX_TEST_SRC([pagemap_has_readahead_page], [
|
||||||
|
#include <linux/pagemap.h>
|
||||||
|
], [
|
||||||
|
struct page *p __attribute__ ((unused)) = NULL;
|
||||||
|
struct readahead_control *ractl __attribute__ ((unused)) = NULL;
|
||||||
|
p = readahead_page(ractl);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_PAGEMAP_READAHEAD_PAGE], [
|
||||||
|
AC_MSG_CHECKING([whether readahead_page() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([pagemap_has_readahead_page], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE(HAVE_PAGEMAP_READAHEAD_PAGE, 1,
|
||||||
|
[readahead_page() exists])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
|
])
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# dnl
|
||||||
|
# dnl 5.8 (735e4ae5ba28) introduced a superblock scoped errseq_t to use to
|
||||||
|
# dnl record writeback errors for syncfs() to return. Up until 5.17, when
|
||||||
|
# dnl sync_fs errors were returned directly, this is the only way for us to
|
||||||
|
# dnl report an error from syncfs().
|
||||||
|
# dnl
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_WB_ERR], [
|
||||||
|
ZFS_LINUX_TEST_SRC([super_block_s_wb_err], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
|
||||||
|
static const struct super_block
|
||||||
|
sb __attribute__ ((unused)) = {
|
||||||
|
.s_wb_err = 0,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SUPER_BLOCK_S_WB_ERR], [
|
||||||
|
AC_MSG_CHECKING([whether super_block has s_wb_err])
|
||||||
|
ZFS_LINUX_TEST_RESULT([super_block_s_wb_err], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_SUPER_BLOCK_S_WB_ERR, 1,
|
||||||
|
[have super_block s_wb_err])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # 6.2: timer_delete_sync introduced, del_timer_sync deprecated and made
|
||||||
|
dnl # into a simple wrapper
|
||||||
|
dnl # 6.15: del_timer_sync removed
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_TIMER_DELETE_SYNC], [
|
||||||
|
ZFS_LINUX_TEST_SRC([timer_delete_sync], [
|
||||||
|
#include <linux/timer.h>
|
||||||
|
],[
|
||||||
|
struct timer_list *timer __attribute__((unused)) = NULL;
|
||||||
|
timer_delete_sync(timer);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_TIMER_DELETE_SYNC], [
|
||||||
|
AC_MSG_CHECKING([whether timer_delete_sync() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([timer_delete_sync], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_TIMER_DELETE_SYNC, 1,
|
||||||
|
[timer_delete_sync is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_TIMER], [
|
||||||
|
ZFS_AC_KERNEL_SRC_TIMER_DELETE_SYNC
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_TIMER], [
|
||||||
|
ZFS_AC_KERNEL_TIMER_DELETE_SYNC
|
||||||
|
])
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Linux 6.16 removes address_space_operations ->writepage
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_WRITEPAGE], [
|
||||||
|
ZFS_LINUX_TEST_SRC([vfs_has_writepage], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
|
||||||
|
static const struct address_space_operations
|
||||||
|
aops __attribute__ ((unused)) = {
|
||||||
|
.writepage = NULL,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_VFS_WRITEPAGE], [
|
||||||
|
AC_MSG_CHECKING([whether aops->writepage exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([vfs_has_writepage], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE(HAVE_VFS_WRITEPAGE, 1,
|
||||||
|
[address_space_operations->writepage exists])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
|
])
|
||||||
@@ -82,6 +82,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_VFS_MIGRATEPAGE
|
ZFS_AC_KERNEL_SRC_VFS_MIGRATEPAGE
|
||||||
ZFS_AC_KERNEL_SRC_VFS_FSYNC_2ARGS
|
ZFS_AC_KERNEL_SRC_VFS_FSYNC_2ARGS
|
||||||
ZFS_AC_KERNEL_SRC_VFS_READPAGES
|
ZFS_AC_KERNEL_SRC_VFS_READPAGES
|
||||||
|
ZFS_AC_KERNEL_SRC_VFS_WRITEPAGE
|
||||||
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
|
||||||
ZFS_AC_KERNEL_SRC_VFS_GENERIC_COPY_FILE_RANGE
|
ZFS_AC_KERNEL_SRC_VFS_GENERIC_COPY_FILE_RANGE
|
||||||
@@ -111,6 +112,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_STANDALONE_LINUX_STDARG
|
ZFS_AC_KERNEL_SRC_STANDALONE_LINUX_STDARG
|
||||||
ZFS_AC_KERNEL_SRC_STRLCPY
|
ZFS_AC_KERNEL_SRC_STRLCPY
|
||||||
ZFS_AC_KERNEL_SRC_PAGEMAP_FOLIO_WAIT_BIT
|
ZFS_AC_KERNEL_SRC_PAGEMAP_FOLIO_WAIT_BIT
|
||||||
|
ZFS_AC_KERNEL_SRC_PAGEMAP_READAHEAD_PAGE
|
||||||
ZFS_AC_KERNEL_SRC_ADD_DISK
|
ZFS_AC_KERNEL_SRC_ADD_DISK
|
||||||
ZFS_AC_KERNEL_SRC_KTHREAD
|
ZFS_AC_KERNEL_SRC_KTHREAD
|
||||||
ZFS_AC_KERNEL_SRC_ZERO_PAGE
|
ZFS_AC_KERNEL_SRC_ZERO_PAGE
|
||||||
@@ -130,6 +132,9 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
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
|
ZFS_AC_KERNEL_SRC_PIN_USER_PAGES
|
||||||
|
ZFS_AC_KERNEL_SRC_TIMER
|
||||||
|
ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_WB_ERR
|
||||||
|
ZFS_AC_KERNEL_SRC_SOPS_FREE_INODE
|
||||||
case "$host_cpu" in
|
case "$host_cpu" in
|
||||||
powerpc*)
|
powerpc*)
|
||||||
ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE
|
ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE
|
||||||
@@ -195,6 +200,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_VFS_MIGRATEPAGE
|
ZFS_AC_KERNEL_VFS_MIGRATEPAGE
|
||||||
ZFS_AC_KERNEL_VFS_FSYNC_2ARGS
|
ZFS_AC_KERNEL_VFS_FSYNC_2ARGS
|
||||||
ZFS_AC_KERNEL_VFS_READPAGES
|
ZFS_AC_KERNEL_VFS_READPAGES
|
||||||
|
ZFS_AC_KERNEL_VFS_WRITEPAGE
|
||||||
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
|
||||||
ZFS_AC_KERNEL_VFS_GENERIC_COPY_FILE_RANGE
|
ZFS_AC_KERNEL_VFS_GENERIC_COPY_FILE_RANGE
|
||||||
@@ -224,6 +230,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_STANDALONE_LINUX_STDARG
|
ZFS_AC_KERNEL_STANDALONE_LINUX_STDARG
|
||||||
ZFS_AC_KERNEL_STRLCPY
|
ZFS_AC_KERNEL_STRLCPY
|
||||||
ZFS_AC_KERNEL_PAGEMAP_FOLIO_WAIT_BIT
|
ZFS_AC_KERNEL_PAGEMAP_FOLIO_WAIT_BIT
|
||||||
|
ZFS_AC_KERNEL_PAGEMAP_READAHEAD_PAGE
|
||||||
ZFS_AC_KERNEL_ADD_DISK
|
ZFS_AC_KERNEL_ADD_DISK
|
||||||
ZFS_AC_KERNEL_KTHREAD
|
ZFS_AC_KERNEL_KTHREAD
|
||||||
ZFS_AC_KERNEL_ZERO_PAGE
|
ZFS_AC_KERNEL_ZERO_PAGE
|
||||||
@@ -244,6 +251,9 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
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
|
ZFS_AC_KERNEL_PIN_USER_PAGES
|
||||||
|
ZFS_AC_KERNEL_TIMER
|
||||||
|
ZFS_AC_KERNEL_SUPER_BLOCK_S_WB_ERR
|
||||||
|
ZFS_AC_KERNEL_SOPS_FREE_INODE
|
||||||
case "$host_cpu" in
|
case "$host_cpu" in
|
||||||
powerpc*)
|
powerpc*)
|
||||||
ZFS_AC_KERNEL_CPU_HAS_FEATURE
|
ZFS_AC_KERNEL_CPU_HAS_FEATURE
|
||||||
|
|||||||
+46
-23
@@ -38,9 +38,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE], [
|
|||||||
AC_MSG_CHECKING([whether host toolchain supports SSE])
|
AC_MSG_CHECKING([whether host toolchain supports SSE])
|
||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("xorps %xmm0, %xmm1");
|
__asm__ __volatile__("xorps %xmm0, %xmm1");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_DEFINE([HAVE_SSE], 1, [Define if host toolchain supports SSE])
|
AC_DEFINE([HAVE_SSE], 1, [Define if host toolchain supports SSE])
|
||||||
@@ -57,9 +58,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE2], [
|
|||||||
AC_MSG_CHECKING([whether host toolchain supports SSE2])
|
AC_MSG_CHECKING([whether host toolchain supports SSE2])
|
||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("pxor %xmm0, %xmm1");
|
__asm__ __volatile__("pxor %xmm0, %xmm1");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_DEFINE([HAVE_SSE2], 1, [Define if host toolchain supports SSE2])
|
AC_DEFINE([HAVE_SSE2], 1, [Define if host toolchain supports SSE2])
|
||||||
@@ -76,10 +78,11 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE3], [
|
|||||||
AC_MSG_CHECKING([whether host toolchain supports SSE3])
|
AC_MSG_CHECKING([whether host toolchain supports SSE3])
|
||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
char v[16];
|
char v[16];
|
||||||
__asm__ __volatile__("lddqu %0,%%xmm0" :: "m"(v[0]));
|
__asm__ __volatile__("lddqu %0,%%xmm0" :: "m"(v[0]));
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_DEFINE([HAVE_SSE3], 1, [Define if host toolchain supports SSE3])
|
AC_DEFINE([HAVE_SSE3], 1, [Define if host toolchain supports SSE3])
|
||||||
@@ -96,9 +99,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSSE3], [
|
|||||||
AC_MSG_CHECKING([whether host toolchain supports SSSE3])
|
AC_MSG_CHECKING([whether host toolchain supports SSSE3])
|
||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("pshufb %xmm0,%xmm1");
|
__asm__ __volatile__("pshufb %xmm0,%xmm1");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_DEFINE([HAVE_SSSE3], 1, [Define if host toolchain supports SSSE3])
|
AC_DEFINE([HAVE_SSSE3], 1, [Define if host toolchain supports SSSE3])
|
||||||
@@ -115,9 +119,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE4_1], [
|
|||||||
AC_MSG_CHECKING([whether host toolchain supports SSE4.1])
|
AC_MSG_CHECKING([whether host toolchain supports SSE4.1])
|
||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("pmaxsb %xmm0,%xmm1");
|
__asm__ __volatile__("pmaxsb %xmm0,%xmm1");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_DEFINE([HAVE_SSE4_1], 1, [Define if host toolchain supports SSE4.1])
|
AC_DEFINE([HAVE_SSE4_1], 1, [Define if host toolchain supports SSE4.1])
|
||||||
@@ -134,9 +139,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE4_2], [
|
|||||||
AC_MSG_CHECKING([whether host toolchain supports SSE4.2])
|
AC_MSG_CHECKING([whether host toolchain supports SSE4.2])
|
||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("pcmpgtq %xmm0, %xmm1");
|
__asm__ __volatile__("pcmpgtq %xmm0, %xmm1");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_DEFINE([HAVE_SSE4_2], 1, [Define if host toolchain supports SSE4.2])
|
AC_DEFINE([HAVE_SSE4_2], 1, [Define if host toolchain supports SSE4.2])
|
||||||
@@ -153,10 +159,11 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX], [
|
|||||||
AC_MSG_CHECKING([whether host toolchain supports AVX])
|
AC_MSG_CHECKING([whether host toolchain supports AVX])
|
||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
char v[32];
|
char v[32];
|
||||||
__asm__ __volatile__("vmovdqa %0,%%ymm0" :: "m"(v[0]));
|
__asm__ __volatile__("vmovdqa %0,%%ymm0" :: "m"(v[0]));
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@@ -174,9 +181,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX2], [
|
|||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
[
|
[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("vpshufb %ymm0,%ymm1,%ymm2");
|
__asm__ __volatile__("vpshufb %ymm0,%ymm1,%ymm2");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@@ -194,9 +202,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512F], [
|
|||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
[
|
[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("vpandd %zmm0,%zmm1,%zmm2");
|
__asm__ __volatile__("vpandd %zmm0,%zmm1,%zmm2");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@@ -214,9 +223,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512CD], [
|
|||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
[
|
[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("vplzcntd %zmm0,%zmm1");
|
__asm__ __volatile__("vplzcntd %zmm0,%zmm1");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@@ -234,9 +244,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512DQ], [
|
|||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
[
|
[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("vandpd %zmm0,%zmm1,%zmm2");
|
__asm__ __volatile__("vandpd %zmm0,%zmm1,%zmm2");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@@ -254,9 +265,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512BW], [
|
|||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
[
|
[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("vpshufb %zmm0,%zmm1,%zmm2");
|
__asm__ __volatile__("vpshufb %zmm0,%zmm1,%zmm2");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@@ -274,9 +286,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512IFMA], [
|
|||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
[
|
[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("vpmadd52luq %zmm0,%zmm1,%zmm2");
|
__asm__ __volatile__("vpmadd52luq %zmm0,%zmm1,%zmm2");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@@ -294,9 +307,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512VBMI], [
|
|||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
[
|
[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("vpermb %zmm0,%zmm1,%zmm2");
|
__asm__ __volatile__("vpermb %zmm0,%zmm1,%zmm2");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@@ -314,9 +328,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512PF], [
|
|||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
[
|
[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("vgatherpf0dps (%rsi,%zmm0,4){%k1}");
|
__asm__ __volatile__("vgatherpf0dps (%rsi,%zmm0,4){%k1}");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@@ -334,9 +349,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512ER], [
|
|||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
[
|
[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("vexp2pd %zmm0,%zmm1");
|
__asm__ __volatile__("vexp2pd %zmm0,%zmm1");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@@ -354,9 +370,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512VL], [
|
|||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
[
|
[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("vpabsq %zmm0,%zmm1");
|
__asm__ __volatile__("vpabsq %zmm0,%zmm1");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@@ -374,9 +391,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AES], [
|
|||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
[
|
[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("aesenc %xmm0, %xmm1");
|
__asm__ __volatile__("aesenc %xmm0, %xmm1");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@@ -394,9 +412,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_PCLMULQDQ], [
|
|||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
[
|
[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("pclmulqdq %0, %%xmm0, %%xmm1" :: "i"(0));
|
__asm__ __volatile__("pclmulqdq %0, %%xmm0, %%xmm1" :: "i"(0));
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@@ -414,9 +433,10 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_MOVBE], [
|
|||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
[
|
[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("movbe 0(%eax), %eax");
|
__asm__ __volatile__("movbe 0(%eax), %eax");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@@ -434,10 +454,11 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_XSAVE], [
|
|||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
[
|
[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
char b[4096] __attribute__ ((aligned (64)));
|
char b[4096] __attribute__ ((aligned (64)));
|
||||||
__asm__ __volatile__("xsave %[b]\n" : : [b] "m" (*b) : "memory");
|
__asm__ __volatile__("xsave %[b]\n" : : [b] "m" (*b) : "memory");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@@ -455,10 +476,11 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_XSAVEOPT], [
|
|||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
[
|
[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
char b[4096] __attribute__ ((aligned (64)));
|
char b[4096] __attribute__ ((aligned (64)));
|
||||||
__asm__ __volatile__("xsaveopt %[b]\n" : : [b] "m" (*b) : "memory");
|
__asm__ __volatile__("xsaveopt %[b]\n" : : [b] "m" (*b) : "memory");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@@ -476,10 +498,11 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_XSAVES], [
|
|||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
[
|
[
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
char b[4096] __attribute__ ((aligned (64)));
|
char b[4096] __attribute__ ((aligned (64)));
|
||||||
__asm__ __volatile__("xsaves %[b]\n" : : [b] "m" (*b) : "memory");
|
__asm__ __volatile__("xsaves %[b]\n" : : [b] "m" (*b) : "memory");
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
|
|||||||
@@ -34,6 +34,22 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_LIBUNWIND], [
|
|||||||
], [
|
], [
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
])
|
])
|
||||||
|
dnl LLVM includes it's own libunwind library, which
|
||||||
|
dnl defines the highest numbered register in a different
|
||||||
|
dnl way, and has an incompatible unw_resname function.
|
||||||
|
AC_MSG_CHECKING([whether libunwind is llvm libunwind])
|
||||||
|
AC_COMPILE_IFELSE([
|
||||||
|
AC_LANG_PROGRAM([
|
||||||
|
#include <libunwind.h>
|
||||||
|
#if !defined(_LIBUNWIND_HIGHEST_DWARF_REGISTER)
|
||||||
|
#error "_LIBUNWIND_HIGHEST_DWARF_REGISTER is not defined"
|
||||||
|
#endif
|
||||||
|
], [])], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE(IS_LIBUNWIND_LLVM, 1, [libunwind is llvm libunwind])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
AX_RESTORE_FLAGS
|
AX_RESTORE_FLAGS
|
||||||
], [
|
], [
|
||||||
AS_IF([test "x$with_libunwind" = "xyes"], [
|
AS_IF([test "x$with_libunwind" = "xyes"], [
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Check for statx() function and STATX_MNT_ID availability
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_CONFIG_USER_STATX], [
|
||||||
|
AC_CHECK_HEADERS([linux/stat.h],
|
||||||
|
[have_stat_headers=yes],
|
||||||
|
[have_stat_headers=no])
|
||||||
|
|
||||||
|
AS_IF([test "x$have_stat_headers" = "xyes"], [
|
||||||
|
AC_CHECK_FUNC([statx], [
|
||||||
|
AC_DEFINE([HAVE_STATX], [1], [statx() is available])
|
||||||
|
|
||||||
|
dnl Check for STATX_MNT_ID availability
|
||||||
|
AC_MSG_CHECKING([for STATX_MNT_ID])
|
||||||
|
AC_COMPILE_IFELSE([
|
||||||
|
AC_LANG_PROGRAM([[
|
||||||
|
#include <linux/stat.h>
|
||||||
|
]], [[
|
||||||
|
struct statx stx;
|
||||||
|
int mask = STATX_MNT_ID;
|
||||||
|
(void)mask;
|
||||||
|
(void)stx.stx_mnt_id;
|
||||||
|
]])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE([HAVE_STATX_MNT_ID], [1], [STATX_MNT_ID is available])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
], [
|
||||||
|
AC_MSG_WARN([linux/stat.h not found; skipping statx support])
|
||||||
|
])
|
||||||
|
]) dnl end AC_DEFUN
|
||||||
@@ -17,6 +17,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER], [
|
|||||||
ZFS_AC_CONFIG_USER_LIBUDEV
|
ZFS_AC_CONFIG_USER_LIBUDEV
|
||||||
ZFS_AC_CONFIG_USER_LIBUUID
|
ZFS_AC_CONFIG_USER_LIBUUID
|
||||||
ZFS_AC_CONFIG_USER_LIBBLKID
|
ZFS_AC_CONFIG_USER_LIBBLKID
|
||||||
|
ZFS_AC_CONFIG_USER_STATX
|
||||||
])
|
])
|
||||||
ZFS_AC_CONFIG_USER_LIBTIRPC
|
ZFS_AC_CONFIG_USER_LIBTIRPC
|
||||||
ZFS_AC_CONFIG_USER_LIBCRYPTO
|
ZFS_AC_CONFIG_USER_LIBCRYPTO
|
||||||
|
|||||||
@@ -205,6 +205,46 @@ AC_DEFUN([ZFS_AC_DEBUG_INVARIANTS], [
|
|||||||
AC_MSG_RESULT([$enable_invariants])
|
AC_MSG_RESULT([$enable_invariants])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl # Disabled by default. If enabled allows a configured "turn objtools
|
||||||
|
dnl # warnings into errors" (CONFIG_OBJTOOL_WERROR) behavior to take effect.
|
||||||
|
dnl # If disabled, objtool warnings are never turned into errors. It can't
|
||||||
|
dnl # be enabled if the kernel wasn't compiled with CONFIG_OBJTOOL_WERROR=y.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_OBJTOOL_WERROR], [
|
||||||
|
AC_MSG_CHECKING([whether objtool error on warning behavior is enabled])
|
||||||
|
AC_ARG_ENABLE([objtool-werror],
|
||||||
|
[AS_HELP_STRING([--enable-objtool-werror],
|
||||||
|
[Enable objtool's error on warning behaviour if present @<:@default=no@:>@])],
|
||||||
|
[enable_objtool_werror=$enableval],
|
||||||
|
[enable_objtool_werror=no])
|
||||||
|
AC_MSG_RESULT([$enable_objtool_werror])
|
||||||
|
|
||||||
|
AS_IF([test x$CONFIG_OBJTOOL_WERROR_DEFINED = xyes],[
|
||||||
|
AS_IF([test x$enable_objtool_werror = xyes],[
|
||||||
|
AC_MSG_NOTICE([enable-objtool-werror defined, keeping -Werror ])
|
||||||
|
],[
|
||||||
|
AC_MSG_NOTICE([enable-objtool-werror undefined, disabling -Werror ])
|
||||||
|
OBJTOOL_DISABLE_WERROR=y
|
||||||
|
abs_objtool_binary=$kernelsrc/tools/objtool/objtool
|
||||||
|
AS_IF([test -x $abs_objtool_binary],[],[
|
||||||
|
AC_MSG_ERROR([*** objtool binary $abs_objtool_binary not found])
|
||||||
|
])
|
||||||
|
dnl # The path to the wrapper is defined in modules/Makefile.in.
|
||||||
|
])
|
||||||
|
],[
|
||||||
|
dnl # We can't enable --Werror if it's not there.
|
||||||
|
AS_IF([test x$enable_objtool_werror = xyes],[
|
||||||
|
AC_MSG_ERROR([
|
||||||
|
*** Cannot enable objtool-werror,
|
||||||
|
*** a kernel built with CONFIG_OBJTOOL_WERROR=y is required.
|
||||||
|
])
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_SUBST(OBJTOOL_DISABLE_WERROR)
|
||||||
|
AC_SUBST(abs_objtool_binary)
|
||||||
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
|
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
|
||||||
AX_COUNT_CPUS([])
|
AX_COUNT_CPUS([])
|
||||||
AC_SUBST(CPU_COUNT)
|
AC_SUBST(CPU_COUNT)
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ ZFS_AC_DEBUGINFO
|
|||||||
ZFS_AC_DEBUG_KMEM
|
ZFS_AC_DEBUG_KMEM
|
||||||
ZFS_AC_DEBUG_KMEM_TRACKING
|
ZFS_AC_DEBUG_KMEM_TRACKING
|
||||||
ZFS_AC_DEBUG_INVARIANTS
|
ZFS_AC_DEBUG_INVARIANTS
|
||||||
|
ZFS_AC_OBJTOOL_WERROR
|
||||||
|
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
contrib/debian/rules
|
contrib/debian/rules
|
||||||
@@ -86,6 +87,7 @@ AC_CONFIG_FILES([
|
|||||||
zfs.release
|
zfs.release
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AC_CONFIG_FILES([scripts/objtool-wrapper], [chmod +x scripts/objtool-wrapper])
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ 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, libzfs4linux, libzfs6linux
|
Breaks: libzfs2, libzfs4, libzfs4linux, libzfs6linux, openzfs-libzfs4
|
||||||
Replaces: libzfs2, libzfs4, libzfs4linux, libzfs6linux
|
Replaces: libzfs2, libzfs4, libzfs4linux, libzfs6linux, openzfs-libzfs4
|
||||||
Conflicts: libzfs6linux
|
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
|
||||||
@@ -128,8 +128,8 @@ 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, libzpool5linux, libzpool6linux
|
Breaks: libzpool2, libzpool5, libzpool6linux
|
||||||
Replaces: libzpool2, libzpool5, libzpool5linux, libzpool6linux
|
Replaces: libzpool2, libzpool5, libzpool6linux
|
||||||
Conflicts: libzpool6linux
|
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
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ lib/systemd/system/zfs-import-scan.service
|
|||||||
lib/systemd/system/zfs-import.target
|
lib/systemd/system/zfs-import.target
|
||||||
lib/systemd/system/zfs-load-key.service
|
lib/systemd/system/zfs-load-key.service
|
||||||
lib/systemd/system/zfs-mount.service
|
lib/systemd/system/zfs-mount.service
|
||||||
|
lib/systemd/system/zfs-mount@.service
|
||||||
lib/systemd/system/zfs-scrub-monthly@.timer
|
lib/systemd/system/zfs-scrub-monthly@.timer
|
||||||
lib/systemd/system/zfs-scrub-weekly@.timer
|
lib/systemd/system/zfs-scrub-weekly@.timer
|
||||||
lib/systemd/system/zfs-scrub@.service
|
lib/systemd/system/zfs-scrub@.service
|
||||||
@@ -73,6 +74,7 @@ usr/share/man/man8/zfs-recv.8
|
|||||||
usr/share/man/man8/zfs-redact.8
|
usr/share/man/man8/zfs-redact.8
|
||||||
usr/share/man/man8/zfs-release.8
|
usr/share/man/man8/zfs-release.8
|
||||||
usr/share/man/man8/zfs-rename.8
|
usr/share/man/man8/zfs-rename.8
|
||||||
|
usr/share/man/man8/zfs-rewrite.8
|
||||||
usr/share/man/man8/zfs-rollback.8
|
usr/share/man/man8/zfs-rollback.8
|
||||||
usr/share/man/man8/zfs-send.8
|
usr/share/man/man8/zfs-send.8
|
||||||
usr/share/man/man8/zfs-set.8
|
usr/share/man/man8/zfs-set.8
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ override_dh_auto_install:
|
|||||||
@# Install the DKMS source.
|
@# Install the DKMS source.
|
||||||
@# We only want the files needed to build the modules
|
@# We only want the files needed to build the modules
|
||||||
install -D -t '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/scripts' \
|
install -D -t '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/scripts' \
|
||||||
'$(CURDIR)/scripts/dkms.postbuild'
|
'$(CURDIR)/scripts/dkms.postbuild' '$(CURDIR)/scripts/objtool-wrapper.in'
|
||||||
$(foreach file,$(DKMSFILES),mv '$(CURDIR)/$(NAME)-$(DEB_VERSION_UPSTREAM)/$(file)' '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)' || exit 1;)
|
$(foreach file,$(DKMSFILES),mv '$(CURDIR)/$(NAME)-$(DEB_VERSION_UPSTREAM)/$(file)' '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)' || exit 1;)
|
||||||
|
|
||||||
@# Only ever build Linux modules
|
@# Only ever build Linux modules
|
||||||
@@ -108,8 +108,8 @@ override_dh_auto_install:
|
|||||||
@# - zfs.release$
|
@# - zfs.release$
|
||||||
@# * Takes care of spaces and tabs
|
@# * Takes care of spaces and tabs
|
||||||
@# * Remove reference to ZFS_AC_PACKAGE
|
@# * Remove reference to ZFS_AC_PACKAGE
|
||||||
awk '/^AC_CONFIG_FILES\(\[/,/^\]\)/ {\
|
awk '/^AC_CONFIG_FILES\(\[/,/\]\)/ {\
|
||||||
if ($$0 !~ /^(AC_CONFIG_FILES\(\[([ \t]+)?$$|\]\)([ \t]+)?$$|([ \t]+)?(include\/(Makefile|sys|os\/(Makefile|linux))|module\/|Makefile([ \t]+)?$$|zfs\.release([ \t]+)?$$))/) \
|
if ($$0 !~ /^(AC_CONFIG_FILES\(\[([ \t]+)?$$|\]\)([ \t]+)?$$|([ \t]+)?(include\/(Makefile|sys|os\/(Makefile|linux))|module\/|Makefile([ \t]+)?$$|zfs\.release([ \t]+)?$$))|scripts\/objtool-wrapper.*\]\)$$/) \
|
||||||
{next} } {print}' \
|
{next} } {print}' \
|
||||||
'$(CURDIR)/$(NAME)-$(DEB_VERSION_UPSTREAM)/configure.ac' | sed '/ZFS_AC_PACKAGE/d' > '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/configure.ac'
|
'$(CURDIR)/$(NAME)-$(DEB_VERSION_UPSTREAM)/configure.ac' | sed '/ZFS_AC_PACKAGE/d' > '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/configure.ac'
|
||||||
@# Set "SUBDIRS = module include" for CONFIG_KERNEL and remove SUBDIRS for all other configs.
|
@# Set "SUBDIRS = module include" for CONFIG_KERNEL and remove SUBDIRS for all other configs.
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ systemdunit_DATA = \
|
|||||||
%D%/systemd/system/zfs-import-scan.service \
|
%D%/systemd/system/zfs-import-scan.service \
|
||||||
%D%/systemd/system/zfs-import.target \
|
%D%/systemd/system/zfs-import.target \
|
||||||
%D%/systemd/system/zfs-mount.service \
|
%D%/systemd/system/zfs-mount.service \
|
||||||
|
%D%/systemd/system/zfs-mount@.service \
|
||||||
%D%/systemd/system/zfs-scrub-monthly@.timer \
|
%D%/systemd/system/zfs-scrub-monthly@.timer \
|
||||||
%D%/systemd/system/zfs-scrub-weekly@.timer \
|
%D%/systemd/system/zfs-scrub-weekly@.timer \
|
||||||
%D%/systemd/system/zfs-scrub@.service \
|
%D%/systemd/system/zfs-scrub@.service \
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Mount ZFS filesystem %I
|
||||||
|
Documentation=man:zfs(8)
|
||||||
|
DefaultDependencies=no
|
||||||
|
After=systemd-udev-settle.service
|
||||||
|
After=zfs-import.target
|
||||||
|
After=zfs-mount.service
|
||||||
|
After=systemd-remount-fs.service
|
||||||
|
Before=local-fs.target
|
||||||
|
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]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
EnvironmentFile=-@initconfdir@/zfs
|
||||||
|
ExecStart=@sbindir@/zfs mount -R %I
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=zfs.target
|
||||||
@@ -591,6 +591,7 @@ _LIBZFS_H int zfs_crypto_attempt_load_keys(libzfs_handle_t *, const char *);
|
|||||||
_LIBZFS_H int zfs_crypto_load_key(zfs_handle_t *, boolean_t, const char *);
|
_LIBZFS_H int zfs_crypto_load_key(zfs_handle_t *, boolean_t, const char *);
|
||||||
_LIBZFS_H int zfs_crypto_unload_key(zfs_handle_t *);
|
_LIBZFS_H int zfs_crypto_unload_key(zfs_handle_t *);
|
||||||
_LIBZFS_H int zfs_crypto_rewrap(zfs_handle_t *, nvlist_t *, boolean_t);
|
_LIBZFS_H int zfs_crypto_rewrap(zfs_handle_t *, nvlist_t *, boolean_t);
|
||||||
|
_LIBZFS_H boolean_t zfs_is_encrypted(zfs_handle_t *);
|
||||||
|
|
||||||
typedef struct zprop_list {
|
typedef struct zprop_list {
|
||||||
int pl_prop;
|
int pl_prop;
|
||||||
|
|||||||
@@ -43,10 +43,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define EXPORT_SYMBOL(x)
|
#define EXPORT_SYMBOL(x)
|
||||||
#define module_param(a, b, c)
|
|
||||||
#define module_param_call(a, b, c, d, e)
|
|
||||||
#define module_param_named(a, b, c, d)
|
|
||||||
#define MODULE_PARM_DESC(a, b)
|
|
||||||
#define asm __asm
|
#define asm __asm
|
||||||
#ifdef ZFS_DEBUG
|
#ifdef ZFS_DEBUG
|
||||||
#undef NDEBUG
|
#undef NDEBUG
|
||||||
|
|||||||
@@ -112,14 +112,13 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY3B(LEFT, OP, RIGHT) do { \
|
#define VERIFY3B(LEFT, OP, RIGHT) do { \
|
||||||
const boolean_t _verify3_left = (boolean_t)(LEFT); \
|
const boolean_t _verify3_left = (boolean_t)!!(LEFT); \
|
||||||
const boolean_t _verify3_right = (boolean_t)(RIGHT); \
|
const boolean_t _verify3_right = (boolean_t)!!(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3B(" #LEFT ", " #OP ", " #RIGHT ") " \
|
||||||
"failed (%d " #OP " %d)\n", \
|
"failed (%d " #OP " %d)\n", \
|
||||||
(boolean_t)_verify3_left, \
|
_verify3_left, _verify3_right); \
|
||||||
(boolean_t)_verify3_right); \
|
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY3S(LEFT, OP, RIGHT) do { \
|
#define VERIFY3S(LEFT, OP, RIGHT) do { \
|
||||||
@@ -127,7 +126,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
const int64_t _verify3_right = (int64_t)(RIGHT); \
|
const int64_t _verify3_right = (int64_t)(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3S(" #LEFT ", " #OP ", " #RIGHT ") " \
|
||||||
"failed (%lld " #OP " %lld)\n", \
|
"failed (%lld " #OP " %lld)\n", \
|
||||||
(long long)_verify3_left, \
|
(long long)_verify3_left, \
|
||||||
(long long)_verify3_right); \
|
(long long)_verify3_right); \
|
||||||
@@ -138,7 +137,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
const uint64_t _verify3_right = (uint64_t)(RIGHT); \
|
const uint64_t _verify3_right = (uint64_t)(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3U(" #LEFT ", " #OP ", " #RIGHT ") " \
|
||||||
"failed (%llu " #OP " %llu)\n", \
|
"failed (%llu " #OP " %llu)\n", \
|
||||||
(unsigned long long)_verify3_left, \
|
(unsigned long long)_verify3_left, \
|
||||||
(unsigned long long)_verify3_right); \
|
(unsigned long long)_verify3_right); \
|
||||||
@@ -149,8 +148,8 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
|
const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3P(" #LEFT ", " #OP ", " #RIGHT ") " \
|
||||||
"failed (%px " #OP " %px)\n", \
|
"failed (%p " #OP " %p)\n", \
|
||||||
(void *)_verify3_left, \
|
(void *)_verify3_left, \
|
||||||
(void *)_verify3_right); \
|
(void *)_verify3_right); \
|
||||||
} while (0)
|
} while (0)
|
||||||
@@ -159,8 +158,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
const int64_t _verify0_right = (int64_t)(RIGHT); \
|
const int64_t _verify0_right = (int64_t)(RIGHT); \
|
||||||
if (unlikely(!(0 == _verify0_right))) \
|
if (unlikely(!(0 == _verify0_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY0(" #RIGHT ") " \
|
"VERIFY0(" #RIGHT ") failed (%lld)\n", \
|
||||||
"failed (0 == %lld)\n", \
|
|
||||||
(long long)_verify0_right); \
|
(long long)_verify0_right); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -168,8 +166,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
const uintptr_t _verify0_right = (uintptr_t)(RIGHT); \
|
const uintptr_t _verify0_right = (uintptr_t)(RIGHT); \
|
||||||
if (unlikely(!(0 == _verify0_right))) \
|
if (unlikely(!(0 == _verify0_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY0P(" #RIGHT ") " \
|
"VERIFY0P(" #RIGHT ") failed (%p)\n", \
|
||||||
"failed (NULL == %px)\n", \
|
|
||||||
(void *)_verify0_right); \
|
(void *)_verify0_right); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -182,14 +179,13 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define VERIFY3BF(LEFT, OP, RIGHT, STR, ...) do { \
|
#define VERIFY3BF(LEFT, OP, RIGHT, STR, ...) do { \
|
||||||
const boolean_t _verify3_left = (boolean_t)(LEFT); \
|
const boolean_t _verify3_left = (boolean_t)!!(LEFT); \
|
||||||
const boolean_t _verify3_right = (boolean_t)(RIGHT); \
|
const boolean_t _verify3_right = (boolean_t)!!(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3B(" #LEFT ", " #OP ", " #RIGHT ") " \
|
||||||
"failed (%d " #OP " %d) " STR "\n", \
|
"failed (%d " #OP " %d) " STR "\n", \
|
||||||
(boolean_t)(_verify3_left), \
|
_verify3_left, _verify3_right, \
|
||||||
(boolean_t)(_verify3_right), \
|
|
||||||
__VA_ARGS__); \
|
__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -198,10 +194,9 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
const int64_t _verify3_right = (int64_t)(RIGHT); \
|
const int64_t _verify3_right = (int64_t)(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3S(" #LEFT ", " #OP ", " #RIGHT ") " \
|
||||||
"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)
|
||||||
|
|
||||||
@@ -210,10 +205,10 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
const uint64_t _verify3_right = (uint64_t)(RIGHT); \
|
const uint64_t _verify3_right = (uint64_t)(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3U(" #LEFT ", " #OP ", " #RIGHT ") " \
|
||||||
"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)
|
||||||
|
|
||||||
@@ -222,32 +217,27 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
|
const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3P(" #LEFT ", " #OP ", " #RIGHT ") " \
|
||||||
"failed (%px " #OP " %px) " STR "\n", \
|
"failed (%p " #OP " %p) " STR "\n", \
|
||||||
(void *) (_verify3_left), \
|
(void *)_verify3_left, (void *)_verify3_right, \
|
||||||
(void *) (_verify3_right), \
|
|
||||||
__VA_ARGS__); \
|
__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY0PF(RIGHT, STR, ...) do { \
|
#define VERIFY0PF(RIGHT, STR, ...) do { \
|
||||||
const uintptr_t _verify3_left = (uintptr_t)(0); \
|
|
||||||
const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
|
const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left == _verify3_right))) \
|
if (unlikely(!(0 == _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY0(0 == " #RIGHT ") " \
|
"VERIFY0P(" #RIGHT ") failed (%p) " STR "\n", \
|
||||||
"failed (0 == %px) " STR "\n", \
|
(void *)_verify3_right, \
|
||||||
(long long) (_verify3_right), \
|
|
||||||
__VA_ARGS__); \
|
__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY0F(RIGHT, STR, ...) do { \
|
#define VERIFY0F(RIGHT, STR, ...) do { \
|
||||||
const int64_t _verify3_left = (int64_t)(0); \
|
|
||||||
const int64_t _verify3_right = (int64_t)(RIGHT); \
|
const int64_t _verify3_right = (int64_t)(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left == _verify3_right))) \
|
if (unlikely(!(0 == _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY0(0 == " #RIGHT ") " \
|
"VERIFY0(" #RIGHT ") failed (%lld) " STR "\n", \
|
||||||
"failed (0 == %lld) " STR "\n", \
|
(long long)_verify3_right, \
|
||||||
(long long) (_verify3_right), \
|
|
||||||
__VA_ARGS__); \
|
__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -256,10 +246,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
spl_assert("(" #A ") implies (" #B ")", \
|
spl_assert("(" #A ") implies (" #B ")", \
|
||||||
__FILE__, __FUNCTION__, __LINE__)))
|
__FILE__, __FUNCTION__, __LINE__)))
|
||||||
|
|
||||||
#define VERIFY_EQUIV(A, B) \
|
#define VERIFY_EQUIV(A, B) VERIFY3B(A, ==, B)
|
||||||
((void)(likely(!!(A) == !!(B)) || \
|
|
||||||
spl_assert("(" #A ") is equivalent to (" #B ")", \
|
|
||||||
__FILE__, __FUNCTION__, __LINE__)))
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Debugging disabled (--disable-debug)
|
* Debugging disabled (--disable-debug)
|
||||||
|
|||||||
@@ -56,4 +56,9 @@ struct opensolaris_utsname {
|
|||||||
#define task_io_account_read(n)
|
#define task_io_account_read(n)
|
||||||
#define task_io_account_write(n)
|
#define task_io_account_write(n)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check if the current thread is a memory reclaim thread.
|
||||||
|
*/
|
||||||
|
extern int current_is_reclaim_thread(void);
|
||||||
|
|
||||||
#endif /* _OPENSOLARIS_SYS_MISC_H_ */
|
#endif /* _OPENSOLARIS_SYS_MISC_H_ */
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ struct znode;
|
|||||||
|
|
||||||
int secpolicy_nfs(cred_t *cr);
|
int secpolicy_nfs(cred_t *cr);
|
||||||
int secpolicy_zfs(cred_t *crd);
|
int secpolicy_zfs(cred_t *crd);
|
||||||
int secpolicy_zfs_proc(cred_t *cr, proc_t *proc);
|
|
||||||
int secpolicy_sys_config(cred_t *cr, int checkonly);
|
int secpolicy_sys_config(cred_t *cr, int checkonly);
|
||||||
int secpolicy_zinject(cred_t *cr);
|
int secpolicy_zinject(cred_t *cr);
|
||||||
int secpolicy_fs_unmount(cred_t *cr, struct mount *vfsp);
|
int secpolicy_fs_unmount(cred_t *cr, struct mount *vfsp);
|
||||||
|
|||||||
@@ -45,7 +45,9 @@
|
|||||||
#ifdef _KERNEL
|
#ifdef _KERNEL
|
||||||
#define CPU curcpu
|
#define CPU curcpu
|
||||||
#define minclsyspri PRIBIO
|
#define minclsyspri PRIBIO
|
||||||
#define defclsyspri minclsyspri
|
#define defclsyspri minclsyspri
|
||||||
|
/* Write issue taskq priority. */
|
||||||
|
#define wtqclsyspri ((PVM + PRIBIO) / 2)
|
||||||
#define maxclsyspri PVM
|
#define maxclsyspri PVM
|
||||||
#define max_ncpus (mp_maxid + 1)
|
#define max_ncpus (mp_maxid + 1)
|
||||||
#define boot_max_ncpus (mp_maxid + 1)
|
#define boot_max_ncpus (mp_maxid + 1)
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
extern const int zfs_vm_pagerret_bad;
|
extern const int zfs_vm_pagerret_bad;
|
||||||
extern const int zfs_vm_pagerret_error;
|
extern const int zfs_vm_pagerret_error;
|
||||||
extern const int zfs_vm_pagerret_ok;
|
extern const int zfs_vm_pagerret_ok;
|
||||||
|
extern const int zfs_vm_pagerret_pend;
|
||||||
extern const int zfs_vm_pagerput_sync;
|
extern const int zfs_vm_pagerput_sync;
|
||||||
extern const int zfs_vm_pagerput_inval;
|
extern const int zfs_vm_pagerput_inval;
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ kernel_linux_HEADERS = \
|
|||||||
%D%/kernel/linux/mm_compat.h \
|
%D%/kernel/linux/mm_compat.h \
|
||||||
%D%/kernel/linux/mod_compat.h \
|
%D%/kernel/linux/mod_compat.h \
|
||||||
%D%/kernel/linux/page_compat.h \
|
%D%/kernel/linux/page_compat.h \
|
||||||
|
%D%/kernel/linux/pagemap_compat.h \
|
||||||
%D%/kernel/linux/simd.h \
|
%D%/kernel/linux/simd.h \
|
||||||
%D%/kernel/linux/simd_aarch64.h \
|
%D%/kernel/linux/simd_aarch64.h \
|
||||||
%D%/kernel/linux/simd_arm.h \
|
%D%/kernel/linux/simd_arm.h \
|
||||||
|
|||||||
@@ -31,15 +31,6 @@
|
|||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/moduleparam.h>
|
#include <linux/moduleparam.h>
|
||||||
|
|
||||||
/*
|
|
||||||
* Despite constifying struct kernel_param_ops, some older kernels define a
|
|
||||||
* `__check_old_set_param()` function in their headers that checks for a
|
|
||||||
* non-constified `->set()`. This has long been fixed in Linux mainline, but
|
|
||||||
* since we support older kernels, we workaround it by using a preprocessor
|
|
||||||
* definition to disable it.
|
|
||||||
*/
|
|
||||||
#define __check_old_set_param(_) (0)
|
|
||||||
|
|
||||||
typedef const struct kernel_param zfs_kernel_param_t;
|
typedef const struct kernel_param zfs_kernel_param_t;
|
||||||
|
|
||||||
#define ZMOD_RW 0644
|
#define ZMOD_RW 0644
|
||||||
@@ -79,48 +70,23 @@ enum scope_prefix_types {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* While we define our own s64/u64 types, there is no reason to reimplement the
|
* Our uint64 params are called U64 in part because we had them before Linux
|
||||||
* existing Linux kernel types, so we use the preprocessor to remap our
|
* provided ULLONG param ops. Now it does, and we use them, but we retain the
|
||||||
* "custom" implementations to the kernel ones. This is done because the CPP
|
* U64 name to keep many existing tunables working without issue.
|
||||||
* does not allow us to write conditional definitions. The fourth definition
|
|
||||||
* exists because the CPP will not allow us to replace things like INT with int
|
|
||||||
* before string concatenation.
|
|
||||||
*/
|
*/
|
||||||
|
#define spl_param_set_u64 param_set_ullong
|
||||||
|
#define spl_param_get_u64 param_get_ullong
|
||||||
|
#define spl_param_ops_U64 param_ops_ullong
|
||||||
|
|
||||||
#define spl_param_set_int param_set_int
|
/*
|
||||||
#define spl_param_get_int param_get_int
|
* We keep our own names for param ops to make expanding them in
|
||||||
#define spl_param_ops_int param_ops_int
|
* ZFS_MODULE_PARAM easy.
|
||||||
#define spl_param_ops_INT param_ops_int
|
*/
|
||||||
|
#define spl_param_ops_INT param_ops_int
|
||||||
#define spl_param_set_long param_set_long
|
#define spl_param_ops_LONG param_ops_long
|
||||||
#define spl_param_get_long param_get_long
|
#define spl_param_ops_UINT param_ops_uint
|
||||||
#define spl_param_ops_long param_ops_long
|
#define spl_param_ops_ULONG param_ops_ulong
|
||||||
#define spl_param_ops_LONG param_ops_long
|
#define spl_param_ops_STRING param_ops_charp
|
||||||
|
|
||||||
#define spl_param_set_uint param_set_uint
|
|
||||||
#define spl_param_get_uint param_get_uint
|
|
||||||
#define spl_param_ops_uint param_ops_uint
|
|
||||||
#define spl_param_ops_UINT param_ops_uint
|
|
||||||
|
|
||||||
#define spl_param_set_ulong param_set_ulong
|
|
||||||
#define spl_param_get_ulong param_get_ulong
|
|
||||||
#define spl_param_ops_ulong param_ops_ulong
|
|
||||||
#define spl_param_ops_ULONG param_ops_ulong
|
|
||||||
|
|
||||||
#define spl_param_set_charp param_set_charp
|
|
||||||
#define spl_param_get_charp param_get_charp
|
|
||||||
#define spl_param_ops_charp param_ops_charp
|
|
||||||
#define spl_param_ops_STRING param_ops_charp
|
|
||||||
|
|
||||||
int spl_param_set_s64(const char *val, zfs_kernel_param_t *kp);
|
|
||||||
extern int spl_param_get_s64(char *buffer, zfs_kernel_param_t *kp);
|
|
||||||
extern const struct kernel_param_ops spl_param_ops_s64;
|
|
||||||
#define spl_param_ops_S64 spl_param_ops_s64
|
|
||||||
|
|
||||||
extern int spl_param_set_u64(const char *val, zfs_kernel_param_t *kp);
|
|
||||||
extern int spl_param_get_u64(char *buffer, zfs_kernel_param_t *kp);
|
|
||||||
extern const struct kernel_param_ops spl_param_ops_u64;
|
|
||||||
#define spl_param_ops_U64 spl_param_ops_u64
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Declare a module parameter / sysctl node
|
* Declare a module parameter / sysctl node
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
/*
|
/*
|
||||||
* Create our own accessor functions to follow the Linux API changes
|
* Create our own accessor functions to follow the Linux API changes
|
||||||
*/
|
*/
|
||||||
#define nr_file_pages() global_node_page_state(NR_FILE_PAGES)
|
#define nr_file_pages() (global_node_page_state(NR_ACTIVE_FILE) + \
|
||||||
#define nr_inactive_anon_pages() global_node_page_state(NR_INACTIVE_ANON)
|
global_node_page_state(NR_INACTIVE_FILE))
|
||||||
#define nr_inactive_file_pages() global_node_page_state(NR_INACTIVE_FILE)
|
#define nr_inactive_file_pages() global_node_page_state(NR_INACTIVE_FILE)
|
||||||
|
|
||||||
#endif /* _ZFS_PAGE_COMPAT_H */
|
#endif /* _ZFS_PAGE_COMPAT_H */
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
|
/*
|
||||||
|
* CDDL HEADER START
|
||||||
|
*
|
||||||
|
* The contents of this file are subject to the terms of the
|
||||||
|
* Common Development and Distribution License (the "License").
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
*
|
||||||
|
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||||
|
* or https://opensource.org/licenses/CDDL-1.0.
|
||||||
|
* See the License for the specific language governing permissions
|
||||||
|
* and limitations under the License.
|
||||||
|
*
|
||||||
|
* When distributing Covered Code, include this CDDL HEADER in each
|
||||||
|
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||||
|
* If applicable, add the following below this CDDL HEADER, with the
|
||||||
|
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||||
|
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||||
|
*
|
||||||
|
* CDDL HEADER END
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2025, Rob Norris <robn@despairlabs.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _ZFS_PAGEMAP_COMPAT_H
|
||||||
|
#define _ZFS_PAGEMAP_COMPAT_H
|
||||||
|
|
||||||
|
#include <linux/pagemap.h>
|
||||||
|
|
||||||
|
#ifndef HAVE_PAGEMAP_READAHEAD_PAGE
|
||||||
|
#define readahead_page(ractl) (&(__readahead_folio(ractl)->page))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -139,15 +139,6 @@
|
|||||||
*/
|
*/
|
||||||
#if defined(HAVE_KERNEL_FPU_INTERNAL)
|
#if defined(HAVE_KERNEL_FPU_INTERNAL)
|
||||||
|
|
||||||
/*
|
|
||||||
* For kernels not exporting *kfpu_{begin,end} we have to use inline assembly
|
|
||||||
* with the XSAVE{,OPT,S} instructions, so we need the toolchain to support at
|
|
||||||
* least XSAVE.
|
|
||||||
*/
|
|
||||||
#if !defined(HAVE_XSAVE)
|
|
||||||
#error "Toolchain needs to support the XSAVE assembler instruction"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef XFEATURE_MASK_XTILE
|
#ifndef XFEATURE_MASK_XTILE
|
||||||
/*
|
/*
|
||||||
* For kernels where this doesn't exist yet, we still don't want to break
|
* For kernels where this doesn't exist yet, we still don't want to break
|
||||||
@@ -335,9 +326,13 @@ kfpu_begin(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAVE_XSAVE)
|
||||||
if (static_cpu_has(X86_FEATURE_XSAVE)) {
|
if (static_cpu_has(X86_FEATURE_XSAVE)) {
|
||||||
kfpu_do_xsave("xsave", state, ~XFEATURE_MASK_XTILE);
|
kfpu_do_xsave("xsave", state, ~XFEATURE_MASK_XTILE);
|
||||||
} else if (static_cpu_has(X86_FEATURE_FXSR)) {
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (static_cpu_has(X86_FEATURE_FXSR)) {
|
||||||
kfpu_save_fxsr(state);
|
kfpu_save_fxsr(state);
|
||||||
} else {
|
} else {
|
||||||
kfpu_save_fsave(state);
|
kfpu_save_fsave(state);
|
||||||
@@ -390,9 +385,13 @@ kfpu_end(void)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAVE_XSAVE)
|
||||||
if (static_cpu_has(X86_FEATURE_XSAVE)) {
|
if (static_cpu_has(X86_FEATURE_XSAVE)) {
|
||||||
kfpu_do_xrstor("xrstor", state, ~XFEATURE_MASK_XTILE);
|
kfpu_do_xrstor("xrstor", state, ~XFEATURE_MASK_XTILE);
|
||||||
} else if (static_cpu_has(X86_FEATURE_FXSR)) {
|
goto out;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (static_cpu_has(X86_FEATURE_FXSR)) {
|
||||||
kfpu_restore_fxsr(state);
|
kfpu_restore_fxsr(state);
|
||||||
} else {
|
} else {
|
||||||
kfpu_restore_fsave(state);
|
kfpu_restore_fsave(state);
|
||||||
|
|||||||
@@ -116,14 +116,13 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY3B(LEFT, OP, RIGHT) do { \
|
#define VERIFY3B(LEFT, OP, RIGHT) do { \
|
||||||
const boolean_t _verify3_left = (boolean_t)(LEFT); \
|
const boolean_t _verify3_left = (boolean_t)!!(LEFT); \
|
||||||
const boolean_t _verify3_right = (boolean_t)(RIGHT); \
|
const boolean_t _verify3_right = (boolean_t)!!(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3B(" #LEFT ", " #OP ", " #RIGHT ") " \
|
||||||
"failed (%d " #OP " %d)\n", \
|
"failed (%d " #OP " %d)\n", \
|
||||||
(boolean_t)_verify3_left, \
|
_verify3_left, _verify3_right); \
|
||||||
(boolean_t)_verify3_right); \
|
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY3S(LEFT, OP, RIGHT) do { \
|
#define VERIFY3S(LEFT, OP, RIGHT) do { \
|
||||||
@@ -131,7 +130,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
const int64_t _verify3_right = (int64_t)(RIGHT); \
|
const int64_t _verify3_right = (int64_t)(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3S(" #LEFT ", " #OP ", " #RIGHT ") " \
|
||||||
"failed (%lld " #OP " %lld)\n", \
|
"failed (%lld " #OP " %lld)\n", \
|
||||||
(long long)_verify3_left, \
|
(long long)_verify3_left, \
|
||||||
(long long)_verify3_right); \
|
(long long)_verify3_right); \
|
||||||
@@ -142,7 +141,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
const uint64_t _verify3_right = (uint64_t)(RIGHT); \
|
const uint64_t _verify3_right = (uint64_t)(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3U(" #LEFT ", " #OP ", " #RIGHT ") " \
|
||||||
"failed (%llu " #OP " %llu)\n", \
|
"failed (%llu " #OP " %llu)\n", \
|
||||||
(unsigned long long)_verify3_left, \
|
(unsigned long long)_verify3_left, \
|
||||||
(unsigned long long)_verify3_right); \
|
(unsigned long long)_verify3_right); \
|
||||||
@@ -153,7 +152,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
|
const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3P(" #LEFT ", " #OP ", " #RIGHT ") " \
|
||||||
"failed (%px " #OP " %px)\n", \
|
"failed (%px " #OP " %px)\n", \
|
||||||
(void *)_verify3_left, \
|
(void *)_verify3_left, \
|
||||||
(void *)_verify3_right); \
|
(void *)_verify3_right); \
|
||||||
@@ -163,8 +162,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
const int64_t _verify0_right = (int64_t)(RIGHT); \
|
const int64_t _verify0_right = (int64_t)(RIGHT); \
|
||||||
if (unlikely(!(0 == _verify0_right))) \
|
if (unlikely(!(0 == _verify0_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY0(" #RIGHT ") " \
|
"VERIFY0(" #RIGHT ") failed (%lld)\n", \
|
||||||
"failed (0 == %lld)\n", \
|
|
||||||
(long long)_verify0_right); \
|
(long long)_verify0_right); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -172,8 +170,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
const uintptr_t _verify0_right = (uintptr_t)(RIGHT); \
|
const uintptr_t _verify0_right = (uintptr_t)(RIGHT); \
|
||||||
if (unlikely(!(0 == _verify0_right))) \
|
if (unlikely(!(0 == _verify0_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY0P(" #RIGHT ") " \
|
"VERIFY0P(" #RIGHT ") failed (%px)\n", \
|
||||||
"failed (NULL == %px)\n", \
|
|
||||||
(void *)_verify0_right); \
|
(void *)_verify0_right); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -186,14 +183,13 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define VERIFY3BF(LEFT, OP, RIGHT, STR, ...) do { \
|
#define VERIFY3BF(LEFT, OP, RIGHT, STR, ...) do { \
|
||||||
const boolean_t _verify3_left = (boolean_t)(LEFT); \
|
const boolean_t _verify3_left = (boolean_t)!!(LEFT); \
|
||||||
const boolean_t _verify3_right = (boolean_t)(RIGHT); \
|
const boolean_t _verify3_right = (boolean_t)!!(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3B(" #LEFT ", " #OP ", " #RIGHT ") " \
|
||||||
"failed (%d " #OP " %d) " STR "\n", \
|
"failed (%d " #OP " %d) " STR "\n", \
|
||||||
(boolean_t)(_verify3_left), \
|
_verify3_left, _verify3_right, \
|
||||||
(boolean_t)(_verify3_right), \
|
|
||||||
__VA_ARGS__); \
|
__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -202,10 +198,9 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
const int64_t _verify3_right = (int64_t)(RIGHT); \
|
const int64_t _verify3_right = (int64_t)(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3S(" #LEFT ", " #OP ", " #RIGHT ") " \
|
||||||
"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)
|
||||||
|
|
||||||
@@ -214,10 +209,10 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
const uint64_t _verify3_right = (uint64_t)(RIGHT); \
|
const uint64_t _verify3_right = (uint64_t)(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3U(" #LEFT ", " #OP ", " #RIGHT ") " \
|
||||||
"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)
|
||||||
|
|
||||||
@@ -226,32 +221,27 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
|
const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
"VERIFY3P(" #LEFT ", " #OP ", " #RIGHT ") " \
|
||||||
"failed (%px " #OP " %px) " STR "\n", \
|
"failed (%px " #OP " %px) " STR "\n", \
|
||||||
(void *) (_verify3_left), \
|
(void *)_verify3_left, (void *)_verify3_right, \
|
||||||
(void *) (_verify3_right), \
|
|
||||||
__VA_ARGS__); \
|
__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY0PF(RIGHT, STR, ...) do { \
|
#define VERIFY0PF(RIGHT, STR, ...) do { \
|
||||||
const uintptr_t _verify3_left = (uintptr_t)(0); \
|
|
||||||
const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
|
const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left == _verify3_right))) \
|
if (unlikely(!(0 == _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY0(0 == " #RIGHT ") " \
|
"VERIFY0P(" #RIGHT ") failed (%px) " STR "\n", \
|
||||||
"failed (0 == %px) " STR "\n", \
|
(void *)_verify3_right, \
|
||||||
(long long) (_verify3_right), \
|
|
||||||
__VA_ARGS__); \
|
__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY0F(RIGHT, STR, ...) do { \
|
#define VERIFY0F(RIGHT, STR, ...) do { \
|
||||||
const int64_t _verify3_left = (int64_t)(0); \
|
|
||||||
const int64_t _verify3_right = (int64_t)(RIGHT); \
|
const int64_t _verify3_right = (int64_t)(RIGHT); \
|
||||||
if (unlikely(!(_verify3_left == _verify3_right))) \
|
if (unlikely(!(0 == _verify3_right))) \
|
||||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"VERIFY0(0 == " #RIGHT ") " \
|
"VERIFY0(" #RIGHT ") failed (%lld) " STR "\n", \
|
||||||
"failed (0 == %lld) " STR "\n", \
|
(long long)_verify3_right, \
|
||||||
(long long) (_verify3_right), \
|
|
||||||
__VA_ARGS__); \
|
__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -260,10 +250,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
|||||||
spl_assert("(" #A ") implies (" #B ")", \
|
spl_assert("(" #A ") implies (" #B ")", \
|
||||||
__FILE__, __FUNCTION__, __LINE__)))
|
__FILE__, __FUNCTION__, __LINE__)))
|
||||||
|
|
||||||
#define VERIFY_EQUIV(A, B) \
|
#define VERIFY_EQUIV(A, B) VERIFY3B(A, ==, B)
|
||||||
((void)(likely(!!(A) == !!(B)) || \
|
|
||||||
spl_assert("(" #A ") is equivalent to (" #B ")", \
|
|
||||||
__FILE__, __FUNCTION__, __LINE__)))
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Debugging disabled (--disable-debug)
|
* Debugging disabled (--disable-debug)
|
||||||
|
|||||||
@@ -24,7 +24,13 @@
|
|||||||
#define _OS_LINUX_SPL_MISC_H
|
#define _OS_LINUX_SPL_MISC_H
|
||||||
|
|
||||||
#include <linux/kobject.h>
|
#include <linux/kobject.h>
|
||||||
|
#include <linux/swap.h>
|
||||||
|
|
||||||
extern void spl_signal_kobj_evt(struct block_device *bdev);
|
extern void spl_signal_kobj_evt(struct block_device *bdev);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check if the current thread is a memory reclaim thread.
|
||||||
|
*/
|
||||||
|
extern int current_is_reclaim_thread(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -92,8 +92,10 @@
|
|||||||
* Treat shim tasks as SCHED_NORMAL tasks
|
* Treat shim tasks as SCHED_NORMAL tasks
|
||||||
*/
|
*/
|
||||||
#define minclsyspri (MAX_PRIO-1)
|
#define minclsyspri (MAX_PRIO-1)
|
||||||
#define maxclsyspri (MAX_RT_PRIO)
|
|
||||||
#define defclsyspri (DEFAULT_PRIO)
|
#define defclsyspri (DEFAULT_PRIO)
|
||||||
|
/* Write issue taskq priority. */
|
||||||
|
#define wtqclsyspri (MAX_RT_PRIO + 1)
|
||||||
|
#define maxclsyspri (MAX_RT_PRIO)
|
||||||
|
|
||||||
#ifndef NICE_TO_PRIO
|
#ifndef NICE_TO_PRIO
|
||||||
#define NICE_TO_PRIO(nice) (MAX_RT_PRIO + (nice) + 20)
|
#define NICE_TO_PRIO(nice) (MAX_RT_PRIO + (nice) + 20)
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ zfs_uio_bvec_init(zfs_uio_t *uio, struct bio *bio, struct request *rq)
|
|||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
uio->uio_iter = iter;
|
uio->uio_iter = iter;
|
||||||
uio->uio_iovcnt = iter->nr_segs;
|
uio->uio_iovcnt = iter->nr_segs;
|
||||||
@@ -184,7 +184,7 @@ zfs_uio_iov_iter_init(zfs_uio_t *uio, struct iov_iter *iter, offset_t offset,
|
|||||||
uio->uio_fmode = 0;
|
uio->uio_fmode = 0;
|
||||||
uio->uio_extflg = 0;
|
uio->uio_extflg = 0;
|
||||||
uio->uio_resid = resid;
|
uio->uio_resid = resid;
|
||||||
uio->uio_skip = skip;
|
uio->uio_skip = 0;
|
||||||
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));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ int secpolicy_vnode_setids_setgids(const cred_t *, gid_t, zidmap_t *,
|
|||||||
struct user_namespace *);
|
struct user_namespace *);
|
||||||
int secpolicy_zinject(const cred_t *);
|
int secpolicy_zinject(const cred_t *);
|
||||||
int secpolicy_zfs(const cred_t *);
|
int secpolicy_zfs(const cred_t *);
|
||||||
int secpolicy_zfs_proc(const cred_t *, proc_t *);
|
|
||||||
void secpolicy_setid_clear(vattr_t *, cred_t *);
|
void secpolicy_setid_clear(vattr_t *, cred_t *);
|
||||||
int secpolicy_setid_setsticky_clear(struct inode *, vattr_t *,
|
int secpolicy_setid_setsticky_clear(struct inode *, vattr_t *,
|
||||||
const vattr_t *, cred_t *, zidmap_t *, struct user_namespace *);
|
const vattr_t *, cred_t *, zidmap_t *, struct user_namespace *);
|
||||||
|
|||||||
@@ -59,8 +59,6 @@ DECLARE_EVENT_CLASS(zfs_ace_class,
|
|||||||
__field(uint64_t, z_size)
|
__field(uint64_t, z_size)
|
||||||
__field(uint64_t, z_pflags)
|
__field(uint64_t, z_pflags)
|
||||||
__field(uint32_t, z_sync_cnt)
|
__field(uint32_t, z_sync_cnt)
|
||||||
__field(uint32_t, z_sync_writes_cnt)
|
|
||||||
__field(uint32_t, z_async_writes_cnt)
|
|
||||||
__field(mode_t, z_mode)
|
__field(mode_t, z_mode)
|
||||||
__field(boolean_t, z_is_sa)
|
__field(boolean_t, z_is_sa)
|
||||||
__field(boolean_t, z_is_ctldir)
|
__field(boolean_t, z_is_ctldir)
|
||||||
@@ -92,8 +90,6 @@ DECLARE_EVENT_CLASS(zfs_ace_class,
|
|||||||
__entry->z_size = zn->z_size;
|
__entry->z_size = zn->z_size;
|
||||||
__entry->z_pflags = zn->z_pflags;
|
__entry->z_pflags = zn->z_pflags;
|
||||||
__entry->z_sync_cnt = zn->z_sync_cnt;
|
__entry->z_sync_cnt = zn->z_sync_cnt;
|
||||||
__entry->z_sync_writes_cnt = zn->z_sync_writes_cnt;
|
|
||||||
__entry->z_async_writes_cnt = zn->z_async_writes_cnt;
|
|
||||||
__entry->z_mode = zn->z_mode;
|
__entry->z_mode = zn->z_mode;
|
||||||
__entry->z_is_sa = zn->z_is_sa;
|
__entry->z_is_sa = zn->z_is_sa;
|
||||||
__entry->z_is_ctldir = zn->z_is_ctldir;
|
__entry->z_is_ctldir = zn->z_is_ctldir;
|
||||||
@@ -117,7 +113,7 @@ DECLARE_EVENT_CLASS(zfs_ace_class,
|
|||||||
TP_printk("zn { id %llu unlinked %u atime_dirty %u "
|
TP_printk("zn { id %llu unlinked %u atime_dirty %u "
|
||||||
"zn_prefetch %u blksz %u seq %u "
|
"zn_prefetch %u blksz %u seq %u "
|
||||||
"mapcnt %llu size %llu pflags %llu "
|
"mapcnt %llu size %llu pflags %llu "
|
||||||
"sync_cnt %u sync_writes_cnt %u async_writes_cnt %u "
|
"sync_cnt %u "
|
||||||
"mode 0x%x is_sa %d is_ctldir %d "
|
"mode 0x%x is_sa %d is_ctldir %d "
|
||||||
"inode { uid %u gid %u ino %lu nlink %u size %lli "
|
"inode { uid %u gid %u ino %lu nlink %u size %lli "
|
||||||
"blkbits %u bytes %u mode 0x%x generation %x } } "
|
"blkbits %u bytes %u mode 0x%x generation %x } } "
|
||||||
@@ -126,7 +122,6 @@ DECLARE_EVENT_CLASS(zfs_ace_class,
|
|||||||
__entry->z_zn_prefetch, __entry->z_blksz,
|
__entry->z_zn_prefetch, __entry->z_blksz,
|
||||||
__entry->z_seq, __entry->z_mapcnt, __entry->z_size,
|
__entry->z_seq, __entry->z_mapcnt, __entry->z_size,
|
||||||
__entry->z_pflags, __entry->z_sync_cnt,
|
__entry->z_pflags, __entry->z_sync_cnt,
|
||||||
__entry->z_sync_writes_cnt, __entry->z_async_writes_cnt,
|
|
||||||
__entry->z_mode, __entry->z_is_sa, __entry->z_is_ctldir,
|
__entry->z_mode, __entry->z_is_sa, __entry->z_is_ctldir,
|
||||||
__entry->i_uid, __entry->i_gid, __entry->i_ino, __entry->i_nlink,
|
__entry->i_uid, __entry->i_gid, __entry->i_ino, __entry->i_nlink,
|
||||||
__entry->i_size, __entry->i_blkbits,
|
__entry->i_size, __entry->i_blkbits,
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ struct znode;
|
|||||||
|
|
||||||
extern int zfs_sync(struct super_block *, int, cred_t *);
|
extern int zfs_sync(struct super_block *, int, cred_t *);
|
||||||
extern int zfs_inode_alloc(struct super_block *, struct inode **ip);
|
extern int zfs_inode_alloc(struct super_block *, struct inode **ip);
|
||||||
|
extern void zfs_inode_free(struct inode *);
|
||||||
extern void zfs_inode_destroy(struct inode *);
|
extern void zfs_inode_destroy(struct inode *);
|
||||||
extern void zfs_mark_inode_dirty(struct inode *);
|
extern void zfs_mark_inode_dirty(struct inode *);
|
||||||
extern boolean_t zfs_relatime_need_update(const struct inode *);
|
extern boolean_t zfs_relatime_need_update(const struct inode *);
|
||||||
|
|||||||
@@ -123,41 +123,6 @@ extern int zpl_clone_file_range(struct file *src_file, loff_t src_off,
|
|||||||
extern int zpl_dedupe_file_range(struct file *src_file, loff_t src_off,
|
extern int zpl_dedupe_file_range(struct file *src_file, loff_t src_off,
|
||||||
struct file *dst_file, loff_t dst_off, uint64_t len);
|
struct file *dst_file, loff_t dst_off, uint64_t len);
|
||||||
|
|
||||||
/* compat for FICLONE/FICLONERANGE/FIDEDUPERANGE ioctls */
|
|
||||||
typedef struct {
|
|
||||||
int64_t fcr_src_fd;
|
|
||||||
uint64_t fcr_src_offset;
|
|
||||||
uint64_t fcr_src_length;
|
|
||||||
uint64_t fcr_dest_offset;
|
|
||||||
} zfs_ioc_compat_file_clone_range_t;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int64_t fdri_dest_fd;
|
|
||||||
uint64_t fdri_dest_offset;
|
|
||||||
uint64_t fdri_bytes_deduped;
|
|
||||||
int32_t fdri_status;
|
|
||||||
uint32_t fdri_reserved;
|
|
||||||
} zfs_ioc_compat_dedupe_range_info_t;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
uint64_t fdr_src_offset;
|
|
||||||
uint64_t fdr_src_length;
|
|
||||||
uint16_t fdr_dest_count;
|
|
||||||
uint16_t fdr_reserved1;
|
|
||||||
uint32_t fdr_reserved2;
|
|
||||||
zfs_ioc_compat_dedupe_range_info_t fdr_info[];
|
|
||||||
} zfs_ioc_compat_dedupe_range_t;
|
|
||||||
|
|
||||||
#define ZFS_IOC_COMPAT_FICLONE _IOW(0x94, 9, int)
|
|
||||||
#define ZFS_IOC_COMPAT_FICLONERANGE \
|
|
||||||
_IOW(0x94, 13, zfs_ioc_compat_file_clone_range_t)
|
|
||||||
#define ZFS_IOC_COMPAT_FIDEDUPERANGE \
|
|
||||||
_IOWR(0x94, 54, zfs_ioc_compat_dedupe_range_t)
|
|
||||||
|
|
||||||
extern long zpl_ioctl_ficlone(struct file *filp, void *arg);
|
|
||||||
extern long zpl_ioctl_ficlonerange(struct file *filp, void *arg);
|
|
||||||
extern long zpl_ioctl_fideduperange(struct file *filp, void *arg);
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(HAVE_INODE_TIMESTAMP_TRUNCATE)
|
#if defined(HAVE_INODE_TIMESTAMP_TRUNCATE)
|
||||||
#define zpl_inode_timestamp_truncate(ts, ip) timestamp_truncate(ts, ip)
|
#define zpl_inode_timestamp_truncate(ts, ip) timestamp_truncate(ts, ip)
|
||||||
|
|||||||
@@ -64,8 +64,15 @@ extern "C" {
|
|||||||
(hdr)->b_psize = ((x) >> SPA_MINBLOCKSHIFT); \
|
(hdr)->b_psize = ((x) >> SPA_MINBLOCKSHIFT); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
/* The l2size in the header is only used by L2 cache */
|
||||||
|
#define HDR_SET_L2SIZE(hdr, x) do { \
|
||||||
|
ASSERT(IS_P2ALIGNED((x), 1U << SPA_MINBLOCKSHIFT)); \
|
||||||
|
(hdr)->b_l2size = ((x) >> SPA_MINBLOCKSHIFT); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define HDR_GET_LSIZE(hdr) ((hdr)->b_lsize << SPA_MINBLOCKSHIFT)
|
#define HDR_GET_LSIZE(hdr) ((hdr)->b_lsize << SPA_MINBLOCKSHIFT)
|
||||||
#define HDR_GET_PSIZE(hdr) ((hdr)->b_psize << SPA_MINBLOCKSHIFT)
|
#define HDR_GET_PSIZE(hdr) ((hdr)->b_psize << SPA_MINBLOCKSHIFT)
|
||||||
|
#define HDR_GET_L2SIZE(hdr) ((hdr)->b_l2size << SPA_MINBLOCKSHIFT)
|
||||||
|
|
||||||
typedef struct arc_buf_hdr arc_buf_hdr_t;
|
typedef struct arc_buf_hdr arc_buf_hdr_t;
|
||||||
typedef struct arc_buf arc_buf_t;
|
typedef struct arc_buf arc_buf_t;
|
||||||
@@ -323,8 +330,10 @@ void arc_freed(spa_t *spa, const blkptr_t *bp);
|
|||||||
int arc_cached(spa_t *spa, const blkptr_t *bp);
|
int arc_cached(spa_t *spa, const blkptr_t *bp);
|
||||||
|
|
||||||
void arc_flush(spa_t *spa, boolean_t retry);
|
void arc_flush(spa_t *spa, boolean_t retry);
|
||||||
|
void arc_flush_async(spa_t *spa);
|
||||||
void arc_tempreserve_clear(uint64_t reserve);
|
void arc_tempreserve_clear(uint64_t reserve);
|
||||||
int arc_tempreserve_space(spa_t *spa, uint64_t reserve, uint64_t txg);
|
int arc_tempreserve_space(spa_t *spa, uint64_t reserve, uint64_t txg);
|
||||||
|
boolean_t arc_async_flush_guid_inuse(uint64_t load_guid);
|
||||||
|
|
||||||
uint64_t arc_all_memory(void);
|
uint64_t arc_all_memory(void);
|
||||||
uint64_t arc_default_max(uint64_t min, uint64_t allmem);
|
uint64_t arc_default_max(uint64_t min, uint64_t allmem);
|
||||||
|
|||||||
@@ -379,8 +379,8 @@ typedef struct l2arc_lb_ptr_buf {
|
|||||||
* L2ARC Internals
|
* L2ARC Internals
|
||||||
*/
|
*/
|
||||||
typedef struct l2arc_dev {
|
typedef struct l2arc_dev {
|
||||||
vdev_t *l2ad_vdev; /* vdev */
|
vdev_t *l2ad_vdev; /* can be NULL during remove */
|
||||||
spa_t *l2ad_spa; /* spa */
|
spa_t *l2ad_spa; /* can be NULL during remove */
|
||||||
uint64_t l2ad_hand; /* next write location */
|
uint64_t l2ad_hand; /* next write location */
|
||||||
uint64_t l2ad_start; /* first addr on device */
|
uint64_t l2ad_start; /* first addr on device */
|
||||||
uint64_t l2ad_end; /* last addr on device */
|
uint64_t l2ad_end; /* last addr on device */
|
||||||
@@ -476,8 +476,8 @@ struct arc_buf_hdr {
|
|||||||
|
|
||||||
arc_buf_contents_t b_type;
|
arc_buf_contents_t b_type;
|
||||||
uint8_t b_complevel;
|
uint8_t b_complevel;
|
||||||
uint8_t b_reserved1; /* used for 4 byte alignment */
|
uint8_t b_reserved1; /* used for 4 byte alignment */
|
||||||
uint16_t b_reserved2; /* used for 4 byte alignment */
|
uint16_t b_l2size; /* alignment or L2-only size */
|
||||||
arc_buf_hdr_t *b_hash_next;
|
arc_buf_hdr_t *b_hash_next;
|
||||||
arc_flags_t b_flags;
|
arc_flags_t b_flags;
|
||||||
|
|
||||||
@@ -954,7 +954,7 @@ typedef struct arc_sums {
|
|||||||
wmsum_t arcstat_data_size;
|
wmsum_t arcstat_data_size;
|
||||||
wmsum_t arcstat_metadata_size;
|
wmsum_t arcstat_metadata_size;
|
||||||
wmsum_t arcstat_dbuf_size;
|
wmsum_t arcstat_dbuf_size;
|
||||||
wmsum_t arcstat_dnode_size;
|
aggsum_t arcstat_dnode_size;
|
||||||
wmsum_t arcstat_bonus_size;
|
wmsum_t arcstat_bonus_size;
|
||||||
wmsum_t arcstat_l2_hits;
|
wmsum_t arcstat_l2_hits;
|
||||||
wmsum_t arcstat_l2_misses;
|
wmsum_t arcstat_l2_misses;
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ typedef struct dbuf_dirty_record {
|
|||||||
arc_buf_t *dr_data;
|
arc_buf_t *dr_data;
|
||||||
override_states_t dr_override_state;
|
override_states_t dr_override_state;
|
||||||
uint8_t dr_copies;
|
uint8_t dr_copies;
|
||||||
|
uint8_t dr_gang_copies;
|
||||||
boolean_t dr_nopwrite;
|
boolean_t dr_nopwrite;
|
||||||
boolean_t dr_brtwrite;
|
boolean_t dr_brtwrite;
|
||||||
boolean_t dr_diowrite;
|
boolean_t dr_diowrite;
|
||||||
@@ -446,6 +447,7 @@ int dbuf_dnode_findbp(dnode_t *dn, uint64_t level, uint64_t blkid,
|
|||||||
|
|
||||||
void dbuf_init(void);
|
void dbuf_init(void);
|
||||||
void dbuf_fini(void);
|
void dbuf_fini(void);
|
||||||
|
void dbuf_cache_reduce_target_size(void);
|
||||||
|
|
||||||
boolean_t dbuf_is_metadata(dmu_buf_impl_t *db);
|
boolean_t dbuf_is_metadata(dmu_buf_impl_t *db);
|
||||||
|
|
||||||
|
|||||||
+2
-5
@@ -286,14 +286,11 @@ typedef struct {
|
|||||||
ddt_log_t *ddt_log_active; /* pointers into ddt_log */
|
ddt_log_t *ddt_log_active; /* pointers into ddt_log */
|
||||||
ddt_log_t *ddt_log_flushing; /* swapped when flush starts */
|
ddt_log_t *ddt_log_flushing; /* swapped when flush starts */
|
||||||
|
|
||||||
hrtime_t ddt_flush_start; /* log flush start this txg */
|
|
||||||
uint32_t ddt_flush_pass; /* log flush pass this txg */
|
|
||||||
|
|
||||||
int32_t ddt_flush_count; /* entries flushed this txg */
|
|
||||||
int32_t ddt_flush_min; /* min rem entries to flush */
|
|
||||||
int32_t ddt_log_ingest_rate; /* rolling log ingest rate */
|
int32_t ddt_log_ingest_rate; /* rolling log ingest rate */
|
||||||
int32_t ddt_log_flush_rate; /* rolling log flush rate */
|
int32_t ddt_log_flush_rate; /* rolling log flush rate */
|
||||||
int32_t ddt_log_flush_time_rate; /* avg time spent flushing */
|
int32_t ddt_log_flush_time_rate; /* avg time spent flushing */
|
||||||
|
uint32_t ddt_log_flush_pressure; /* pressure to apply for cap */
|
||||||
|
uint32_t ddt_log_flush_prev_backlog; /* prev backlog size */
|
||||||
|
|
||||||
uint64_t ddt_flush_force_txg; /* flush hard before this txg */
|
uint64_t ddt_flush_force_txg; /* flush hard before this txg */
|
||||||
|
|
||||||
|
|||||||
+9
-3
@@ -144,9 +144,9 @@ typedef enum dmu_object_byteswap {
|
|||||||
#define DMU_OT_IS_DDT(ot) \
|
#define DMU_OT_IS_DDT(ot) \
|
||||||
((ot) == DMU_OT_DDT_ZAP)
|
((ot) == DMU_OT_DDT_ZAP)
|
||||||
|
|
||||||
#define DMU_OT_IS_CRITICAL(ot) \
|
#define DMU_OT_IS_CRITICAL(ot, level) \
|
||||||
(DMU_OT_IS_METADATA(ot) && \
|
(DMU_OT_IS_METADATA(ot) && \
|
||||||
(ot) != DMU_OT_DNODE && \
|
((ot) != DMU_OT_DNODE || (level) > 0) && \
|
||||||
(ot) != DMU_OT_DIRECTORY_CONTENTS && \
|
(ot) != DMU_OT_DIRECTORY_CONTENTS && \
|
||||||
(ot) != DMU_OT_SA)
|
(ot) != DMU_OT_SA)
|
||||||
|
|
||||||
@@ -814,7 +814,7 @@ void dmu_tx_hold_append(dmu_tx_t *tx, uint64_t object, uint64_t off, int len);
|
|||||||
void dmu_tx_hold_append_by_dnode(dmu_tx_t *tx, dnode_t *dn, uint64_t off,
|
void dmu_tx_hold_append_by_dnode(dmu_tx_t *tx, dnode_t *dn, uint64_t off,
|
||||||
int len);
|
int len);
|
||||||
void dmu_tx_hold_clone_by_dnode(dmu_tx_t *tx, dnode_t *dn, uint64_t off,
|
void dmu_tx_hold_clone_by_dnode(dmu_tx_t *tx, dnode_t *dn, uint64_t off,
|
||||||
int len);
|
uint64_t len, uint_t blksz);
|
||||||
void dmu_tx_hold_free(dmu_tx_t *tx, uint64_t object, uint64_t off,
|
void dmu_tx_hold_free(dmu_tx_t *tx, uint64_t object, uint64_t off,
|
||||||
uint64_t len);
|
uint64_t len);
|
||||||
void dmu_tx_hold_free_by_dnode(dmu_tx_t *tx, dnode_t *dn, uint64_t off,
|
void dmu_tx_hold_free_by_dnode(dmu_tx_t *tx, dnode_t *dn, uint64_t off,
|
||||||
@@ -980,6 +980,11 @@ void dmu_object_size_from_db(dmu_buf_t *db, uint32_t *blksize,
|
|||||||
|
|
||||||
void dmu_object_dnsize_from_db(dmu_buf_t *db, int *dnsize);
|
void dmu_object_dnsize_from_db(dmu_buf_t *db, int *dnsize);
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
DDS_FLAG_ENCRYPTED = (1<<0),
|
||||||
|
DDS_FLAG_HAS_ENCRYPTED = (1<<7),
|
||||||
|
} dmu_objset_flag_t;
|
||||||
|
|
||||||
typedef struct dmu_objset_stats {
|
typedef struct dmu_objset_stats {
|
||||||
uint64_t dds_num_clones; /* number of clones of this */
|
uint64_t dds_num_clones; /* number of clones of this */
|
||||||
uint64_t dds_creation_txg;
|
uint64_t dds_creation_txg;
|
||||||
@@ -989,6 +994,7 @@ typedef struct dmu_objset_stats {
|
|||||||
uint8_t dds_inconsistent;
|
uint8_t dds_inconsistent;
|
||||||
uint8_t dds_redacted;
|
uint8_t dds_redacted;
|
||||||
char dds_origin[ZFS_MAX_DATASET_NAME_LEN];
|
char dds_origin[ZFS_MAX_DATASET_NAME_LEN];
|
||||||
|
uint8_t dds_flags; /* dmu_objset_flag_t */
|
||||||
} dmu_objset_stats_t;
|
} dmu_objset_stats_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ typedef struct dmu_recv_cookie {
|
|||||||
uint64_t drc_ivset_guid;
|
uint64_t drc_ivset_guid;
|
||||||
void *drc_owner;
|
void *drc_owner;
|
||||||
cred_t *drc_cred;
|
cred_t *drc_cred;
|
||||||
proc_t *drc_proc;
|
|
||||||
nvlist_t *drc_begin_nvl;
|
nvlist_t *drc_begin_nvl;
|
||||||
|
|
||||||
objset_t *drc_os;
|
objset_t *drc_os;
|
||||||
|
|||||||
@@ -284,7 +284,6 @@ typedef struct dsl_dataset_promote_arg {
|
|||||||
uint64_t used, comp, uncomp, unique, cloneusedsnap, originusedsnap;
|
uint64_t used, comp, uncomp, unique, cloneusedsnap, originusedsnap;
|
||||||
nvlist_t *err_ds;
|
nvlist_t *err_ds;
|
||||||
cred_t *cr;
|
cred_t *cr;
|
||||||
proc_t *proc;
|
|
||||||
} dsl_dataset_promote_arg_t;
|
} dsl_dataset_promote_arg_t;
|
||||||
|
|
||||||
typedef struct dsl_dataset_rollback_arg {
|
typedef struct dsl_dataset_rollback_arg {
|
||||||
@@ -299,7 +298,6 @@ typedef struct dsl_dataset_snapshot_arg {
|
|||||||
nvlist_t *ddsa_props;
|
nvlist_t *ddsa_props;
|
||||||
nvlist_t *ddsa_errors;
|
nvlist_t *ddsa_errors;
|
||||||
cred_t *ddsa_cr;
|
cred_t *ddsa_cr;
|
||||||
proc_t *ddsa_proc;
|
|
||||||
} dsl_dataset_snapshot_arg_t;
|
} dsl_dataset_snapshot_arg_t;
|
||||||
|
|
||||||
typedef struct dsl_dataset_rename_snapshot_arg {
|
typedef struct dsl_dataset_rename_snapshot_arg {
|
||||||
@@ -459,7 +457,7 @@ int dsl_dataset_clone_swap_check_impl(dsl_dataset_t *clone,
|
|||||||
void dsl_dataset_clone_swap_sync_impl(dsl_dataset_t *clone,
|
void dsl_dataset_clone_swap_sync_impl(dsl_dataset_t *clone,
|
||||||
dsl_dataset_t *origin_head, dmu_tx_t *tx);
|
dsl_dataset_t *origin_head, dmu_tx_t *tx);
|
||||||
int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname,
|
int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname,
|
||||||
dmu_tx_t *tx, boolean_t recv, uint64_t cnt, cred_t *cr, proc_t *proc);
|
dmu_tx_t *tx, boolean_t recv, uint64_t cnt, cred_t *cr);
|
||||||
void dsl_dataset_snapshot_sync_impl(dsl_dataset_t *ds, const char *snapname,
|
void dsl_dataset_snapshot_sync_impl(dsl_dataset_t *ds, const char *snapname,
|
||||||
dmu_tx_t *tx);
|
dmu_tx_t *tx);
|
||||||
|
|
||||||
|
|||||||
@@ -185,11 +185,11 @@ int dsl_dir_set_reservation(const char *ddname, zprop_source_t source,
|
|||||||
uint64_t reservation);
|
uint64_t reservation);
|
||||||
int dsl_dir_activate_fs_ss_limit(const char *);
|
int dsl_dir_activate_fs_ss_limit(const char *);
|
||||||
int dsl_fs_ss_limit_check(dsl_dir_t *, uint64_t, zfs_prop_t, dsl_dir_t *,
|
int dsl_fs_ss_limit_check(dsl_dir_t *, uint64_t, zfs_prop_t, dsl_dir_t *,
|
||||||
cred_t *, proc_t *);
|
cred_t *);
|
||||||
void dsl_fs_ss_count_adjust(dsl_dir_t *, int64_t, const char *, dmu_tx_t *);
|
void dsl_fs_ss_count_adjust(dsl_dir_t *, int64_t, const char *, dmu_tx_t *);
|
||||||
int dsl_dir_rename(const char *oldname, const char *newname);
|
int dsl_dir_rename(const char *oldname, const char *newname);
|
||||||
int dsl_dir_transfer_possible(dsl_dir_t *sdd, dsl_dir_t *tdd,
|
int dsl_dir_transfer_possible(dsl_dir_t *sdd, dsl_dir_t *tdd,
|
||||||
uint64_t fs_cnt, uint64_t ss_cnt, uint64_t space, cred_t *, proc_t *);
|
uint64_t fs_cnt, uint64_t ss_cnt, uint64_t space, cred_t *);
|
||||||
boolean_t dsl_dir_is_clone(dsl_dir_t *dd);
|
boolean_t dsl_dir_is_clone(dsl_dir_t *dd);
|
||||||
void dsl_dir_new_refreservation(dsl_dir_t *dd, struct dsl_dataset *ds,
|
void dsl_dir_new_refreservation(dsl_dir_t *dd, struct dsl_dataset *ds,
|
||||||
uint64_t reservation, cred_t *cr, dmu_tx_t *tx);
|
uint64_t reservation, cred_t *cr, dmu_tx_t *tx);
|
||||||
|
|||||||
@@ -31,8 +31,16 @@ extern "C" {
|
|||||||
#else
|
#else
|
||||||
#include <linux/frame.h>
|
#include <linux/frame.h>
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(_ASM) && ! defined(HAVE_STACK_FRAME_NON_STANDARD_ASM)
|
||||||
|
.macro STACK_FRAME_NON_STANDARD func:req
|
||||||
|
.endm
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#define STACK_FRAME_NON_STANDARD(func)
|
#define STACK_FRAME_NON_STANDARD(func)
|
||||||
|
#if defined(_ASM)
|
||||||
|
.macro STACK_FRAME_NON_STANDARD func:req
|
||||||
|
.endm
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -1614,6 +1614,15 @@ typedef enum zfs_ioc {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef struct zfs_rewrite_args {
|
||||||
|
uint64_t off;
|
||||||
|
uint64_t len;
|
||||||
|
uint64_t flags;
|
||||||
|
uint64_t arg;
|
||||||
|
} zfs_rewrite_args_t;
|
||||||
|
|
||||||
|
#define ZFS_IOC_REWRITE _IOW(0x83, 3, zfs_rewrite_args_t)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ZFS-specific error codes used for returning descriptive errors
|
* ZFS-specific error codes used for returning descriptive errors
|
||||||
* to the userland through zfs ioctls.
|
* to the userland through zfs ioctls.
|
||||||
|
|||||||
@@ -568,6 +568,8 @@ typedef struct metaslab_unflushed_phys {
|
|||||||
uint64_t msp_unflushed_txg;
|
uint64_t msp_unflushed_txg;
|
||||||
} metaslab_unflushed_phys_t;
|
} metaslab_unflushed_phys_t;
|
||||||
|
|
||||||
|
char *metaslab_rt_name(metaslab_group_t *, metaslab_t *, const char *);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ typedef enum zfs_range_seg_type {
|
|||||||
ZFS_RANGE_SEG_NUM_TYPES,
|
ZFS_RANGE_SEG_NUM_TYPES,
|
||||||
} zfs_range_seg_type_t;
|
} zfs_range_seg_type_t;
|
||||||
|
|
||||||
|
#define ZFS_RT_NAME(rt) (((rt)->rt_name != NULL) ? (rt)->rt_name : "")
|
||||||
|
#define ZFS_RT_F_DYN_NAME (1ULL << 0) /* if rt_name must be freed */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note: the range_tree may not be accessed concurrently; consumers
|
* Note: the range_tree may not be accessed concurrently; consumers
|
||||||
* must provide external locking if required.
|
* must provide external locking if required.
|
||||||
@@ -68,6 +71,9 @@ typedef struct zfs_range_tree {
|
|||||||
void *rt_arg;
|
void *rt_arg;
|
||||||
uint64_t rt_gap; /* allowable inter-segment gap */
|
uint64_t rt_gap; /* allowable inter-segment gap */
|
||||||
|
|
||||||
|
uint64_t rt_flags;
|
||||||
|
const char *rt_name; /* details for debugging */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The rt_histogram maintains a histogram of ranges. Each bucket,
|
* The rt_histogram maintains a histogram of ranges. Each bucket,
|
||||||
* rt_histogram[i], contains the number of ranges whose size is:
|
* rt_histogram[i], contains the number of ranges whose size is:
|
||||||
@@ -281,6 +287,9 @@ zfs_range_tree_t *zfs_range_tree_create_gap(const zfs_range_tree_ops_t *ops,
|
|||||||
uint64_t gap);
|
uint64_t gap);
|
||||||
zfs_range_tree_t *zfs_range_tree_create(const zfs_range_tree_ops_t *ops,
|
zfs_range_tree_t *zfs_range_tree_create(const zfs_range_tree_ops_t *ops,
|
||||||
zfs_range_seg_type_t type, void *arg, uint64_t start, uint64_t shift);
|
zfs_range_seg_type_t type, void *arg, uint64_t start, uint64_t shift);
|
||||||
|
zfs_range_tree_t *zfs_range_tree_create_flags(const zfs_range_tree_ops_t *ops,
|
||||||
|
zfs_range_seg_type_t type, void *arg, uint64_t start, uint64_t shift,
|
||||||
|
uint64_t flags, const char *name);
|
||||||
void zfs_range_tree_destroy(zfs_range_tree_t *rt);
|
void zfs_range_tree_destroy(zfs_range_tree_t *rt);
|
||||||
boolean_t zfs_range_tree_contains(zfs_range_tree_t *rt, uint64_t start,
|
boolean_t zfs_range_tree_contains(zfs_range_tree_t *rt, uint64_t start,
|
||||||
uint64_t size);
|
uint64_t size);
|
||||||
|
|||||||
@@ -1103,6 +1103,7 @@ extern boolean_t spa_guid_exists(uint64_t pool_guid, uint64_t device_guid);
|
|||||||
extern char *spa_strdup(const char *);
|
extern char *spa_strdup(const char *);
|
||||||
extern void spa_strfree(char *);
|
extern void spa_strfree(char *);
|
||||||
extern uint64_t spa_generate_guid(spa_t *spa);
|
extern uint64_t spa_generate_guid(spa_t *spa);
|
||||||
|
extern uint64_t spa_generate_load_guid(void);
|
||||||
extern void snprintf_blkptr(char *buf, size_t buflen, const blkptr_t *bp);
|
extern void snprintf_blkptr(char *buf, size_t buflen, const blkptr_t *bp);
|
||||||
extern void spa_freeze(spa_t *spa);
|
extern void spa_freeze(spa_t *spa);
|
||||||
extern int spa_change_guid(spa_t *spa, const uint64_t *guidp);
|
extern int spa_change_guid(spa_t *spa, const uint64_t *guidp);
|
||||||
|
|||||||
+20
-3
@@ -66,6 +66,20 @@ typedef struct txg_list {
|
|||||||
txg_node_t *tl_head[TXG_SIZE];
|
txg_node_t *tl_head[TXG_SIZE];
|
||||||
} txg_list_t;
|
} txg_list_t;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Wait flags for txg_wait_synced_flags(). By default (TXG_WAIT_NONE), it will
|
||||||
|
* wait until the wanted txg is reached, or block forever. Additional flags
|
||||||
|
* indicate other conditions that the caller is interested in, that will cause
|
||||||
|
* the wait to break and return an error code describing the condition.
|
||||||
|
*/
|
||||||
|
typedef enum {
|
||||||
|
/* No special flags. Guaranteed to block forever or return 0 */
|
||||||
|
TXG_WAIT_NONE = 0,
|
||||||
|
|
||||||
|
/* If a signal arrives while waiting, abort and return EINTR */
|
||||||
|
TXG_WAIT_SIGNAL = (1 << 0),
|
||||||
|
} txg_wait_flag_t;
|
||||||
|
|
||||||
struct dsl_pool;
|
struct dsl_pool;
|
||||||
|
|
||||||
extern void txg_init(struct dsl_pool *dp, uint64_t txg);
|
extern void txg_init(struct dsl_pool *dp, uint64_t txg);
|
||||||
@@ -86,13 +100,16 @@ extern void txg_kick(struct dsl_pool *dp, uint64_t txg);
|
|||||||
* Try to make this happen as soon as possible (eg. kick off any
|
* Try to make this happen as soon as possible (eg. kick off any
|
||||||
* necessary syncs immediately). If txg==0, wait for the currently open
|
* necessary syncs immediately). If txg==0, wait for the currently open
|
||||||
* txg to finish syncing.
|
* txg to finish syncing.
|
||||||
|
* See txg_wait_flag_t above for a description of how the flags affect the wait.
|
||||||
*/
|
*/
|
||||||
extern void txg_wait_synced(struct dsl_pool *dp, uint64_t txg);
|
extern int txg_wait_synced_flags(struct dsl_pool *dp, uint64_t txg,
|
||||||
|
txg_wait_flag_t flags);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Wait as above. Returns true if the thread was signaled while waiting.
|
* Traditional form of txg_wait_synced_flags, waits forever.
|
||||||
|
* Shorthand for VERIFY0(txg_wait_synced_flags(dp, TXG_WAIT_NONE))
|
||||||
*/
|
*/
|
||||||
extern boolean_t txg_wait_synced_sig(struct dsl_pool *dp, uint64_t txg);
|
extern void txg_wait_synced(struct dsl_pool *dp, uint64_t txg);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Wait until the given transaction group, or one after it, is
|
* Wait until the given transaction group, or one after it, is
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ extern void vdev_queue_change_io_priority(zio_t *zio, zio_priority_t priority);
|
|||||||
extern uint32_t vdev_queue_length(vdev_t *vd);
|
extern uint32_t vdev_queue_length(vdev_t *vd);
|
||||||
extern uint64_t vdev_queue_last_offset(vdev_t *vd);
|
extern uint64_t vdev_queue_last_offset(vdev_t *vd);
|
||||||
extern uint64_t vdev_queue_class_length(vdev_t *vq, zio_priority_t p);
|
extern uint64_t vdev_queue_class_length(vdev_t *vq, zio_priority_t p);
|
||||||
|
extern boolean_t vdev_queue_pool_busy(spa_t *spa);
|
||||||
|
|
||||||
extern void vdev_config_dirty(vdev_t *vd);
|
extern void vdev_config_dirty(vdev_t *vd);
|
||||||
extern void vdev_config_clean(vdev_t *vd);
|
extern void vdev_config_clean(vdev_t *vd);
|
||||||
|
|||||||
@@ -651,6 +651,7 @@ uint64_t vdev_best_ashift(uint64_t logical, uint64_t a, uint64_t b);
|
|||||||
int param_get_raidz_impl(char *buf, zfs_kernel_param_t *kp);
|
int param_get_raidz_impl(char *buf, zfs_kernel_param_t *kp);
|
||||||
#endif
|
#endif
|
||||||
int param_set_raidz_impl(ZFS_MODULE_PARAM_ARGS);
|
int param_set_raidz_impl(ZFS_MODULE_PARAM_ARGS);
|
||||||
|
char *vdev_rt_name(vdev_t *vd, const char *name);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Vdev ashift optimization tunables
|
* Vdev ashift optimization tunables
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ typedef struct zcp_run_info {
|
|||||||
* rather than the 'current' thread's.
|
* rather than the 'current' thread's.
|
||||||
*/
|
*/
|
||||||
cred_t *zri_cred;
|
cred_t *zri_cred;
|
||||||
proc_t *zri_proc;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The tx in which this channel program is running.
|
* The tx in which this channel program is running.
|
||||||
|
|||||||
@@ -236,6 +236,11 @@ typedef pthread_t kthread_t;
|
|||||||
#define thread_join(t) pthread_join((pthread_t)(t), NULL)
|
#define thread_join(t) pthread_join((pthread_t)(t), NULL)
|
||||||
|
|
||||||
#define newproc(f, a, cid, pri, ctp, pid) (ENOSYS)
|
#define newproc(f, a, cid, pri, ctp, pid) (ENOSYS)
|
||||||
|
/*
|
||||||
|
* Check if the current thread is a memory reclaim thread.
|
||||||
|
* Always returns false in userspace (no memory reclaim thread).
|
||||||
|
*/
|
||||||
|
#define current_is_reclaim_thread() (0)
|
||||||
|
|
||||||
/* in libzpool, p0 exists only to have its address taken */
|
/* in libzpool, p0 exists only to have its address taken */
|
||||||
typedef struct proc {
|
typedef struct proc {
|
||||||
@@ -623,8 +628,10 @@ extern void delay(clock_t ticks);
|
|||||||
* Process priorities as defined by setpriority(2) and getpriority(2).
|
* Process priorities as defined by setpriority(2) and getpriority(2).
|
||||||
*/
|
*/
|
||||||
#define minclsyspri 19
|
#define minclsyspri 19
|
||||||
#define maxclsyspri -20
|
|
||||||
#define defclsyspri 0
|
#define defclsyspri 0
|
||||||
|
/* Write issue taskq priority. */
|
||||||
|
#define wtqclsyspri -19
|
||||||
|
#define maxclsyspri -20
|
||||||
|
|
||||||
#define CPU_SEQID ((uintptr_t)pthread_self() & (max_ncpus - 1))
|
#define CPU_SEQID ((uintptr_t)pthread_self() & (max_ncpus - 1))
|
||||||
#define CPU_SEQID_UNSTABLE CPU_SEQID
|
#define CPU_SEQID_UNSTABLE CPU_SEQID
|
||||||
@@ -632,6 +639,9 @@ extern void delay(clock_t ticks);
|
|||||||
#define kcred NULL
|
#define kcred NULL
|
||||||
#define CRED() NULL
|
#define CRED() NULL
|
||||||
|
|
||||||
|
#define crhold(cr) ((void)cr)
|
||||||
|
#define crfree(cr) ((void)cr)
|
||||||
|
|
||||||
#define ptob(x) ((x) * PAGESIZE)
|
#define ptob(x) ((x) * PAGESIZE)
|
||||||
|
|
||||||
#define NN_DIVISOR_1000 (1U << 0)
|
#define NN_DIVISOR_1000 (1U << 0)
|
||||||
@@ -744,7 +754,6 @@ extern int zfs_secpolicy_rename_perms(const char *from, const char *to,
|
|||||||
cred_t *cr);
|
cred_t *cr);
|
||||||
extern int zfs_secpolicy_destroy_perms(const char *name, cred_t *cr);
|
extern int zfs_secpolicy_destroy_perms(const char *name, cred_t *cr);
|
||||||
extern int secpolicy_zfs(const cred_t *cr);
|
extern int secpolicy_zfs(const cred_t *cr);
|
||||||
extern int secpolicy_zfs_proc(const cred_t *cr, proc_t *proc);
|
|
||||||
extern zoneid_t getzoneid(void);
|
extern zoneid_t getzoneid(void);
|
||||||
|
|
||||||
/* SID stuff */
|
/* SID stuff */
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ extern int zfs_dbgmsg_enable;
|
|||||||
#define ZFS_DEBUG_METASLAB_ALLOC (1 << 13)
|
#define ZFS_DEBUG_METASLAB_ALLOC (1 << 13)
|
||||||
#define ZFS_DEBUG_BRT (1 << 14)
|
#define ZFS_DEBUG_BRT (1 << 14)
|
||||||
#define ZFS_DEBUG_RAIDZ_RECONSTRUCT (1 << 15)
|
#define ZFS_DEBUG_RAIDZ_RECONSTRUCT (1 << 15)
|
||||||
|
#define ZFS_DEBUG_DDT (1 << 16)
|
||||||
|
|
||||||
extern void __set_error(const char *file, const char *func, int line, int err);
|
extern void __set_error(const char *file, const char *func, int line, int err);
|
||||||
extern void __zfs_dbgmsg(char *buf);
|
extern void __zfs_dbgmsg(char *buf);
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ extern int zfs_clone_range(znode_t *, uint64_t *, znode_t *, uint64_t *,
|
|||||||
uint64_t *, cred_t *);
|
uint64_t *, cred_t *);
|
||||||
extern int zfs_clone_range_replay(znode_t *, uint64_t, uint64_t, uint64_t,
|
extern int zfs_clone_range_replay(znode_t *, uint64_t, uint64_t, uint64_t,
|
||||||
const blkptr_t *, size_t);
|
const blkptr_t *, size_t);
|
||||||
|
extern int zfs_rewrite(znode_t *, uint64_t, uint64_t, uint64_t, uint64_t);
|
||||||
|
|
||||||
extern int zfs_getsecattr(znode_t *, vsecattr_t *, int, cred_t *);
|
extern int zfs_getsecattr(znode_t *, vsecattr_t *, int, cred_t *);
|
||||||
extern int zfs_setsecattr(znode_t *, vsecattr_t *, int, cred_t *);
|
extern int zfs_setsecattr(znode_t *, vsecattr_t *, int, cred_t *);
|
||||||
|
|||||||
@@ -201,8 +201,6 @@ typedef struct znode {
|
|||||||
uint64_t z_size; /* file size (cached) */
|
uint64_t z_size; /* file size (cached) */
|
||||||
uint64_t z_pflags; /* pflags (cached) */
|
uint64_t z_pflags; /* pflags (cached) */
|
||||||
uint32_t z_sync_cnt; /* synchronous open count */
|
uint32_t z_sync_cnt; /* synchronous open count */
|
||||||
uint32_t z_sync_writes_cnt; /* synchronous write count */
|
|
||||||
uint32_t z_async_writes_cnt; /* asynchronous write count */
|
|
||||||
mode_t z_mode; /* mode (cached) */
|
mode_t z_mode; /* mode (cached) */
|
||||||
kmutex_t z_acl_lock; /* acl data lock */
|
kmutex_t z_acl_lock; /* acl data lock */
|
||||||
zfs_acl_t *z_acl_cached; /* cached acl */
|
zfs_acl_t *z_acl_cached; /* cached acl */
|
||||||
|
|||||||
+2
-1
@@ -350,6 +350,7 @@ typedef struct zio_prop {
|
|||||||
uint8_t zp_complevel;
|
uint8_t zp_complevel;
|
||||||
uint8_t zp_level;
|
uint8_t zp_level;
|
||||||
uint8_t zp_copies;
|
uint8_t zp_copies;
|
||||||
|
uint8_t zp_gang_copies;
|
||||||
dmu_object_type_t zp_type;
|
dmu_object_type_t zp_type;
|
||||||
boolean_t zp_dedup;
|
boolean_t zp_dedup;
|
||||||
boolean_t zp_dedup_verify;
|
boolean_t zp_dedup_verify;
|
||||||
@@ -575,7 +576,7 @@ extern zio_t *zio_rewrite(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp,
|
|||||||
zio_priority_t priority, zio_flag_t flags, zbookmark_phys_t *zb);
|
zio_priority_t priority, zio_flag_t flags, zbookmark_phys_t *zb);
|
||||||
|
|
||||||
extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies,
|
extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies,
|
||||||
boolean_t nopwrite, boolean_t brtwrite);
|
int gang_copies, boolean_t nopwrite, boolean_t brtwrite);
|
||||||
|
|
||||||
extern void zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp);
|
extern void zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp);
|
||||||
|
|
||||||
|
|||||||
+49
-17
@@ -41,9 +41,26 @@
|
|||||||
do { ssize_t r __maybe_unused = write(fd, s, n); } while (0)
|
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)
|
#define spl_bt_write(fd, s) spl_bt_write_n(fd, s, sizeof (s)-1)
|
||||||
|
|
||||||
#if defined(HAVE_LIBUNWIND)
|
#ifdef HAVE_LIBUNWIND
|
||||||
|
/*
|
||||||
|
* libunwind-gcc and libunwind-llvm both list registers using an enum,
|
||||||
|
* unw_regnum_t, however they indicate the highest numbered register for
|
||||||
|
* a given architecture in different ways. We can check which one is defined
|
||||||
|
* and mark which libunwind is in use
|
||||||
|
*/
|
||||||
|
#ifdef IS_LIBUNWIND_LLVM
|
||||||
|
#include <libunwind.h>
|
||||||
|
#define LAST_REG_INDEX _LIBUNWIND_HIGHEST_DWARF_REGISTER
|
||||||
|
#else
|
||||||
|
/*
|
||||||
|
* Need to define UNW_LOCAL_ONLY before importing libunwind.h
|
||||||
|
* if using libgcc libunwind.
|
||||||
|
*/
|
||||||
#define UNW_LOCAL_ONLY
|
#define UNW_LOCAL_ONLY
|
||||||
#include <libunwind.h>
|
#include <libunwind.h>
|
||||||
|
#define LAST_REG_INDEX UNW_TDEP_LAST_REG
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert `v` to ASCII hex characters. The bottom `n` nybbles (4-bits ie one
|
* Convert `v` to ASCII hex characters. The bottom `n` nybbles (4-bits ie one
|
||||||
@@ -102,14 +119,13 @@ libspl_backtrace(int fd)
|
|||||||
unw_init_local(&cp, &uc);
|
unw_init_local(&cp, &uc);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* libunwind's list of possible registers for this architecture is an
|
* Iterate over all registers for the architecture. We've figured
|
||||||
* enum, unw_regnum_t. UNW_TDEP_LAST_REG is the highest-numbered
|
* out the highest number above, however, not all register numbers in
|
||||||
* register in that list, however, not all register numbers in this
|
* this range are defined by the architecture, and not all defined
|
||||||
* range are defined by the architecture, and not all defined registers
|
* registers will be present on every implementation of that
|
||||||
* will be present on every implementation of that architecture.
|
* architecture. Moreover, libunwind provides nice names for most, but
|
||||||
* Moreover, libunwind provides nice names for most, but not all
|
* not all registers, but these are hardcoded; a name being available
|
||||||
* registers, but these are hardcoded; a name being available does not
|
* does not mean that register is available.
|
||||||
* mean that register is available.
|
|
||||||
*
|
*
|
||||||
* So, we have to pull this all together here. We try to get the value
|
* So, we have to pull this all together here. We try to get the value
|
||||||
* of every possible register. If we get a value for it, then the
|
* of every possible register. If we get a value for it, then the
|
||||||
@@ -120,26 +136,42 @@ libspl_backtrace(int fd)
|
|||||||
* thing.
|
* thing.
|
||||||
*/
|
*/
|
||||||
uint_t cols = 0;
|
uint_t cols = 0;
|
||||||
for (uint_t regnum = 0; regnum <= UNW_TDEP_LAST_REG; regnum++) {
|
for (uint_t regnum = 0; regnum <= LAST_REG_INDEX; regnum++) {
|
||||||
/*
|
/*
|
||||||
* Get the value. Any error probably means the register
|
* Get the value. Any error probably means the register
|
||||||
* doesn't exist, and we skip it.
|
* doesn't exist, and we skip it. LLVM libunwind iterates over
|
||||||
|
* fp registers in the same list, however they have to be
|
||||||
|
* accessed using unw_get_fpreg instead. Here, we just ignore
|
||||||
|
* them.
|
||||||
*/
|
*/
|
||||||
|
#ifdef IS_LIBUNWIND_LLVM
|
||||||
|
if (unw_is_fpreg(&cp, regnum) ||
|
||||||
|
unw_get_reg(&cp, regnum, &v) < 0)
|
||||||
|
continue;
|
||||||
|
#else
|
||||||
if (unw_get_reg(&cp, regnum, &v) < 0)
|
if (unw_get_reg(&cp, regnum, &v) < 0)
|
||||||
continue;
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Register name. If libunwind doesn't have a name for it,
|
* Register name. If GCC libunwind doesn't have a name for it,
|
||||||
* it will return "???". As a shortcut, we just treat '?'
|
* it will return "???". As a shortcut, we just treat '?'
|
||||||
* is an alternate end-of-string character.
|
* is an alternate end-of-string character. LLVM libunwind will
|
||||||
|
* return the string 'unknown register', which we detect by
|
||||||
|
* checking if the register name is longer than 5 characters.
|
||||||
*/
|
*/
|
||||||
|
#ifdef IS_LIBUNWIND_LLVM
|
||||||
|
const char *name = unw_regname(&cp, regnum);
|
||||||
|
#else
|
||||||
const char *name = unw_regname(regnum);
|
const char *name = unw_regname(regnum);
|
||||||
|
#endif
|
||||||
for (n = 0; name[n] != '\0' && name[n] != '?'; n++) {}
|
for (n = 0; name[n] != '\0' && name[n] != '?'; n++) {}
|
||||||
if (n == 0) {
|
if (n == 0 || n > 5) {
|
||||||
/*
|
/*
|
||||||
* No valid name, so make one of the form "?xx", where
|
* No valid name, or likely llvm_libunwind returned
|
||||||
* "xx" is the two-char hex of libunwind's register
|
* unknown_register, so make one of the form "?xx",
|
||||||
* number.
|
* where "xx" is the two-char hex of libunwind's
|
||||||
|
* register number.
|
||||||
*/
|
*/
|
||||||
buf[0] = '?';
|
buf[0] = '?';
|
||||||
n = spl_bt_u64_to_hex_str(regnum, 2,
|
n = spl_bt_u64_to_hex_str(regnum, 2,
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ libspl_rpc_HEADERS = \
|
|||||||
|
|
||||||
libspl_sysdir = $(libspldir)/sys
|
libspl_sysdir = $(libspldir)/sys
|
||||||
libspl_sys_HEADERS = \
|
libspl_sys_HEADERS = \
|
||||||
|
%D%/sys/abd_os.h \
|
||||||
|
%D%/sys/abd_impl_os.h \
|
||||||
%D%/sys/acl.h \
|
%D%/sys/acl.h \
|
||||||
%D%/sys/acl_impl.h \
|
%D%/sys/acl_impl.h \
|
||||||
%D%/sys/asm_linkage.h \
|
%D%/sys/asm_linkage.h \
|
||||||
|
|||||||
+33
-32
@@ -86,12 +86,13 @@ do { \
|
|||||||
|
|
||||||
#define VERIFY3B(LEFT, OP, RIGHT) \
|
#define VERIFY3B(LEFT, OP, RIGHT) \
|
||||||
do { \
|
do { \
|
||||||
const boolean_t __left = (boolean_t)(LEFT); \
|
const boolean_t __left = (boolean_t)!!(LEFT); \
|
||||||
const boolean_t __right = (boolean_t)(RIGHT); \
|
const boolean_t __right = (boolean_t)!!(RIGHT); \
|
||||||
if (!(__left OP __right)) \
|
if (!(__left OP __right)) \
|
||||||
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"%s %s %s (0x%llx %s 0x%llx)", #LEFT, #OP, #RIGHT, \
|
"VERIFY3B(%s, %s, %s) failed " \
|
||||||
(u_longlong_t)__left, #OP, (u_longlong_t)__right); \
|
"(%d %s %d)", #LEFT, #OP, #RIGHT, \
|
||||||
|
__left, #OP, __right); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY3S(LEFT, OP, RIGHT) \
|
#define VERIFY3S(LEFT, OP, RIGHT) \
|
||||||
@@ -100,8 +101,9 @@ do { \
|
|||||||
const int64_t __right = (int64_t)(RIGHT); \
|
const int64_t __right = (int64_t)(RIGHT); \
|
||||||
if (!(__left OP __right)) \
|
if (!(__left OP __right)) \
|
||||||
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"%s %s %s (0x%llx %s 0x%llx)", #LEFT, #OP, #RIGHT, \
|
"VERIFY3S(%s, %s, %s) failed " \
|
||||||
(u_longlong_t)__left, #OP, (u_longlong_t)__right); \
|
"(%lld %s 0x%lld)", #LEFT, #OP, #RIGHT, \
|
||||||
|
(longlong_t)__left, #OP, (longlong_t)__right); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY3U(LEFT, OP, RIGHT) \
|
#define VERIFY3U(LEFT, OP, RIGHT) \
|
||||||
@@ -110,7 +112,8 @@ do { \
|
|||||||
const uint64_t __right = (uint64_t)(RIGHT); \
|
const uint64_t __right = (uint64_t)(RIGHT); \
|
||||||
if (!(__left OP __right)) \
|
if (!(__left OP __right)) \
|
||||||
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"%s %s %s (0x%llx %s 0x%llx)", #LEFT, #OP, #RIGHT, \
|
"VERIFY3U(%s, %s, %s) failed " \
|
||||||
|
"(%llu %s %llu)", #LEFT, #OP, #RIGHT, \
|
||||||
(u_longlong_t)__left, #OP, (u_longlong_t)__right); \
|
(u_longlong_t)__left, #OP, (u_longlong_t)__right); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -120,7 +123,8 @@ do { \
|
|||||||
const uintptr_t __right = (uintptr_t)(RIGHT); \
|
const uintptr_t __right = (uintptr_t)(RIGHT); \
|
||||||
if (!(__left OP __right)) \
|
if (!(__left OP __right)) \
|
||||||
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"%s %s %s (%p %s %p)", #LEFT, #OP, #RIGHT, \
|
"VERIFY3P(%s, %s, %s) failed " \
|
||||||
|
"(%p %s %p)", #LEFT, #OP, #RIGHT, \
|
||||||
(void *)__left, #OP, (void *)__right); \
|
(void *)__left, #OP, (void *)__right); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -129,7 +133,7 @@ do { \
|
|||||||
const uint64_t __left = (uint64_t)(LEFT); \
|
const uint64_t __left = (uint64_t)(LEFT); \
|
||||||
if (!(__left == 0)) \
|
if (!(__left == 0)) \
|
||||||
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"%s == 0 (0x%llx == 0)", #LEFT, \
|
"VERIFY0(%s) failed (%lld)", #LEFT, \
|
||||||
(u_longlong_t)__left); \
|
(u_longlong_t)__left); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -138,7 +142,7 @@ do { \
|
|||||||
const uintptr_t __left = (uintptr_t)(LEFT); \
|
const uintptr_t __left = (uintptr_t)(LEFT); \
|
||||||
if (!(__left == 0)) \
|
if (!(__left == 0)) \
|
||||||
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"%s == 0 (%p == 0)", #LEFT, \
|
"VERIFY0P(%s) failed (%p)", #LEFT, \
|
||||||
(void *)__left); \
|
(void *)__left); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -150,13 +154,13 @@ do { \
|
|||||||
/* BEGIN CSTYLED */
|
/* BEGIN CSTYLED */
|
||||||
#define VERIFY3BF(LEFT, OP, RIGHT, STR, ...) \
|
#define VERIFY3BF(LEFT, OP, RIGHT, STR, ...) \
|
||||||
do { \
|
do { \
|
||||||
const boolean_t __left = (boolean_t)(LEFT); \
|
const boolean_t __left = (boolean_t)!!(LEFT); \
|
||||||
const boolean_t __right = (boolean_t)(RIGHT); \
|
const boolean_t __right = (boolean_t)!!(RIGHT); \
|
||||||
if (!(__left OP __right)) \
|
if (!(__left OP __right)) \
|
||||||
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"%s %s %s (0x%llx %s 0x%llx) " STR, \
|
"VERIFY3B(%s, %s, %s) failed " \
|
||||||
#LEFT, #OP, #RIGHT, \
|
"(%d %s %d) " STR, #LEFT, #OP, #RIGHT, \
|
||||||
(u_longlong_t)__left, #OP, (u_longlong_t)__right, \
|
__left, #OP, __right, \
|
||||||
__VA_ARGS__); \
|
__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -166,9 +170,9 @@ do { \
|
|||||||
const int64_t __right = (int64_t)(RIGHT); \
|
const int64_t __right = (int64_t)(RIGHT); \
|
||||||
if (!(__left OP __right)) \
|
if (!(__left OP __right)) \
|
||||||
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"%s %s %s (0x%llx %s 0x%llx) " STR, \
|
"VERIFY3S(%s, %s, %s) failed " \
|
||||||
#LEFT, #OP, #RIGHT, \
|
"(%lld %s %lld) " STR, #LEFT, #OP, #RIGHT, \
|
||||||
(u_longlong_t)__left, #OP, (u_longlong_t)__right, \
|
(longlong_t)__left, #OP, (longlong_t)__right, \
|
||||||
__VA_ARGS__); \
|
__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -178,8 +182,8 @@ do { \
|
|||||||
const uint64_t __right = (uint64_t)(RIGHT); \
|
const uint64_t __right = (uint64_t)(RIGHT); \
|
||||||
if (!(__left OP __right)) \
|
if (!(__left OP __right)) \
|
||||||
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"%s %s %s (0x%llx %s 0x%llx) " STR, \
|
"VERIFY3U(%s, %s, %s) failed " \
|
||||||
#LEFT, #OP, #RIGHT, \
|
"(%llu %s %llu) " STR, #LEFT, #OP, #RIGHT, \
|
||||||
(u_longlong_t)__left, #OP, (u_longlong_t)__right, \
|
(u_longlong_t)__left, #OP, (u_longlong_t)__right, \
|
||||||
__VA_ARGS__); \
|
__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
@@ -190,20 +194,20 @@ do { \
|
|||||||
const uintptr_t __right = (uintptr_t)(RIGHT); \
|
const uintptr_t __right = (uintptr_t)(RIGHT); \
|
||||||
if (!(__left OP __right)) \
|
if (!(__left OP __right)) \
|
||||||
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"%s %s %s (0x%llx %s 0x%llx) " STR, \
|
"VERIFY3P(%s, %s, %s) failed " \
|
||||||
#LEFT, #OP, #RIGHT, \
|
"(%p %s %p) " STR, #LEFT, #OP, #RIGHT, \
|
||||||
(u_longlong_t)__left, #OP, (u_longlong_t)__right, \
|
(void *)__left, #OP, (void *)__right, \
|
||||||
__VA_ARGS__); \
|
__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
/* END CSTYLED */
|
/* END CSTYLED */
|
||||||
|
|
||||||
#define VERIFY0F(LEFT, STR, ...) \
|
#define VERIFY0F(LEFT, STR, ...) \
|
||||||
do { \
|
do { \
|
||||||
const uint64_t __left = (uint64_t)(LEFT); \
|
const int64_t __left = (int64_t)(LEFT); \
|
||||||
if (!(__left == 0)) \
|
if (!(__left == 0)) \
|
||||||
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"%s == 0 (0x%llx == 0) " STR, #LEFT, \
|
"VERIFY0(%s) failed (%lld) " STR, #LEFT, \
|
||||||
(u_longlong_t)__left, __VA_ARGS__); \
|
(longlong_t)__left, __VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define VERIFY0PF(LEFT, STR, ...) \
|
#define VERIFY0PF(LEFT, STR, ...) \
|
||||||
@@ -211,8 +215,8 @@ do { \
|
|||||||
const uintptr_t __left = (uintptr_t)(LEFT); \
|
const uintptr_t __left = (uintptr_t)(LEFT); \
|
||||||
if (!(__left == 0)) \
|
if (!(__left == 0)) \
|
||||||
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
"%s == 0 (%p == 0) " STR, #LEFT, \
|
"VERIFY0P(%s) failed (%p) " STR, #LEFT, \
|
||||||
(u_longlong_t)__left, __VA_ARGS__); \
|
(void *)__left, __VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#ifdef assert
|
#ifdef assert
|
||||||
@@ -264,10 +268,7 @@ do { \
|
|||||||
((void)(((!(A)) || (B)) || \
|
((void)(((!(A)) || (B)) || \
|
||||||
libspl_assert("(" #A ") implies (" #B ")", \
|
libspl_assert("(" #A ") implies (" #B ")", \
|
||||||
__FILE__, __FUNCTION__, __LINE__)))
|
__FILE__, __FUNCTION__, __LINE__)))
|
||||||
#define EQUIV(A, B) \
|
#define EQUIV(A, B) VERIFY3B(A, ==, B)
|
||||||
((void)((!!(A) == !!(B)) || \
|
|
||||||
libspl_assert("(" #A ") is equivalent to (" #B ")", \
|
|
||||||
__FILE__, __FUNCTION__, __LINE__)))
|
|
||||||
|
|
||||||
#endif /* NDEBUG */
|
#endif /* NDEBUG */
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,11 @@
|
|||||||
|
|
||||||
#include <sys/mount.h> /* for BLKGETSIZE64 */
|
#include <sys/mount.h> /* for BLKGETSIZE64 */
|
||||||
|
|
||||||
|
#ifdef HAVE_STATX
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <linux/stat.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Emulate Solaris' behavior of returning the block device size in fstat64().
|
* Emulate Solaris' behavior of returning the block device size in fstat64().
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -85,13 +85,21 @@ _sol_getmntent(FILE *fp, struct mnttab *mgetp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
getextmntent_impl(FILE *fp, struct extmnttab *mp)
|
getextmntent_impl(FILE *fp, struct extmnttab *mp, uint64_t *mnt_id)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct stat64 st;
|
struct stat64 st;
|
||||||
|
|
||||||
|
*mnt_id = 0;
|
||||||
ret = _sol_getmntent(fp, (struct mnttab *)mp);
|
ret = _sol_getmntent(fp, (struct mnttab *)mp);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
|
#ifdef HAVE_STATX_MNT_ID
|
||||||
|
struct statx stx;
|
||||||
|
if (statx(AT_FDCWD, mp->mnt_mountp,
|
||||||
|
AT_STATX_SYNC_AS_STAT | AT_SYMLINK_NOFOLLOW,
|
||||||
|
STATX_MNT_ID, &stx) == 0 && (stx.stx_mask & STATX_MNT_ID))
|
||||||
|
*mnt_id = stx.stx_mnt_id;
|
||||||
|
#endif
|
||||||
if (stat64(mp->mnt_mountp, &st) != 0) {
|
if (stat64(mp->mnt_mountp, &st) != 0) {
|
||||||
mp->mnt_major = 0;
|
mp->mnt_major = 0;
|
||||||
mp->mnt_minor = 0;
|
mp->mnt_minor = 0;
|
||||||
@@ -110,6 +118,12 @@ getextmntent(const char *path, struct extmnttab *entry, struct stat64 *statbuf)
|
|||||||
struct stat64 st;
|
struct stat64 st;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int match;
|
int match;
|
||||||
|
boolean_t have_mnt_id = B_FALSE;
|
||||||
|
uint64_t target_mnt_id = 0;
|
||||||
|
uint64_t entry_mnt_id;
|
||||||
|
#ifdef HAVE_STATX_MNT_ID
|
||||||
|
struct statx stx;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (strlen(path) >= MAXPATHLEN) {
|
if (strlen(path) >= MAXPATHLEN) {
|
||||||
(void) fprintf(stderr, "invalid object; pathname too long\n");
|
(void) fprintf(stderr, "invalid object; pathname too long\n");
|
||||||
@@ -128,6 +142,13 @@ getextmntent(const char *path, struct extmnttab *entry, struct stat64 *statbuf)
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_STATX_MNT_ID
|
||||||
|
if (statx(AT_FDCWD, path, AT_STATX_SYNC_AS_STAT | AT_SYMLINK_NOFOLLOW,
|
||||||
|
STATX_MNT_ID, &stx) == 0 && (stx.stx_mask & STATX_MNT_ID)) {
|
||||||
|
have_mnt_id = B_TRUE;
|
||||||
|
target_mnt_id = stx.stx_mnt_id;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((fp = fopen(MNTTAB, "re")) == NULL) {
|
if ((fp = fopen(MNTTAB, "re")) == NULL) {
|
||||||
(void) fprintf(stderr, "cannot open %s\n", MNTTAB);
|
(void) fprintf(stderr, "cannot open %s\n", MNTTAB);
|
||||||
@@ -139,12 +160,15 @@ getextmntent(const char *path, struct extmnttab *entry, struct stat64 *statbuf)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
match = 0;
|
match = 0;
|
||||||
while (getextmntent_impl(fp, entry) == 0) {
|
while (getextmntent_impl(fp, entry, &entry_mnt_id) == 0) {
|
||||||
if (makedev(entry->mnt_major, entry->mnt_minor) ==
|
if (have_mnt_id) {
|
||||||
statbuf->st_dev) {
|
match = (entry_mnt_id == target_mnt_id);
|
||||||
match = 1;
|
} else {
|
||||||
break;
|
match = makedev(entry->mnt_major, entry->mnt_minor) ==
|
||||||
|
statbuf->st_dev;
|
||||||
}
|
}
|
||||||
|
if (match)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
(void) fclose(fp);
|
(void) fclose(fp);
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user