mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-26 20:12:44 +00:00
zfs: merge openzfs/zfs@b10992582
Notable upstream pull request merges: #9416 -multiple zio_compress: introduce max size threshold #10018a10e552b9
Adding Direct IO Support #15147e419a63bf
xattr dataset prop: change defaults to sa #154547e957fde7
send/recv: open up additional stream feature flags #158100d77e738e
Defer resilver only when progress is above a threshold #159213cf2bfa57
Allocate zap_attribute_t from kmem instead of stack #16483 -multiple dmu_objset: replace dnode_hash impl with cityhash4 #164858be2f4c3d
zio_resume: log when unsuspending the pool #1649188433e640
sys/types32.h: Remove struct timeval32 from libspl header #16496f245541e2
zfs_file: implement zfs_file_deallocate for FreeBSD 14 #16511308f7c2f1
Fix an uninitialized data access #1652929c9e6c32
Fix handling of DNS names with '-' in them for sharenfs #16531ddf5f34f0
Avoid fault diagnosis if multiple vdevs have errors #165396f50f8e16
zfs_log: add flex array fields to log record structs #16546d40d40913
Evicting too many bytes from MFU metadata #165513014dcb76
Reduce and handle EAGAIN errors on AIO label reads #1655480645d658
FreeBSD: restore zfs_znode_update_vfs() #16565832f66b21
FreeBSD: Sync taskq_cancel_id() returns with Linux #1656748d1be254
Properly release key in spa_keystore_dsl_key_hold_dd() #16569141368a4b
Restrict raidz faulted vdev count #16583c84a37ae9
lua: add flex array field to TString type #1658486737c592
Avoid computing strlen() inside loops #16587d34d4f97a
snapdir: add 'disabled' value to make .zfs inaccessible #16593224393a32
feature: large_microzap #16597412105977
Temporarily disable Direct IO by default #166054ebe674d9
ARC: Cache arc_c value during arc_evict() Backported pull request merges: #16613ab777f436
Return boolean_t in inline functions of lib/libspl/include/sys/uio.h #16616efeb60b86
FreeBSD: ignore some includes when not building kernel #16635 ---TBD--- zdb: fix printf format in dump_zap() Obtained from: OpenZFS OpenZFS commit:b109925820
OpenZFS tag: 2.3.0-rc1
This commit is contained in:
commit
7a7741af18
@ -14,6 +14,7 @@ CSTD= c99
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzpool/include
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs
|
||||
CFLAGS+= -I${SRCTOP}/sys
|
||||
CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
|
||||
|
@ -20,6 +20,7 @@ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzfs_core/common
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzpool/include
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs
|
||||
CFLAGS+= -I${SRCTOP}/sys
|
||||
CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
|
||||
|
@ -21,6 +21,7 @@ CFLAGS+= -DIN_BASE
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzpool/include
|
||||
CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include
|
||||
CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
|
||||
|
@ -14,8 +14,6 @@ ZFSTOP= ${SRCTOP}/sys/contrib/openzfs
|
||||
.PATH: ${ZFSTOP}/module/zstd/lib/compress
|
||||
.PATH: ${ZFSTOP}/module/zstd/lib/decompress
|
||||
|
||||
.PATH: ${ZFSTOP}/module/os/linux/zfs
|
||||
|
||||
.if exists(${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S)
|
||||
.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}
|
||||
ATOMIC_SRCS= opensolaris_atomic.S
|
||||
@ -34,12 +32,16 @@ PACKAGE= zfs
|
||||
LIB= zpool
|
||||
|
||||
USER_C = \
|
||||
abd_os.c \
|
||||
arc_os.c \
|
||||
kernel.c \
|
||||
taskq.c \
|
||||
util.c
|
||||
util.c \
|
||||
zfs_debug.c
|
||||
|
||||
.PATH: ${ZFSTOP}/module/os/linux/zfs
|
||||
|
||||
KERNEL_C = \
|
||||
simd_stat.c \
|
||||
zfeature_common.c \
|
||||
zfs_comutil.c \
|
||||
zfs_deleg.c \
|
||||
@ -52,9 +54,9 @@ KERNEL_C = \
|
||||
zpool_prop.c \
|
||||
zprop_common.c \
|
||||
abd.c \
|
||||
abd_os.c \
|
||||
aggsum.c \
|
||||
arc.c \
|
||||
arc_os.c \
|
||||
blake3_zfs.c \
|
||||
blkptr.c \
|
||||
bplist.c \
|
||||
@ -72,6 +74,7 @@ KERNEL_C = \
|
||||
ddt_zap.c \
|
||||
dmu.c \
|
||||
dmu_diff.c \
|
||||
dmu_direct.c \
|
||||
dmu_object.c \
|
||||
dmu_objset.c \
|
||||
dmu_recv.c \
|
||||
@ -172,7 +175,6 @@ KERNEL_C = \
|
||||
zfeature.c \
|
||||
zfs_byteswap.c \
|
||||
zfs_chksum.c \
|
||||
zfs_debug.c \
|
||||
zfs_fm.c \
|
||||
zfs_fuid.c \
|
||||
zfs_sa.c \
|
||||
@ -248,7 +250,8 @@ LUA_C = \
|
||||
|
||||
UNICODE_C = u8_textprep.c uconv.c
|
||||
|
||||
SRCS= ${USER_C} ${KERNEL_C} ${LUA_C} ${UNICODE_C} ${ARCH_C}
|
||||
SRCS+= ${USER_C} ${KERNEL_C} ${LUA_C} ${UNICODE_C} ${ARCH_C}
|
||||
|
||||
|
||||
WARNS?= 2
|
||||
CFLAGS+= \
|
||||
@ -261,6 +264,7 @@ CFLAGS+= \
|
||||
-I${ZFSTOP}/include/os/freebsd/zfs \
|
||||
-I${SRCTOP}/cddl/compat/opensolaris/include \
|
||||
-I${ZFSTOP}/module/icp/include \
|
||||
-I${SRCTOP}/compat/linuxkpi/common/include/linux \
|
||||
-include ${ZFSTOP}/include/os/freebsd/spl/sys/ccompile.h \
|
||||
-DHAVE_ISSETUGID \
|
||||
-include ${SRCTOP}/sys/modules/zfs/zfs_config.h \
|
||||
|
@ -28,6 +28,7 @@ CSTD= c99
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzpool/include
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs
|
||||
CFLAGS+= -I${SRCTOP}/sys
|
||||
CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
|
||||
|
@ -16,6 +16,7 @@ CFLAGS+= -DIN_BASE
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzpool/include
|
||||
CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
|
||||
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include
|
||||
CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
|
||||
|
@ -13,7 +13,8 @@ FILES= \
|
||||
freebsd-11.2 \
|
||||
freebsd-11.3 \
|
||||
freenas-9.10.2 \
|
||||
grub2 \
|
||||
grub2-2.06 \
|
||||
grub2-2.12 \
|
||||
openzfsonosx-1.7.0 \
|
||||
openzfsonosx-1.8.1 \
|
||||
openzfsonosx-1.9.3 \
|
||||
@ -22,6 +23,7 @@ FILES= \
|
||||
openzfs-2.1-freebsd \
|
||||
openzfs-2.1-linux \
|
||||
openzfs-2.2 \
|
||||
openzfs-2.3 \
|
||||
zol-0.6.1 \
|
||||
zol-0.6.4 \
|
||||
zol-0.6.5 \
|
||||
@ -46,13 +48,19 @@ LINKS= \
|
||||
${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-12.4 \
|
||||
${FILESDIR}/freebsd-11.3 ${FILESDIR}/freenas-11.3 \
|
||||
${FILESDIR}/freenas-11.0 ${FILESDIR}/freenas-11.1 \
|
||||
${FILESDIR}/grub2-2.12 ${FILESDIR}/grub2 \
|
||||
${FILESDIR}/openzfsonosx-1.9.3 ${FILESDIR}/openzfsonosx-1.9.4 \
|
||||
${FILESDIR}/openzfs-2.0-freebsd ${FILESDIR}/truenas-12.0 \
|
||||
${FILESDIR}/openzfs-2.1-freebsd ${FILESDIR}/freebsd-13.0 \
|
||||
${FILESDIR}/openzfs-2.1-freebsd ${FILESDIR}/freebsd-13.1 \
|
||||
${FILESDIR}/openzfs-2.1-freebsd ${FILESDIR}/freebsd-13.2 \
|
||||
${FILESDIR}/zol-0.7 ${FILESDIR}/ubuntu-18.04 \
|
||||
${FILESDIR}/zol-0.8 ${FILESDIR}/ubuntu-20.04 \
|
||||
${FILESDIR}/openzfs-2.1-linux ${FILESDIR}/ubuntu-22.04 \
|
||||
${FILESDIR}/openzfs-2.2 ${FILESDIR}/openzfs-2.2-linux \
|
||||
${FILESDIR}/openzfs-2.2 ${FILESDIR}/openzfs-2.2-freebsd
|
||||
${FILESDIR}/openzfs-2.2 ${FILESDIR}/openzfs-2.2-freebsd \
|
||||
${FILESDIR}/openzfs-2.3 ${FILESDIR}/openzfs-2.3-linux \
|
||||
${FILESDIR}/openzfs-2.3 ${FILESDIR}/openzfs-2.3-freebsd
|
||||
|
||||
LINKMODE= ${NOBINMODE}
|
||||
|
||||
|
@ -76,7 +76,7 @@ CFLAGS.$i+= -U__BMI__ ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
|
||||
|
||||
CFLAGS.zfs_zstd.c+= -DIN_BASE -DIN_LIBSA
|
||||
|
||||
CFLAGS.blake3_impl.c+= -I${OZFS}/module/icp/algs/blake3 -I${OZFS}/module/icp/include
|
||||
CFLAGS.blake3_impl.c+= -I${OZFS}/module/icp/algs/blake3 -I${OZFS}/module/icp/include -DIN_LIBSA
|
||||
|
||||
# Do not unroll skein loops, reduce code size
|
||||
CFLAGS.skein_block.c+= -DSKEIN_LOOP=111
|
||||
|
@ -220,7 +220,7 @@ contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_os.c optional zfs compile-with
|
||||
contrib/openzfs/module/os/freebsd/zfs/zfs_racct.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/os/freebsd/zfs/zfs_znode_os.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/os/freebsd/zfs/zvol_os.c optional zfs compile-with "${ZFS_C}"
|
||||
|
||||
@ -275,6 +275,7 @@ contrib/openzfs/module/zfs/ddt_log.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/zfs/ddt_stats.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/zfs/ddt_zap.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/zfs/dmu.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/zfs/dmu_direct.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/zfs/dmu_diff.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/zfs/dmu_object.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/zfs/dmu_objset.c optional zfs compile-with "${ZFS_C}"
|
||||
@ -371,6 +372,7 @@ contrib/openzfs/module/zfs/zfs_replay.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/zfs/zfs_rlock.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/zfs/zfs_sa.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/zfs/zfs_vnops.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/zfs/zfs_znode.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/zstd/zfs_zstd.c optional zfs zstdio compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/zfs/zil.c optional zfs compile-with "${ZFS_C}"
|
||||
contrib/openzfs/module/zfs/zio.c optional zfs compile-with "${ZFS_C}"
|
||||
|
18
sys/contrib/openzfs/.github/CONTRIBUTING.md
vendored
18
sys/contrib/openzfs/.github/CONTRIBUTING.md
vendored
@ -145,22 +145,18 @@ Once everything is in good shape and the details have been worked out you can re
|
||||
Any required reviews can then be finalized and the pull request merged.
|
||||
|
||||
#### Tests and Benchmarks
|
||||
* Every pull request will by tested by the buildbot on multiple platforms by running the [zfs-tests.sh and zloop.sh](
|
||||
* Every pull request is tested using a GitHub Actions workflow on multiple platforms by running the [zfs-tests.sh and zloop.sh](
|
||||
https://openzfs.github.io/openzfs-docs/Developer%20Resources/Building%20ZFS.html#running-zloop-sh-and-zfs-tests-sh) test suites.
|
||||
`.github/workflows/scripts/generate-ci-type.py` is used to determine whether the pull request is nonbehavior, i.e., not introducing behavior changes of any code, configuration or tests. If so, the CI will run on fewer platforms and only essential sanity tests will run. You can always override this by adding `ZFS-CI-Type` line to your commit message:
|
||||
* If your last commit (or `HEAD` in git terms) contains a line `ZFS-CI-Type: quick`, quick mode is forced regardless of what files are changed.
|
||||
* Otherwise, if any commit in a PR contains a line `ZFS-CI-Type: full`, full mode is forced.
|
||||
* To verify your changes conform to the [style guidelines](
|
||||
https://github.com/openzfs/zfs/blob/master/.github/CONTRIBUTING.md#style-guides
|
||||
), please run `make checkstyle` and resolve any warnings.
|
||||
* Static code analysis of each pull request is performed by the buildbot; run `make lint` to check your changes.
|
||||
* Test cases should be provided when appropriate.
|
||||
This includes making sure new features have adequate code coverage.
|
||||
* Code analysis is performed by [CodeQL](https://codeql.github.com/) for each pull request.
|
||||
* Test cases should be provided when appropriate. This includes making sure new features have adequate code coverage.
|
||||
* If your pull request improves performance, please include some benchmarks.
|
||||
* The pull request must pass all required [ZFS
|
||||
Buildbot](http://build.zfsonlinux.org/) builders before
|
||||
being accepted. If you are experiencing intermittent TEST
|
||||
builder failures, you may be experiencing a [test suite
|
||||
issue](https://github.com/openzfs/zfs/issues?q=is%3Aissue+is%3Aopen+label%3A%22Type%3A+Test+Suite%22).
|
||||
There are also various [buildbot options](https://openzfs.github.io/openzfs-docs/Developer%20Resources/Buildbot%20Options.html)
|
||||
to control how changes are tested.
|
||||
* The pull request must pass all CI checks before being accepted.
|
||||
|
||||
### Testing
|
||||
All help is appreciated! If you're in a position to run the latest code
|
||||
|
@ -1,57 +0,0 @@
|
||||
acl
|
||||
alien
|
||||
attr
|
||||
autoconf
|
||||
bc
|
||||
build-essential
|
||||
curl
|
||||
dbench
|
||||
debhelper-compat
|
||||
dh-python
|
||||
dkms
|
||||
fakeroot
|
||||
fio
|
||||
gdb
|
||||
gdebi
|
||||
git
|
||||
ksh
|
||||
lcov
|
||||
libacl1-dev
|
||||
libaio-dev
|
||||
libattr1-dev
|
||||
libblkid-dev
|
||||
libcurl4-openssl-dev
|
||||
libdevmapper-dev
|
||||
libelf-dev
|
||||
libffi-dev
|
||||
libmount-dev
|
||||
libpam0g-dev
|
||||
libselinux1-dev
|
||||
libssl-dev
|
||||
libtool
|
||||
libudev-dev
|
||||
linux-headers-generic
|
||||
lsscsi
|
||||
mdadm
|
||||
nfs-kernel-server
|
||||
pamtester
|
||||
parted
|
||||
po-debconf
|
||||
python3
|
||||
python3-all-dev
|
||||
python3-cffi
|
||||
python3-dev
|
||||
python3-packaging
|
||||
python3-pip
|
||||
python3-setuptools
|
||||
python3-sphinx
|
||||
rng-tools-debian
|
||||
rsync
|
||||
samba
|
||||
sysstat
|
||||
uuid-dev
|
||||
watchdog
|
||||
wget
|
||||
xfslibs-dev
|
||||
xz-utils
|
||||
zlib1g-dev
|
@ -1,5 +0,0 @@
|
||||
cppcheck
|
||||
devscripts
|
||||
mandoc
|
||||
pax-utils
|
||||
shellcheck
|
@ -4,6 +4,10 @@ on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
checkstyle:
|
||||
runs-on: ubuntu-22.04
|
||||
@ -13,15 +17,11 @@ jobs:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
# https://github.com/orgs/community/discussions/47863
|
||||
sudo apt-mark hold grub-efi-amd64-signed
|
||||
sudo apt-get update --fix-missing
|
||||
sudo apt-get upgrade
|
||||
sudo xargs --arg-file=${{ github.workspace }}/.github/workflows/build-dependencies.txt apt-get install -qq
|
||||
sudo xargs --arg-file=${{ github.workspace }}/.github/workflows/checkstyle-dependencies.txt apt-get install -qq
|
||||
sudo python3 -m pip install --quiet flake8
|
||||
sudo apt-get clean
|
||||
|
||||
# for x in lxd core20 snapd; do sudo snap remove $x; done
|
||||
sudo apt-get purge -y snapd google-chrome-stable firefox
|
||||
ONLY_DEPS=1 .github/workflows/scripts/qemu-3-deps.sh ubuntu22
|
||||
sudo apt-get install -y cppcheck devscripts mandoc pax-utils shellcheck
|
||||
sudo python -m pipx install --quiet flake8
|
||||
# confirm that the tools are installed
|
||||
# the build system doesn't fail when they are not
|
||||
checkbashisms --version
|
||||
@ -31,8 +31,13 @@ jobs:
|
||||
shellcheck --version
|
||||
- name: Prepare
|
||||
run: |
|
||||
sed -i '/DEBUG_CFLAGS="-Werror"/s/^/#/' config/zfs-build.m4
|
||||
./autogen.sh
|
||||
- name: Configure
|
||||
run: |
|
||||
./configure
|
||||
- name: Make
|
||||
run: |
|
||||
make -j$(nproc) --no-print-directory --silent
|
||||
- name: Checkstyle
|
||||
run: |
|
||||
|
10
sys/contrib/openzfs/.github/workflows/codeql.yml
vendored
10
sys/contrib/openzfs/.github/workflows/codeql.yml
vendored
@ -4,6 +4,10 @@ on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
@ -27,15 +31,15 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
config-file: .github/codeql-${{ matrix.language }}.yml
|
||||
languages: ${{ matrix.language }}
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
|
14
sys/contrib/openzfs/.github/workflows/scripts/README.md
vendored
Normal file
14
sys/contrib/openzfs/.github/workflows/scripts/README.md
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
Workflow for each operating system:
|
||||
- install qemu on the github runner
|
||||
- download current cloud image of operating system
|
||||
- start and init that image via cloud-init
|
||||
- install dependencies and poweroff system
|
||||
- start system and build openzfs and then poweroff again
|
||||
- clone build system and start 2 instances of it
|
||||
- run functional testings and complete in around 3h
|
||||
- when tests are done, do some logfile preparing
|
||||
- show detailed results for each system
|
||||
- in the end, generate the job summary
|
||||
|
||||
/TR 14.09.2024
|
107
sys/contrib/openzfs/.github/workflows/scripts/generate-ci-type.py
vendored
Executable file
107
sys/contrib/openzfs/.github/workflows/scripts/generate-ci-type.py
vendored
Executable file
@ -0,0 +1,107 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
Determine the CI type based on the change list and commit message.
|
||||
|
||||
Prints "quick" if (explicity required by user):
|
||||
- the *last* commit message contains 'ZFS-CI-Type: quick'
|
||||
or if (heuristics):
|
||||
- the files changed are not in the list of specified directories, and
|
||||
- all commit messages do not contain 'ZFS-CI-Type: full'
|
||||
|
||||
Otherwise prints "full".
|
||||
"""
|
||||
|
||||
import sys
|
||||
import subprocess
|
||||
import re
|
||||
|
||||
"""
|
||||
Patterns of files that are not considered to trigger full CI.
|
||||
Note: not using pathlib.Path.match() because it does not support '**'
|
||||
"""
|
||||
FULL_RUN_IGNORE_REGEX = list(map(re.compile, [
|
||||
r'.*\.md',
|
||||
r'.*\.gitignore'
|
||||
]))
|
||||
|
||||
"""
|
||||
Patterns of files that are considered to trigger full CI.
|
||||
"""
|
||||
FULL_RUN_REGEX = list(map(re.compile, [
|
||||
r'cmd.*',
|
||||
r'configs/.*',
|
||||
r'META',
|
||||
r'.*\.am',
|
||||
r'.*\.m4',
|
||||
r'autogen\.sh',
|
||||
r'configure\.ac',
|
||||
r'copy-builtin',
|
||||
r'contrib',
|
||||
r'etc',
|
||||
r'include',
|
||||
r'lib/.*',
|
||||
r'module/.*',
|
||||
r'scripts/.*',
|
||||
r'tests/.*',
|
||||
r'udev/.*'
|
||||
]))
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
prog = sys.argv[0]
|
||||
|
||||
if len(sys.argv) != 3:
|
||||
print(f'Usage: {prog} <head_ref> <base_ref>')
|
||||
sys.exit(1)
|
||||
|
||||
head, base = sys.argv[1:3]
|
||||
|
||||
def output_type(type, reason):
|
||||
print(f'{prog}: will run {type} CI: {reason}', file=sys.stderr)
|
||||
print(type)
|
||||
sys.exit(0)
|
||||
|
||||
# check last (HEAD) commit message
|
||||
last_commit_message_raw = subprocess.run([
|
||||
'git', 'show', '-s', '--format=%B', 'HEAD'
|
||||
], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
|
||||
for line in last_commit_message_raw.stdout.decode().splitlines():
|
||||
if line.strip().lower() == 'zfs-ci-type: quick':
|
||||
output_type('quick', f'explicitly requested by HEAD commit {head}')
|
||||
|
||||
# check all commit messages
|
||||
all_commit_message_raw = subprocess.run([
|
||||
'git', 'show', '-s',
|
||||
'--format=ZFS-CI-Commit: %H%n%B', f'{head}...{base}'
|
||||
], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
all_commit_message = all_commit_message_raw.stdout.decode().splitlines()
|
||||
|
||||
commit_ref = head
|
||||
for line in all_commit_message:
|
||||
if line.startswith('ZFS-CI-Commit:'):
|
||||
commit_ref = line.lstrip('ZFS-CI-Commit:').rstrip()
|
||||
if line.strip().lower() == 'zfs-ci-type: full':
|
||||
output_type('full', f'explicitly requested by commit {commit_ref}')
|
||||
|
||||
# check changed files
|
||||
changed_files_raw = subprocess.run([
|
||||
'git', 'diff', '--name-only', head, base
|
||||
], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
changed_files = changed_files_raw.stdout.decode().splitlines()
|
||||
|
||||
for f in changed_files:
|
||||
for r in FULL_RUN_IGNORE_REGEX:
|
||||
if r.match(f):
|
||||
break
|
||||
else:
|
||||
for r in FULL_RUN_REGEX:
|
||||
if r.match(f):
|
||||
output_type(
|
||||
'full',
|
||||
f'changed file "{f}" matches pattern "{r.pattern}"'
|
||||
)
|
||||
|
||||
# catch-all
|
||||
output_type('quick', 'no changed file matches full CI patterns')
|
@ -1,119 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# for runtime reasons we split functional testings into N parts
|
||||
# - use a define to check for missing tarfiles
|
||||
FUNCTIONAL_PARTS="4"
|
||||
|
||||
ZTS_REPORT="tests/test-runner/bin/zts-report.py"
|
||||
chmod +x $ZTS_REPORT
|
||||
|
||||
function output() {
|
||||
echo -e $* >> Summary.md
|
||||
}
|
||||
|
||||
function error() {
|
||||
output ":bangbang: $* :bangbang:\n"
|
||||
}
|
||||
|
||||
# this function generates the real summary
|
||||
# - expects a logfile "log" in current directory
|
||||
function generate() {
|
||||
# we issued some error already
|
||||
test ! -s log && return
|
||||
|
||||
# for overview and zts-report
|
||||
cat log | grep '^Test' > list
|
||||
|
||||
# error details
|
||||
awk '/\[FAIL\]|\[KILLED\]/{ show=1; print; next; }
|
||||
/\[SKIP\]|\[PASS\]/{ show=0; } show' log > err
|
||||
|
||||
# summary of errors
|
||||
if [ -s err ]; then
|
||||
output "<pre>"
|
||||
$ZTS_REPORT --no-maybes ./list >> Summary.md
|
||||
output "</pre>"
|
||||
|
||||
# generate seperate error logfile
|
||||
ERRLOGS=$((ERRLOGS+1))
|
||||
errfile="err-$ERRLOGS.md"
|
||||
echo -e "\n## $headline (debugging)\n" >> $errfile
|
||||
echo "<details><summary>Error Listing - with dmesg and dbgmsg</summary><pre>" >> $errfile
|
||||
dd if=err bs=999k count=1 >> $errfile
|
||||
echo "</pre></details>" >> $errfile
|
||||
else
|
||||
output "All tests passed :thumbsup:"
|
||||
fi
|
||||
|
||||
output "<details><summary>Full Listing</summary><pre>"
|
||||
cat list >> Summary.md
|
||||
output "</pre></details>"
|
||||
|
||||
# remove tmp files
|
||||
rm -f err list log
|
||||
}
|
||||
|
||||
# check tarfiles and untar
|
||||
function check_tarfile() {
|
||||
if [ -f "$1" ]; then
|
||||
tar xf "$1" || error "Tarfile $1 returns some error"
|
||||
else
|
||||
error "Tarfile $1 not found"
|
||||
fi
|
||||
}
|
||||
|
||||
# check logfile and concatenate test results
|
||||
function check_logfile() {
|
||||
if [ -f "$1" ]; then
|
||||
cat "$1" >> log
|
||||
else
|
||||
error "Logfile $1 not found"
|
||||
fi
|
||||
}
|
||||
|
||||
# sanity
|
||||
function summarize_s() {
|
||||
headline="$1"
|
||||
output "\n## $headline\n"
|
||||
rm -rf testfiles
|
||||
check_tarfile "$2/sanity.tar"
|
||||
check_logfile "testfiles/log"
|
||||
generate
|
||||
}
|
||||
|
||||
# functional
|
||||
function summarize_f() {
|
||||
headline="$1"
|
||||
output "\n## $headline\n"
|
||||
rm -rf testfiles
|
||||
for i in $(seq 1 $FUNCTIONAL_PARTS); do
|
||||
tarfile="$2-part$i/part$i.tar"
|
||||
check_tarfile "$tarfile"
|
||||
check_logfile "testfiles/log"
|
||||
done
|
||||
generate
|
||||
}
|
||||
|
||||
# https://docs.github.com/en/enterprise-server@3.6/actions/using-workflows/workflow-commands-for-github-actions#step-isolation-and-limits
|
||||
# Job summaries are isolated between steps and each step is restricted to a maximum size of 1MiB.
|
||||
# [ ] can not show all error findings here
|
||||
# [x] split files into smaller ones and create additional steps
|
||||
|
||||
ERRLOGS=0
|
||||
if [ ! -f Summary/Summary.md ]; then
|
||||
# first call, we do the default summary (~500k)
|
||||
echo -n > Summary.md
|
||||
summarize_s "Sanity Tests Ubuntu 20.04" Logs-20.04-sanity
|
||||
summarize_s "Sanity Tests Ubuntu 22.04" Logs-22.04-sanity
|
||||
summarize_f "Functional Tests Ubuntu 20.04" Logs-20.04-functional
|
||||
summarize_f "Functional Tests Ubuntu 22.04" Logs-22.04-functional
|
||||
|
||||
cat Summary.md >> $GITHUB_STEP_SUMMARY
|
||||
mkdir -p Summary
|
||||
mv *.md Summary
|
||||
else
|
||||
# here we get, when errors where returned in first call
|
||||
test -f Summary/err-$1.md && cat Summary/err-$1.md >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
||||
exit 0
|
109
sys/contrib/openzfs/.github/workflows/scripts/merge_summary.awk
vendored
Executable file
109
sys/contrib/openzfs/.github/workflows/scripts/merge_summary.awk
vendored
Executable file
@ -0,0 +1,109 @@
|
||||
#!/bin/awk -f
|
||||
#
|
||||
# Merge multiple ZTS tests results summaries into a single summary. This is
|
||||
# needed when you're running different parts of ZTS on different tests
|
||||
# runners or VMs.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# ./merge_summary.awk summary1.txt [summary2.txt] [summary3.txt] ...
|
||||
#
|
||||
# or:
|
||||
#
|
||||
# cat summary*.txt | ./merge_summary.awk
|
||||
#
|
||||
BEGIN {
|
||||
i=-1
|
||||
pass=0
|
||||
fail=0
|
||||
skip=0
|
||||
state=""
|
||||
cl=0
|
||||
el=0
|
||||
upl=0
|
||||
ul=0
|
||||
|
||||
# Total seconds of tests runtime
|
||||
total=0;
|
||||
}
|
||||
|
||||
# Skip empty lines
|
||||
/^\s*$/{next}
|
||||
|
||||
# Skip Configuration and Test lines
|
||||
/^Test:/{state=""; next}
|
||||
/Configuration/{state="";next}
|
||||
|
||||
# When we see "test-runner.py" stop saving config lines, and
|
||||
# save test runner lines
|
||||
/test-runner.py/{state="testrunner"; runner=runner$0"\n"; next}
|
||||
|
||||
# We need to differentiate the PASS counts from test result lines that start
|
||||
# with PASS, like:
|
||||
#
|
||||
# PASS mv_files/setup
|
||||
#
|
||||
# Use state="pass_count" to differentiate
|
||||
#
|
||||
/Results Summary/{state="pass_count"; next}
|
||||
/PASS/{ if (state=="pass_count") {pass += $2}}
|
||||
/FAIL/{ if (state=="pass_count") {fail += $2}}
|
||||
/SKIP/{ if (state=="pass_count") {skip += $2}}
|
||||
/Running Time/{
|
||||
state="";
|
||||
running[i]=$3;
|
||||
split($3, arr, ":")
|
||||
total += arr[1] * 60 * 60;
|
||||
total += arr[2] * 60;
|
||||
total += arr[3]
|
||||
next;
|
||||
}
|
||||
|
||||
/Tests with results other than PASS that are expected/{state="expected_lines"; next}
|
||||
/Tests with result of PASS that are unexpected/{state="unexpected_pass_lines"; next}
|
||||
/Tests with results other than PASS that are unexpected/{state="unexpected_lines"; next}
|
||||
{
|
||||
if (state == "expected_lines") {
|
||||
expected_lines[el] = $0
|
||||
el++
|
||||
}
|
||||
|
||||
if (state == "unexpected_pass_lines") {
|
||||
unexpected_pass_lines[upl] = $0
|
||||
upl++
|
||||
}
|
||||
if (state == "unexpected_lines") {
|
||||
unexpected_lines[ul] = $0
|
||||
ul++
|
||||
}
|
||||
}
|
||||
|
||||
# Reproduce summary
|
||||
END {
|
||||
print runner;
|
||||
print "\nResults Summary"
|
||||
print "PASS\t"pass
|
||||
print "FAIL\t"fail
|
||||
print "SKIP\t"skip
|
||||
print ""
|
||||
print "Running Time:\t"strftime("%T", total, 1)
|
||||
if (pass+fail+skip > 0) {
|
||||
percent_passed=(pass/(pass+fail+skip) * 100)
|
||||
}
|
||||
printf "Percent passed:\t%3.2f%", percent_passed
|
||||
|
||||
print "\n\nTests with results other than PASS that are expected:"
|
||||
asort(expected_lines, sorted)
|
||||
for (j in sorted)
|
||||
print sorted[j]
|
||||
|
||||
print "\n\nTests with result of PASS that are unexpected:"
|
||||
asort(unexpected_pass_lines, sorted)
|
||||
for (j in sorted)
|
||||
print sorted[j]
|
||||
|
||||
print "\n\nTests with results other than PASS that are unexpected:"
|
||||
asort(unexpected_lines, sorted)
|
||||
for (j in sorted)
|
||||
print sorted[j]
|
||||
}
|
91
sys/contrib/openzfs/.github/workflows/scripts/qemu-1-setup.sh
vendored
Executable file
91
sys/contrib/openzfs/.github/workflows/scripts/qemu-1-setup.sh
vendored
Executable file
@ -0,0 +1,91 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
######################################################################
|
||||
# 1) setup qemu instance on action runner
|
||||
######################################################################
|
||||
|
||||
set -eu
|
||||
|
||||
# install needed packages
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
sudo apt-get -y update
|
||||
sudo apt-get install -y axel cloud-image-utils daemonize guestfs-tools \
|
||||
ksmtuned virt-manager linux-modules-extra-$(uname -r) zfsutils-linux
|
||||
|
||||
# generate ssh keys
|
||||
rm -f ~/.ssh/id_ed25519
|
||||
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -q -N ""
|
||||
|
||||
# we expect RAM shortage
|
||||
cat << EOF | sudo tee /etc/ksmtuned.conf > /dev/null
|
||||
# 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=10
|
||||
KSM_NPAGES_BOOST=300
|
||||
KSM_NPAGES_DECAY=-50
|
||||
KSM_NPAGES_MIN=64
|
||||
KSM_NPAGES_MAX=2048
|
||||
|
||||
KSM_THRES_COEF=25
|
||||
KSM_THRES_CONST=2048
|
||||
|
||||
LOGFILE=/var/log/ksmtuned.log
|
||||
DEBUG=1
|
||||
EOF
|
||||
sudo systemctl restart ksm
|
||||
sudo systemctl restart ksmtuned
|
||||
|
||||
# not needed
|
||||
sudo systemctl stop docker.socket
|
||||
sudo systemctl stop multipathd.socket
|
||||
|
||||
# remove default swapfile and /mnt
|
||||
sudo swapoff -a
|
||||
sudo umount -l /mnt
|
||||
DISK="/dev/disk/cloud/azure_resource-part1"
|
||||
sudo sed -e "s|^$DISK.*||g" -i /etc/fstab
|
||||
sudo wipefs -aq $DISK
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
sudo modprobe loop
|
||||
sudo modprobe zfs
|
||||
|
||||
# partition the disk as needed
|
||||
DISK="/dev/disk/cloud/azure_resource"
|
||||
sudo sgdisk --zap-all $DISK
|
||||
sudo sgdisk -p \
|
||||
-n 1:0:+16G -c 1:"swap" \
|
||||
-n 2:0:0 -c 2:"tests" \
|
||||
$DISK
|
||||
sync
|
||||
sleep 1
|
||||
|
||||
# swap with same size as RAM
|
||||
sudo mkswap $DISK-part1
|
||||
sudo swapon $DISK-part1
|
||||
|
||||
# 60GB data disk
|
||||
SSD1="$DISK-part2"
|
||||
|
||||
# 10GB data disk on ext4
|
||||
sudo fallocate -l 10G /test.ssd1
|
||||
SSD2=$(sudo losetup -b 4096 -f /test.ssd1 --show)
|
||||
|
||||
# adjust zfs module parameter and create pool
|
||||
exec 1>/dev/null
|
||||
ARC_MIN=$((1024*1024*256))
|
||||
ARC_MAX=$((1024*1024*512))
|
||||
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 1 | sudo tee /sys/module/zfs/parameters/zvol_use_blk_mq
|
||||
sudo zpool create -f -o ashift=12 zpool $SSD1 $SSD2 \
|
||||
-O relatime=off -O atime=off -O xattr=sa -O compression=lz4 \
|
||||
-O mountpoint=/mnt/tests
|
||||
|
||||
# no need for some scheduler
|
||||
for i in /sys/block/s*/queue/scheduler; do
|
||||
echo "none" | sudo tee $i > /dev/null
|
||||
done
|
213
sys/contrib/openzfs/.github/workflows/scripts/qemu-2-start.sh
vendored
Executable file
213
sys/contrib/openzfs/.github/workflows/scripts/qemu-2-start.sh
vendored
Executable file
@ -0,0 +1,213 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
######################################################################
|
||||
# 2) start qemu with some operating system, init via cloud-init
|
||||
######################################################################
|
||||
|
||||
set -eu
|
||||
|
||||
# short name used in zfs-qemu.yml
|
||||
OS="$1"
|
||||
|
||||
# OS variant (virt-install --os-variant list)
|
||||
OSv=$OS
|
||||
|
||||
# compressed with .zst extension
|
||||
REPO="https://github.com/mcmilk/openzfs-freebsd-images"
|
||||
FREEBSD="$REPO/releases/download/v2024-09-16"
|
||||
URLzs=""
|
||||
|
||||
# Ubuntu mirrors
|
||||
#UBMIRROR="https://cloud-images.ubuntu.com"
|
||||
#UBMIRROR="https://mirrors.cloud.tencent.com/ubuntu-cloud-images"
|
||||
UBMIRROR="https://mirror.citrahost.com/ubuntu-cloud-images"
|
||||
|
||||
# default nic model for vm's
|
||||
NIC="virtio"
|
||||
|
||||
case "$OS" in
|
||||
almalinux8)
|
||||
OSNAME="AlmaLinux 8"
|
||||
URL="https://repo.almalinux.org/almalinux/8/cloud/x86_64/images/AlmaLinux-8-GenericCloud-latest.x86_64.qcow2"
|
||||
;;
|
||||
almalinux9)
|
||||
OSNAME="AlmaLinux 9"
|
||||
URL="https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2"
|
||||
;;
|
||||
archlinux)
|
||||
OSNAME="Archlinux"
|
||||
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-stream9)
|
||||
OSNAME="CentOS Stream 9"
|
||||
URL="https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2"
|
||||
;;
|
||||
debian11)
|
||||
OSNAME="Debian 11"
|
||||
URL="https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-amd64.qcow2"
|
||||
;;
|
||||
debian12)
|
||||
OSNAME="Debian 12"
|
||||
URL="https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2"
|
||||
;;
|
||||
fedora39)
|
||||
OSNAME="Fedora 39"
|
||||
OSv="fedora39"
|
||||
URL="https://download.fedoraproject.org/pub/fedora/linux/releases/39/Cloud/x86_64/images/Fedora-Cloud-Base-39-1.5.x86_64.qcow2"
|
||||
;;
|
||||
fedora40)
|
||||
OSNAME="Fedora 40"
|
||||
OSv="fedora39"
|
||||
URL="https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2"
|
||||
;;
|
||||
freebsd13r)
|
||||
OSNAME="FreeBSD 13.4-RELEASE"
|
||||
OSv="freebsd13.0"
|
||||
URLzs="$FREEBSD/amd64-freebsd-13.4-RELEASE.qcow2.zst"
|
||||
BASH="/usr/local/bin/bash"
|
||||
NIC="rtl8139"
|
||||
;;
|
||||
freebsd13)
|
||||
OSNAME="FreeBSD 13.4-STABLE"
|
||||
OSv="freebsd13.0"
|
||||
URLzs="$FREEBSD/amd64-freebsd-13.4-STABLE.qcow2.zst"
|
||||
BASH="/usr/local/bin/bash"
|
||||
NIC="rtl8139"
|
||||
;;
|
||||
freebsd14r)
|
||||
OSNAME="FreeBSD 14.1-RELEASE"
|
||||
OSv="freebsd14.0"
|
||||
URLzs="$FREEBSD/amd64-freebsd-14.1-RELEASE.qcow2.zst"
|
||||
BASH="/usr/local/bin/bash"
|
||||
;;
|
||||
freebsd14)
|
||||
OSNAME="FreeBSD 14.1-STABLE"
|
||||
OSv="freebsd14.0"
|
||||
URLzs="$FREEBSD/amd64-freebsd-14.1-STABLE.qcow2.zst"
|
||||
BASH="/usr/local/bin/bash"
|
||||
;;
|
||||
freebsd15)
|
||||
OSNAME="FreeBSD 15.0-CURRENT"
|
||||
OSv="freebsd14.0"
|
||||
URLzs="$FREEBSD/amd64-freebsd-15.0-CURRENT.qcow2.zst"
|
||||
BASH="/usr/local/bin/bash"
|
||||
;;
|
||||
tumbleweed)
|
||||
OSNAME="openSUSE Tumbleweed"
|
||||
OSv="opensusetumbleweed"
|
||||
MIRROR="http://opensuse-mirror-gce-us.susecloud.net"
|
||||
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)
|
||||
OSNAME="Ubuntu 22.04"
|
||||
OSv="ubuntu22.04"
|
||||
URL="$UBMIRROR/jammy/current/jammy-server-cloudimg-amd64.img"
|
||||
;;
|
||||
ubuntu24)
|
||||
OSNAME="Ubuntu 24.04"
|
||||
OSv="ubuntu24.04"
|
||||
URL="$UBMIRROR/noble/current/noble-server-cloudimg-amd64.img"
|
||||
;;
|
||||
*)
|
||||
echo "Wrong value for OS variable!"
|
||||
exit 111
|
||||
;;
|
||||
esac
|
||||
|
||||
# environment file
|
||||
ENV="/var/tmp/env.txt"
|
||||
echo "ENV=$ENV" >> $ENV
|
||||
|
||||
# result path
|
||||
echo 'RESPATH="/var/tmp/test_results"' >> $ENV
|
||||
|
||||
# FreeBSD 13 has problems with: e1000+virtio
|
||||
echo "NIC=$NIC" >> $ENV
|
||||
|
||||
# freebsd15 -> used in zfs-qemu.yml
|
||||
echo "OS=$OS" >> $ENV
|
||||
|
||||
# freebsd14.0 -> used for virt-install
|
||||
echo "OSv=\"$OSv\"" >> $ENV
|
||||
|
||||
# FreeBSD 15 (Current) -> used for summary
|
||||
echo "OSNAME=\"$OSNAME\"" >> $ENV
|
||||
|
||||
sudo mkdir -p "/mnt/tests"
|
||||
sudo chown -R $(whoami) /mnt/tests
|
||||
|
||||
# we are downloading via axel, curl and wget are mostly slower and
|
||||
# require more return value checking
|
||||
IMG="/mnt/tests/cloudimg.qcow2"
|
||||
if [ ! -z "$URLzs" ]; then
|
||||
echo "Loading image $URLzs ..."
|
||||
time axel -q -o "$IMG.zst" "$URLzs"
|
||||
zstd -q -d --rm "$IMG.zst"
|
||||
else
|
||||
echo "Loading image $URL ..."
|
||||
time axel -q -o "$IMG" "$URL"
|
||||
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..."
|
||||
sudo qemu-img dd -f qcow2 -O raw if=$IMG of=$DISK bs=4M
|
||||
rm -f $IMG
|
||||
|
||||
PUBKEY=$(cat ~/.ssh/id_ed25519.pub)
|
||||
cat <<EOF > /tmp/user-data
|
||||
#cloud-config
|
||||
|
||||
fqdn: $OS
|
||||
|
||||
users:
|
||||
- name: root
|
||||
shell: $BASH
|
||||
- name: zfs
|
||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
||||
shell: $BASH
|
||||
ssh_authorized_keys:
|
||||
- $PUBKEY
|
||||
|
||||
growpart:
|
||||
mode: auto
|
||||
devices: ['/']
|
||||
ignore_growroot_disabled: false
|
||||
EOF
|
||||
|
||||
sudo virsh net-update default add ip-dhcp-host \
|
||||
"<host mac='52:54:00:83:79:00' ip='192.168.122.10'/>" --live --config
|
||||
|
||||
sudo virt-install \
|
||||
--os-variant $OSv \
|
||||
--name "openzfs" \
|
||||
--cpu host-passthrough \
|
||||
--virt-type=kvm --hvm \
|
||||
--vcpus=4,sockets=1 \
|
||||
--memory $((1024*12)) \
|
||||
--memballoon model=virtio \
|
||||
--graphics none \
|
||||
--network bridge=virbr0,model=$NIC,mac='52:54:00:83:79:00' \
|
||||
--cloud-init user-data=/tmp/user-data \
|
||||
--disk $DISK,bus=virtio,cache=none,format=$FORMAT,driver.discard=unmap \
|
||||
--import --noautoconsole >/dev/null
|
||||
|
||||
# in case the directory isn't there already
|
||||
mkdir -p $HOME/.ssh
|
||||
|
||||
cat <<EOF >> $HOME/.ssh/config
|
||||
# no questions please
|
||||
StrictHostKeyChecking no
|
||||
|
||||
# small timeout, used in while loops later
|
||||
ConnectTimeout 1
|
||||
EOF
|
221
sys/contrib/openzfs/.github/workflows/scripts/qemu-3-deps.sh
vendored
Executable file
221
sys/contrib/openzfs/.github/workflows/scripts/qemu-3-deps.sh
vendored
Executable file
@ -0,0 +1,221 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
######################################################################
|
||||
# 3) install dependencies for compiling and loading
|
||||
######################################################################
|
||||
|
||||
set -eu
|
||||
|
||||
function archlinux() {
|
||||
echo "##[group]Running pacman -Syu"
|
||||
sudo btrfs filesystem resize max /
|
||||
sudo pacman -Syu --noconfirm
|
||||
echo "##[endgroup]"
|
||||
|
||||
echo "##[group]Install Development Tools"
|
||||
sudo pacman -Sy --noconfirm base-devel bc cpio dhclient dkms fakeroot \
|
||||
fio gdb inetutils jq less linux linux-headers lsscsi nfs-utils parted \
|
||||
pax perf python-packaging python-setuptools qemu-guest-agent ksh samba \
|
||||
sysstat rng-tools rsync wget xxhash
|
||||
echo "##[endgroup]"
|
||||
}
|
||||
|
||||
function debian() {
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
|
||||
echo "##[group]Running apt-get update+upgrade"
|
||||
sudo apt-get update -y
|
||||
sudo apt-get upgrade -y
|
||||
echo "##[endgroup]"
|
||||
|
||||
echo "##[group]Install Development Tools"
|
||||
sudo apt-get install -y \
|
||||
acl alien attr autoconf bc cpio curl dbench dh-python dkms fakeroot \
|
||||
fio gdb gdebi git ksh lcov isc-dhcp-client jq libacl1-dev libaio-dev \
|
||||
libattr1-dev libblkid-dev libcurl4-openssl-dev libdevmapper-dev libelf-dev \
|
||||
libffi-dev libmount-dev libpam0g-dev libselinux-dev libssl-dev libtool \
|
||||
libtool-bin libudev-dev libunwind-dev linux-headers-$(uname -r) \
|
||||
lsscsi nfs-kernel-server pamtester parted python3 python3-all-dev \
|
||||
python3-cffi python3-dev python3-distlib python3-packaging \
|
||||
python3-setuptools python3-sphinx qemu-guest-agent rng-tools rpm2cpio \
|
||||
rsync samba sysstat uuid-dev watchdog wget xfslibs-dev xxhash zlib1g-dev
|
||||
echo "##[endgroup]"
|
||||
}
|
||||
|
||||
function freebsd() {
|
||||
export ASSUME_ALWAYS_YES="YES"
|
||||
|
||||
echo "##[group]Install Development Tools"
|
||||
sudo pkg install -y autoconf automake autotools base64 checkbashisms fio \
|
||||
gdb gettext gettext-runtime git gmake gsed jq ksh93 lcov libtool lscpu \
|
||||
pkgconf python python3 pamtester pamtester qemu-guest-agent rsync xxhash
|
||||
sudo pkg install -xy \
|
||||
'^samba4[[:digit:]]+$' \
|
||||
'^py3[[:digit:]]+-cffi$' \
|
||||
'^py3[[:digit:]]+-sysctl$' \
|
||||
'^py3[[:digit:]]+-packaging$'
|
||||
echo "##[endgroup]"
|
||||
}
|
||||
|
||||
# common packages for: almalinux, centos, redhat
|
||||
function rhel() {
|
||||
echo "##[group]Running dnf update"
|
||||
echo "max_parallel_downloads=10" | sudo -E tee -a /etc/dnf/dnf.conf
|
||||
sudo dnf clean all
|
||||
sudo dnf update -y --setopt=fastestmirror=1 --refresh
|
||||
echo "##[endgroup]"
|
||||
|
||||
echo "##[group]Install Development Tools"
|
||||
sudo dnf group install -y "Development Tools"
|
||||
sudo dnf install -y \
|
||||
acl attr bc bzip2 curl dbench dkms elfutils-libelf-devel fio gdb git \
|
||||
jq kernel-rpm-macros ksh libacl-devel libaio-devel libargon2-devel \
|
||||
libattr-devel libblkid-devel libcurl-devel libffi-devel ncompress \
|
||||
libselinux-devel libtirpc-devel libtool libudev-devel libuuid-devel \
|
||||
lsscsi mdadm nfs-utils openssl-devel pam-devel pamtester parted perf \
|
||||
python3 python3-cffi python3-devel python3-packaging kernel-devel \
|
||||
python3-setuptools qemu-guest-agent rng-tools rpcgen rpm-build rsync \
|
||||
samba sysstat systemd watchdog wget xfsprogs-devel xxhash zlib-devel
|
||||
echo "##[endgroup]"
|
||||
}
|
||||
|
||||
function tumbleweed() {
|
||||
echo "##[group]Running zypper is TODO!"
|
||||
sleep 23456
|
||||
echo "##[endgroup]"
|
||||
}
|
||||
|
||||
# Install dependencies
|
||||
case "$1" in
|
||||
almalinux8)
|
||||
echo "##[group]Enable epel and powertools repositories"
|
||||
sudo dnf config-manager -y --set-enabled powertools
|
||||
sudo dnf install -y epel-release
|
||||
echo "##[endgroup]"
|
||||
rhel
|
||||
echo "##[group]Install kernel-abi-whitelists"
|
||||
sudo dnf install -y kernel-abi-whitelists
|
||||
echo "##[endgroup]"
|
||||
;;
|
||||
almalinux9|centos-stream9)
|
||||
echo "##[group]Enable epel and crb repositories"
|
||||
sudo dnf config-manager -y --set-enabled crb
|
||||
sudo dnf install -y epel-release
|
||||
echo "##[endgroup]"
|
||||
rhel
|
||||
echo "##[group]Install kernel-abi-stablelists"
|
||||
sudo dnf install -y kernel-abi-stablelists
|
||||
echo "##[endgroup]"
|
||||
;;
|
||||
archlinux)
|
||||
archlinux
|
||||
;;
|
||||
debian*)
|
||||
debian
|
||||
echo "##[group]Install Debian specific"
|
||||
sudo apt-get install -yq linux-perf dh-sequence-dkms
|
||||
echo "##[endgroup]"
|
||||
;;
|
||||
fedora*)
|
||||
rhel
|
||||
;;
|
||||
freebsd*)
|
||||
freebsd
|
||||
;;
|
||||
tumbleweed)
|
||||
tumbleweed
|
||||
;;
|
||||
ubuntu*)
|
||||
debian
|
||||
echo "##[group]Install Ubuntu specific"
|
||||
sudo apt-get install -yq linux-tools-common libtirpc-dev \
|
||||
linux-modules-extra-$(uname -r)
|
||||
if [ "$1" != "ubuntu20" ]; then
|
||||
sudo apt-get install -yq dh-sequence-dkms
|
||||
fi
|
||||
echo "##[endgroup]"
|
||||
echo "##[group]Delete Ubuntu OpenZFS modules"
|
||||
for i in $(find /lib/modules -name zfs -type d); do sudo rm -rvf $i; done
|
||||
echo "##[endgroup]"
|
||||
;;
|
||||
esac
|
||||
|
||||
# This script is used for checkstyle + zloop deps also.
|
||||
# Install only the needed packages and exit - when used this way.
|
||||
test -z "${ONLY_DEPS:-}" || exit 0
|
||||
|
||||
# Start services
|
||||
echo "##[group]Enable services"
|
||||
case "$1" in
|
||||
freebsd*)
|
||||
# add virtio things
|
||||
echo 'virtio_load="YES"' | sudo -E tee -a /boot/loader.conf
|
||||
for i in balloon blk console random scsi; do
|
||||
echo "virtio_${i}_load=\"YES\"" | sudo -E tee -a /boot/loader.conf
|
||||
done
|
||||
echo "fdescfs /dev/fd fdescfs rw 0 0" | sudo -E tee -a /etc/fstab
|
||||
sudo -E mount /dev/fd
|
||||
sudo -E touch /etc/zfs/exports
|
||||
sudo -E sysrc mountd_flags="/etc/zfs/exports"
|
||||
echo '[global]' | sudo -E tee /usr/local/etc/smb4.conf >/dev/null
|
||||
sudo -E service nfsd enable
|
||||
sudo -E service qemu-guest-agent enable
|
||||
sudo -E service samba_server enable
|
||||
;;
|
||||
debian*|ubuntu*)
|
||||
sudo -E systemctl enable nfs-kernel-server
|
||||
sudo -E systemctl enable qemu-guest-agent
|
||||
sudo -E systemctl enable smbd
|
||||
;;
|
||||
*)
|
||||
# All other linux distros
|
||||
sudo -E systemctl enable nfs-server
|
||||
sudo -E systemctl enable qemu-guest-agent
|
||||
sudo -E systemctl enable smb
|
||||
;;
|
||||
esac
|
||||
echo "##[endgroup]"
|
||||
|
||||
# Setup Kernel cmdline
|
||||
CMDLINE="console=tty0 console=ttyS0,115200n8"
|
||||
CMDLINE="$CMDLINE selinux=0"
|
||||
CMDLINE="$CMDLINE random.trust_cpu=on"
|
||||
CMDLINE="$CMDLINE no_timer_check"
|
||||
case "$1" in
|
||||
almalinux*|centos*|fedora*)
|
||||
GRUB_CFG="/boot/grub2/grub.cfg"
|
||||
GRUB_MKCONFIG="grub2-mkconfig"
|
||||
CMDLINE="$CMDLINE biosdevname=0 net.ifnames=0"
|
||||
echo 'GRUB_SERIAL_COMMAND="serial --speed=115200"' \
|
||||
| sudo tee -a /etc/default/grub >/dev/null
|
||||
;;
|
||||
ubuntu24)
|
||||
GRUB_CFG="/boot/grub/grub.cfg"
|
||||
GRUB_MKCONFIG="grub-mkconfig"
|
||||
echo 'GRUB_DISABLE_OS_PROBER="false"' \
|
||||
| sudo tee -a /etc/default/grub >/dev/null
|
||||
;;
|
||||
*)
|
||||
GRUB_CFG="/boot/grub/grub.cfg"
|
||||
GRUB_MKCONFIG="grub-mkconfig"
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$1" in
|
||||
archlinux|freebsd*)
|
||||
true
|
||||
;;
|
||||
*)
|
||||
echo "##[group]Edit kernel cmdline"
|
||||
sudo sed -i -e '/^GRUB_CMDLINE_LINUX/d' /etc/default/grub || true
|
||||
echo "GRUB_CMDLINE_LINUX=\"$CMDLINE\"" \
|
||||
| sudo tee -a /etc/default/grub >/dev/null
|
||||
sudo $GRUB_MKCONFIG -o $GRUB_CFG
|
||||
echo "##[endgroup]"
|
||||
;;
|
||||
esac
|
||||
|
||||
# reset cloud-init configuration and poweroff
|
||||
sudo cloud-init clean --logs
|
||||
sleep 2 && sudo poweroff &
|
||||
exit 0
|
153
sys/contrib/openzfs/.github/workflows/scripts/qemu-4-build.sh
vendored
Executable file
153
sys/contrib/openzfs/.github/workflows/scripts/qemu-4-build.sh
vendored
Executable file
@ -0,0 +1,153 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
######################################################################
|
||||
# 4) configure and build openzfs modules
|
||||
######################################################################
|
||||
|
||||
set -eu
|
||||
|
||||
function run() {
|
||||
LOG="/var/tmp/build-stderr.txt"
|
||||
echo "****************************************************"
|
||||
echo "$(date) ($*)"
|
||||
echo "****************************************************"
|
||||
($@ || echo $? > /tmp/rv) 3>&1 1>&2 2>&3 | stdbuf -eL -oL tee -a $LOG
|
||||
if [ -f /tmp/rv ]; then
|
||||
RV=$(cat /tmp/rv)
|
||||
echo "****************************************************"
|
||||
echo "exit with value=$RV ($*)"
|
||||
echo "****************************************************"
|
||||
echo 1 > /var/tmp/build-exitcode.txt
|
||||
exit $RV
|
||||
fi
|
||||
}
|
||||
|
||||
function freebsd() {
|
||||
export MAKE="gmake"
|
||||
echo "##[group]Autogen.sh"
|
||||
run ./autogen.sh
|
||||
echo "##[endgroup]"
|
||||
|
||||
echo "##[group]Configure"
|
||||
run ./configure \
|
||||
--prefix=/usr/local \
|
||||
--with-libintl-prefix=/usr/local \
|
||||
--enable-pyzfs \
|
||||
--enable-debug \
|
||||
--enable-debuginfo
|
||||
echo "##[endgroup]"
|
||||
|
||||
echo "##[group]Build"
|
||||
run gmake -j$(sysctl -n hw.ncpu)
|
||||
echo "##[endgroup]"
|
||||
|
||||
echo "##[group]Install"
|
||||
run sudo gmake install
|
||||
echo "##[endgroup]"
|
||||
}
|
||||
|
||||
function linux() {
|
||||
echo "##[group]Autogen.sh"
|
||||
run ./autogen.sh
|
||||
echo "##[endgroup]"
|
||||
|
||||
echo "##[group]Configure"
|
||||
run ./configure \
|
||||
--prefix=/usr \
|
||||
--enable-pyzfs \
|
||||
--enable-debug \
|
||||
--enable-debuginfo
|
||||
echo "##[endgroup]"
|
||||
|
||||
echo "##[group]Build"
|
||||
run make -j$(nproc)
|
||||
echo "##[endgroup]"
|
||||
|
||||
echo "##[group]Install"
|
||||
run sudo make install
|
||||
echo "##[endgroup]"
|
||||
}
|
||||
|
||||
function rpm_build_and_install() {
|
||||
EXTRA_CONFIG="${1:-}"
|
||||
echo "##[group]Autogen.sh"
|
||||
run ./autogen.sh
|
||||
echo "##[endgroup]"
|
||||
|
||||
echo "##[group]Configure"
|
||||
run ./configure --enable-debug --enable-debuginfo $EXTRA_CONFIG
|
||||
echo "##[endgroup]"
|
||||
|
||||
echo "##[group]Build"
|
||||
run make pkg-kmod pkg-utils
|
||||
echo "##[endgroup]"
|
||||
|
||||
echo "##[group]Install"
|
||||
run sudo dnf -y --skip-broken localinstall $(ls *.rpm | grep -v src.rpm)
|
||||
echo "##[endgroup]"
|
||||
|
||||
}
|
||||
|
||||
function deb_build_and_install() {
|
||||
echo "##[group]Autogen.sh"
|
||||
run ./autogen.sh
|
||||
echo "##[endgroup]"
|
||||
|
||||
echo "##[group]Configure"
|
||||
run ./configure \
|
||||
--prefix=/usr \
|
||||
--enable-pyzfs \
|
||||
--enable-debug \
|
||||
--enable-debuginfo
|
||||
echo "##[endgroup]"
|
||||
|
||||
echo "##[group]Build"
|
||||
run make native-deb-kmod native-deb-utils
|
||||
echo "##[endgroup]"
|
||||
|
||||
echo "##[group]Install"
|
||||
# Do kmod install. Note that when you build the native debs, the
|
||||
# packages themselves are placed in parent directory '../' rather than
|
||||
# in the source directory like the rpms are.
|
||||
run sudo apt-get -y install $(find ../ | grep -E '\.deb$' \
|
||||
| grep -Ev 'dkms|dracut')
|
||||
echo "##[endgroup]"
|
||||
}
|
||||
|
||||
# Debug: show kernel cmdline
|
||||
if [ -f /proc/cmdline ] ; then
|
||||
cat /proc/cmdline || true
|
||||
fi
|
||||
|
||||
# save some sysinfo
|
||||
uname -a > /var/tmp/uname.txt
|
||||
|
||||
cd $HOME/zfs
|
||||
export PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin"
|
||||
|
||||
# build
|
||||
case "$1" in
|
||||
freebsd*)
|
||||
freebsd
|
||||
;;
|
||||
alma*|centos*)
|
||||
rpm_build_and_install "--with-spec=redhat"
|
||||
;;
|
||||
fedora*)
|
||||
rpm_build_and_install
|
||||
;;
|
||||
debian*|ubuntu*)
|
||||
deb_build_and_install
|
||||
;;
|
||||
*)
|
||||
linux
|
||||
;;
|
||||
esac
|
||||
|
||||
# building the zfs module was ok
|
||||
echo 0 > /var/tmp/build-exitcode.txt
|
||||
|
||||
# reset cloud-init configuration and poweroff
|
||||
sudo cloud-init clean --logs
|
||||
sync && sleep 2 && sudo poweroff &
|
||||
exit 0
|
121
sys/contrib/openzfs/.github/workflows/scripts/qemu-5-setup.sh
vendored
Executable file
121
sys/contrib/openzfs/.github/workflows/scripts/qemu-5-setup.sh
vendored
Executable file
@ -0,0 +1,121 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
######################################################################
|
||||
# 5) start test machines and load openzfs module
|
||||
######################################################################
|
||||
|
||||
set -eu
|
||||
|
||||
# read our defined variables
|
||||
source /var/tmp/env.txt
|
||||
|
||||
# wait for poweroff to succeed
|
||||
PID=$(pidof /usr/bin/qemu-system-x86_64)
|
||||
tail --pid=$PID -f /dev/null
|
||||
sudo virsh undefine openzfs
|
||||
|
||||
# definitions of per operating system
|
||||
case "$OS" in
|
||||
freebsd*)
|
||||
VMs=2
|
||||
CPU=3
|
||||
RAM=6
|
||||
;;
|
||||
*)
|
||||
VMs=2
|
||||
CPU=3
|
||||
RAM=7
|
||||
;;
|
||||
esac
|
||||
|
||||
# this can be different for each distro
|
||||
echo "VMs=$VMs" >> $ENV
|
||||
|
||||
# create snapshot we can clone later
|
||||
sudo zfs snapshot zpool/openzfs@now
|
||||
|
||||
# setup the testing vm's
|
||||
PUBKEY=$(cat ~/.ssh/id_ed25519.pub)
|
||||
for i in $(seq 1 $VMs); do
|
||||
|
||||
echo "Creating disk for vm$i..."
|
||||
DISK="/dev/zvol/zpool/vm$i"
|
||||
FORMAT="raw"
|
||||
sudo zfs clone zpool/openzfs@now zpool/vm$i
|
||||
sudo zfs create -ps -b 64k -V 80g zpool/vm$i-2
|
||||
|
||||
cat <<EOF > /tmp/user-data
|
||||
#cloud-config
|
||||
|
||||
fqdn: vm$i
|
||||
|
||||
users:
|
||||
- name: root
|
||||
shell: $BASH
|
||||
- name: zfs
|
||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
||||
shell: $BASH
|
||||
ssh_authorized_keys:
|
||||
- $PUBKEY
|
||||
|
||||
growpart:
|
||||
mode: auto
|
||||
devices: ['/']
|
||||
ignore_growroot_disabled: false
|
||||
EOF
|
||||
|
||||
sudo virsh net-update default add ip-dhcp-host \
|
||||
"<host mac='52:54:00:83:79:0$i' ip='192.168.122.1$i'/>" --live --config
|
||||
|
||||
sudo virt-install \
|
||||
--os-variant $OSv \
|
||||
--name "vm$i" \
|
||||
--cpu host-passthrough \
|
||||
--virt-type=kvm --hvm \
|
||||
--vcpus=$CPU,sockets=1 \
|
||||
--memory $((1024*RAM)) \
|
||||
--memballoon model=virtio \
|
||||
--graphics none \
|
||||
--cloud-init user-data=/tmp/user-data \
|
||||
--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-2,bus=virtio,cache=none,format=$FORMAT,driver.discard=unmap \
|
||||
--import --noautoconsole >/dev/null
|
||||
done
|
||||
|
||||
# check the memory state from time to time
|
||||
cat <<EOF > cronjob.sh
|
||||
# $OS
|
||||
exec 1>>/var/tmp/stats.txt
|
||||
exec 2>&1
|
||||
echo "*******************************************************"
|
||||
date
|
||||
uptime
|
||||
free -m
|
||||
df -h /mnt/tests
|
||||
zfs list
|
||||
EOF
|
||||
sudo chmod +x cronjob.sh
|
||||
sudo mv -f cronjob.sh /root/cronjob.sh
|
||||
echo '*/5 * * * * /root/cronjob.sh' > crontab.txt
|
||||
sudo crontab crontab.txt
|
||||
rm crontab.txt
|
||||
|
||||
# check if the machines are okay
|
||||
echo "Waiting for vm's to come up... (${VMs}x CPU=$CPU RAM=$RAM)"
|
||||
for i in $(seq 1 $VMs); do
|
||||
while true; do
|
||||
ssh 2>/dev/null zfs@192.168.122.1$i "uname -a" && break
|
||||
done
|
||||
done
|
||||
echo "All $VMs VMs are up now."
|
||||
|
||||
# Save the VM's serial output (ttyS0) to /var/tmp/console.txt
|
||||
# - ttyS0 on the VM corresponds to a local /dev/pty/N entry
|
||||
# - use 'virsh ttyconsole' to lookup the /dev/pty/N entry
|
||||
for i in $(seq 1 $VMs); do
|
||||
mkdir -p $RESPATH/vm$i
|
||||
read "pty" <<< $(sudo virsh ttyconsole vm$i)
|
||||
sudo nohup bash -c "cat $pty > $RESPATH/vm$i/console.txt" &
|
||||
done
|
||||
echo "Console logging for ${VMs}x $OS started."
|
105
sys/contrib/openzfs/.github/workflows/scripts/qemu-6-tests.sh
vendored
Executable file
105
sys/contrib/openzfs/.github/workflows/scripts/qemu-6-tests.sh
vendored
Executable file
@ -0,0 +1,105 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
######################################################################
|
||||
# 6) load openzfs module and run the tests
|
||||
#
|
||||
# called on runner: qemu-6-tests.sh
|
||||
# called on qemu-vm: qemu-6-tests.sh $OS $2/$3
|
||||
######################################################################
|
||||
|
||||
set -eu
|
||||
|
||||
function prefix() {
|
||||
ID="$1"
|
||||
LINE="$2"
|
||||
CURRENT=$(date +%s)
|
||||
TSSTART=$(cat /tmp/tsstart)
|
||||
DIFF=$((CURRENT-TSSTART))
|
||||
H=$((DIFF/3600))
|
||||
DIFF=$((DIFF-(H*3600)))
|
||||
M=$((DIFF/60))
|
||||
S=$((DIFF-(M*60)))
|
||||
|
||||
CTR=$(cat /tmp/ctr)
|
||||
echo $LINE| grep -q "^Test[: ]" && CTR=$((CTR+1)) && echo $CTR > /tmp/ctr
|
||||
|
||||
BASE="$HOME/work/zfs/zfs"
|
||||
COLOR="$BASE/scripts/zfs-tests-color.sh"
|
||||
CLINE=$(echo $LINE| grep "^Test[ :]" | sed -e 's|/usr/local|/usr|g' \
|
||||
| sed -e 's| /usr/share/zfs/zfs-tests/tests/| |g' | $COLOR)
|
||||
if [ -z "$CLINE" ]; then
|
||||
printf "vm${ID}: %s\n" "$LINE"
|
||||
else
|
||||
# [vm2: 00:15:54 256] Test: functional/checksum/setup (run as root) [00:00] [PASS]
|
||||
printf "[vm${ID}: %02d:%02d:%02d %4d] %s\n" \
|
||||
"$H" "$M" "$S" "$CTR" "$CLINE"
|
||||
fi
|
||||
}
|
||||
|
||||
# called directly on the runner
|
||||
if [ -z ${1:-} ]; then
|
||||
cd "/var/tmp"
|
||||
source env.txt
|
||||
SSH=$(which ssh)
|
||||
TESTS='$HOME/zfs/.github/workflows/scripts/qemu-6-tests.sh'
|
||||
echo 0 > /tmp/ctr
|
||||
date "+%s" > /tmp/tsstart
|
||||
|
||||
for i in $(seq 1 $VMs); do
|
||||
IP="192.168.122.1$i"
|
||||
daemonize -c /var/tmp -p vm${i}.pid -o vm${i}log.txt -- \
|
||||
$SSH zfs@$IP $TESTS $OS $i $VMs $CI_TYPE
|
||||
# handly line by line and add info prefix
|
||||
stdbuf -oL tail -fq vm${i}log.txt \
|
||||
| while read -r line; do prefix "$i" "$line"; done &
|
||||
echo $! > vm${i}log.pid
|
||||
# don't mix up the initial --- Configuration --- part
|
||||
sleep 0.13
|
||||
done
|
||||
|
||||
# wait for all vm's to finish
|
||||
for i in $(seq 1 $VMs); do
|
||||
tail --pid=$(cat vm${i}.pid) -f /dev/null
|
||||
pid=$(cat vm${i}log.pid)
|
||||
rm -f vm${i}log.pid
|
||||
kill $pid
|
||||
done
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# this part runs inside qemu vm
|
||||
export PATH="$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin"
|
||||
case "$1" in
|
||||
freebsd*)
|
||||
sudo kldstat -n zfs 2>/dev/null && sudo kldunload zfs
|
||||
sudo -E ./zfs/scripts/zfs.sh
|
||||
TDIR="/usr/local/share/zfs"
|
||||
;;
|
||||
*)
|
||||
# use xfs @ /var/tmp for all distros
|
||||
sudo mv -f /var/tmp/*.txt /tmp
|
||||
sudo mkfs.xfs -fq /dev/vdb
|
||||
sudo mount -o noatime /dev/vdb /var/tmp
|
||||
sudo chmod 1777 /var/tmp
|
||||
sudo mv -f /tmp/*.txt /var/tmp
|
||||
sudo -E modprobe zfs
|
||||
TDIR="/usr/share/zfs"
|
||||
;;
|
||||
esac
|
||||
|
||||
# run functional testings and save exitcode
|
||||
cd /var/tmp
|
||||
TAGS=$2/$3
|
||||
if [ "$4" == "quick" ]; then
|
||||
export RUNFILES="sanity.run"
|
||||
fi
|
||||
sudo dmesg -c > dmesg-prerun.txt
|
||||
mount > mount.txt
|
||||
df -h > df-prerun.txt
|
||||
$TDIR/zfs-tests.sh -vK -s 3GB -T $TAGS
|
||||
RV=$?
|
||||
df -h > df-postrun.txt
|
||||
echo $RV > tests-exitcode.txt
|
||||
sync
|
||||
exit 0
|
123
sys/contrib/openzfs/.github/workflows/scripts/qemu-7-prepare.sh
vendored
Executable file
123
sys/contrib/openzfs/.github/workflows/scripts/qemu-7-prepare.sh
vendored
Executable file
@ -0,0 +1,123 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
######################################################################
|
||||
# 7) prepare output of the results
|
||||
# - this script pre-creates all needed logfiles for later summary
|
||||
######################################################################
|
||||
|
||||
set -eu
|
||||
|
||||
# read our defined variables
|
||||
cd /var/tmp
|
||||
source env.txt
|
||||
|
||||
mkdir -p $RESPATH
|
||||
|
||||
# check if building the module has failed
|
||||
if [ -z ${VMs:-} ]; then
|
||||
cd $RESPATH
|
||||
echo ":exclamation: ZFS module didn't build successfully :exclamation:" \
|
||||
| tee summary.txt | tee /tmp/summary.txt
|
||||
cp /var/tmp/*.txt .
|
||||
tar cf /tmp/qemu-$OS.tar -C $RESPATH -h . || true
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# build was okay
|
||||
BASE="$HOME/work/zfs/zfs"
|
||||
MERGE="$BASE/.github/workflows/scripts/merge_summary.awk"
|
||||
|
||||
# catch result files of testings (vm's should be there)
|
||||
for i in $(seq 1 $VMs); do
|
||||
rsync -arL zfs@192.168.122.1$i:$RESPATH/current $RESPATH/vm$i || true
|
||||
scp zfs@192.168.122.1$i:"/var/tmp/*.txt" $RESPATH/vm$i || true
|
||||
done
|
||||
cp -f /var/tmp/*.txt $RESPATH || true
|
||||
cd $RESPATH
|
||||
|
||||
# prepare result files for summary
|
||||
for i in $(seq 1 $VMs); do
|
||||
file="vm$i/build-stderr.txt"
|
||||
test -s $file && mv -f $file build-stderr.txt
|
||||
|
||||
file="vm$i/build-exitcode.txt"
|
||||
test -s $file && mv -f $file build-exitcode.txt
|
||||
|
||||
file="vm$i/uname.txt"
|
||||
test -s $file && mv -f $file uname.txt
|
||||
|
||||
file="vm$i/tests-exitcode.txt"
|
||||
if [ ! -s $file ]; then
|
||||
# XXX - add some tests for kernel panic's here
|
||||
# tail -n 80 vm$i/console.txt | grep XYZ
|
||||
echo 1 > $file
|
||||
fi
|
||||
rv=$(cat vm$i/tests-exitcode.txt)
|
||||
test $rv != 0 && touch /tmp/have_failed_tests
|
||||
|
||||
file="vm$i/current/log"
|
||||
if [ -s $file ]; then
|
||||
cat $file >> log
|
||||
awk '/\[FAIL\]|\[KILLED\]/{ show=1; print; next; }; \
|
||||
/\[SKIP\]|\[PASS\]/{ show=0; } show' \
|
||||
$file > /tmp/vm${i}dbg.txt
|
||||
fi
|
||||
|
||||
file="vm${i}log.txt"
|
||||
fileC="/tmp/vm${i}log.txt"
|
||||
if [ -s $file ]; then
|
||||
cat $file >> summary
|
||||
cat $file | $BASE/scripts/zfs-tests-color.sh > $fileC
|
||||
fi
|
||||
done
|
||||
|
||||
# create summary of tests
|
||||
if [ -s summary ]; then
|
||||
$MERGE summary | grep -v '^/' > summary.txt
|
||||
$MERGE summary | $BASE/scripts/zfs-tests-color.sh > /tmp/summary.txt
|
||||
rm -f summary
|
||||
else
|
||||
touch summary.txt /tmp/summary.txt
|
||||
fi
|
||||
|
||||
# create file for debugging
|
||||
if [ -s log ]; then
|
||||
awk '/\[FAIL\]|\[KILLED\]/{ show=1; print; next; }; \
|
||||
/\[SKIP\]|\[PASS\]/{ show=0; } show' \
|
||||
log > summary-failure-logs.txt
|
||||
rm -f log
|
||||
else
|
||||
touch summary-failure-logs.txt
|
||||
fi
|
||||
|
||||
# create debug overview for failed tests
|
||||
cat summary.txt \
|
||||
| awk '/\(expected PASS\)/{ if ($1!="SKIP") print $2; next; } show' \
|
||||
| while read t; do
|
||||
cat summary-failure-logs.txt \
|
||||
| awk '$0~/Test[: ]/{ show=0; } $0~v{ show=1; } show' v="$t" \
|
||||
> /tmp/fail.txt
|
||||
SIZE=$(stat --printf="%s" /tmp/fail.txt)
|
||||
SIZE=$((SIZE/1024))
|
||||
# Test Summary:
|
||||
echo "##[group]$t ($SIZE KiB)" >> /tmp/failed.txt
|
||||
cat /tmp/fail.txt | $BASE/scripts/zfs-tests-color.sh >> /tmp/failed.txt
|
||||
echo "##[endgroup]" >> /tmp/failed.txt
|
||||
# Job Summary:
|
||||
echo -e "\n<details>\n<summary>$t ($SIZE KiB)</summary><pre>" >> failed.txt
|
||||
cat /tmp/fail.txt >> failed.txt
|
||||
echo "</pre></details>" >> failed.txt
|
||||
done
|
||||
|
||||
if [ -e /tmp/have_failed_tests ]; then
|
||||
echo ":warning: Some tests failed!" >> failed.txt
|
||||
else
|
||||
echo ":thumbsup: All tests passed." >> failed.txt
|
||||
fi
|
||||
|
||||
if [ ! -s uname.txt ]; then
|
||||
echo ":interrobang: Panic - where is my uname.txt?" > uname.txt
|
||||
fi
|
||||
|
||||
# artifact ready now
|
||||
tar cf /tmp/qemu-$OS.tar -C $RESPATH -h . || true
|
71
sys/contrib/openzfs/.github/workflows/scripts/qemu-8-summary.sh
vendored
Executable file
71
sys/contrib/openzfs/.github/workflows/scripts/qemu-8-summary.sh
vendored
Executable file
@ -0,0 +1,71 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
######################################################################
|
||||
# 8) show colored output of results
|
||||
######################################################################
|
||||
|
||||
set -eu
|
||||
|
||||
# read our defined variables
|
||||
source /var/tmp/env.txt
|
||||
cd $RESPATH
|
||||
|
||||
# helper function for showing some content with headline
|
||||
function showfile() {
|
||||
content=$(dd if=$1 bs=1024 count=400k 2>/dev/null)
|
||||
if [ -z "$2" ]; then
|
||||
group1=""
|
||||
group2=""
|
||||
else
|
||||
SIZE=$(stat --printf="%s" "$file")
|
||||
SIZE=$((SIZE/1024))
|
||||
group1="##[group]$2 ($SIZE KiB)"
|
||||
group2="##[endgroup]"
|
||||
fi
|
||||
cat <<EOF > tmp$$
|
||||
$group1
|
||||
$content
|
||||
$group2
|
||||
EOF
|
||||
cat tmp$$
|
||||
rm -f tmp$$
|
||||
}
|
||||
|
||||
# overview
|
||||
cat /tmp/summary.txt
|
||||
echo ""
|
||||
|
||||
if [ -f /tmp/have_failed_tests -a -s /tmp/failed.txt ]; then
|
||||
echo "Debuginfo of failed tests:"
|
||||
cat /tmp/failed.txt
|
||||
echo ""
|
||||
cat /tmp/summary.txt | grep -v '^/'
|
||||
echo ""
|
||||
fi
|
||||
|
||||
echo -e "\nFull logs for download:\n $1\n"
|
||||
|
||||
for i in $(seq 1 $VMs); do
|
||||
rv=$(cat vm$i/tests-exitcode.txt)
|
||||
|
||||
if [ $rv = 0 ]; then
|
||||
vm="[92mvm$i[0m"
|
||||
else
|
||||
vm="[1;91mvm$i[0m"
|
||||
fi
|
||||
|
||||
file="vm$i/dmesg-prerun.txt"
|
||||
test -s "$file" && showfile "$file" "$vm: dmesg kernel"
|
||||
|
||||
file="/tmp/vm${i}log.txt"
|
||||
test -s "$file" && showfile "$file" "$vm: test results"
|
||||
|
||||
file="vm$i/console.txt"
|
||||
test -s "$file" && showfile "$file" "$vm: serial console"
|
||||
|
||||
file="/tmp/vm${i}dbg.txt"
|
||||
test -s "$file" && showfile "$file" "$vm: failure logfile"
|
||||
done
|
||||
|
||||
test -f /tmp/have_failed_tests && exit 1
|
||||
exit 0
|
57
sys/contrib/openzfs/.github/workflows/scripts/qemu-9-summary-page.sh
vendored
Executable file
57
sys/contrib/openzfs/.github/workflows/scripts/qemu-9-summary-page.sh
vendored
Executable file
@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
######################################################################
|
||||
# 9) generate github summary page of all the testings
|
||||
######################################################################
|
||||
|
||||
set -eu
|
||||
|
||||
function output() {
|
||||
echo -e $* >> "out-$logfile.md"
|
||||
}
|
||||
|
||||
function outfile() {
|
||||
test -s "$1" || return
|
||||
cat "$1" >> "out-$logfile.md"
|
||||
}
|
||||
|
||||
function outfile_plain() {
|
||||
test -s "$1" || return
|
||||
output "<pre>"
|
||||
cat "$1" >> "out-$logfile.md"
|
||||
output "</pre>"
|
||||
}
|
||||
|
||||
function send2github() {
|
||||
test -f "$1" || exit 0
|
||||
dd if="$1" bs=1023k count=1 >> $GITHUB_STEP_SUMMARY
|
||||
}
|
||||
|
||||
# https://docs.github.com/en/enterprise-server@3.6/actions/using-workflows/workflow-commands-for-github-actions#step-isolation-and-limits
|
||||
# Job summaries are isolated between steps and each step is restricted to a maximum size of 1MiB.
|
||||
# [ ] can not show all error findings here
|
||||
# [x] split files into smaller ones and create additional steps
|
||||
|
||||
# first call, generate all summaries
|
||||
if [ ! -f out-1.md ]; then
|
||||
logfile="1"
|
||||
for tarfile in Logs-functional-*/qemu-*.tar; do
|
||||
rm -rf vm* *.txt
|
||||
if [ ! -s "$tarfile" ]; then
|
||||
output "\n## Functional Tests: unknown\n"
|
||||
output ":exclamation: Tarfile $tarfile is empty :exclamation:"
|
||||
continue
|
||||
fi
|
||||
tar xf "$tarfile"
|
||||
test -s env.txt || continue
|
||||
source env.txt
|
||||
output "\n## Functional Tests: $OSNAME\n"
|
||||
outfile_plain uname.txt
|
||||
outfile_plain summary.txt
|
||||
outfile failed.txt
|
||||
logfile=$((logfile+1))
|
||||
done
|
||||
send2github out-1.md
|
||||
else
|
||||
send2github out-$1.md
|
||||
fi
|
@ -1,88 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eu
|
||||
|
||||
function prerun() {
|
||||
echo "::group::Install build dependencies"
|
||||
# remove snap things, update+upgrade will be faster then
|
||||
for x in lxd core20 snapd; do sudo snap remove $x; done
|
||||
sudo apt-get purge snapd google-chrome-stable firefox
|
||||
# https://github.com/orgs/community/discussions/47863
|
||||
sudo apt-get remove grub-efi-amd64-bin grub-efi-amd64-signed shim-signed --allow-remove-essential
|
||||
sudo apt-get update
|
||||
sudo apt upgrade
|
||||
sudo xargs --arg-file=.github/workflows/build-dependencies.txt apt-get install -qq
|
||||
sudo apt-get clean
|
||||
sudo dmesg -c > /var/tmp/dmesg-prerun
|
||||
echo "::endgroup::"
|
||||
}
|
||||
|
||||
function mod_build() {
|
||||
echo "::group::Generate debian packages"
|
||||
./autogen.sh
|
||||
./configure --enable-debug --enable-debuginfo --enable-asan --enable-ubsan
|
||||
make --no-print-directory --silent native-deb-utils native-deb-kmod
|
||||
mv ../*.deb .
|
||||
rm ./openzfs-zfs-dracut*.deb ./openzfs-zfs-dkms*.deb
|
||||
echo "$ImageOS-$ImageVersion" > tests/ImageOS.txt
|
||||
echo "::endgroup::"
|
||||
}
|
||||
|
||||
function mod_install() {
|
||||
# install the pre-built module only on the same runner image
|
||||
MOD=`cat tests/ImageOS.txt`
|
||||
if [ "$MOD" != "$ImageOS-$ImageVersion" ]; then
|
||||
rm -f *.deb
|
||||
mod_build
|
||||
fi
|
||||
|
||||
echo "::group::Install and load modules"
|
||||
# don't use kernel-shipped zfs modules
|
||||
sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf
|
||||
sudo apt-get install --fix-missing ./*.deb
|
||||
|
||||
# Native Debian packages enable and start the services
|
||||
# Stop zfs-zed daemon, as it may interfere with some ZTS test cases
|
||||
sudo systemctl stop zfs-zed
|
||||
sudo depmod -a
|
||||
sudo modprobe zfs
|
||||
sudo dmesg
|
||||
sudo dmesg -c > /var/tmp/dmesg-module-load
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Report CPU information"
|
||||
lscpu
|
||||
cat /proc/spl/kstat/zfs/chksum_bench
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Optimize storage for ZFS testings"
|
||||
# remove swap and umount fast storage
|
||||
# 89GiB -> rootfs + bootfs with ~80MB/s -> don't care
|
||||
# 64GiB -> /mnt with 420MB/s -> new testing ssd
|
||||
sudo swapoff -a
|
||||
|
||||
# this one is fast and mounted @ /mnt
|
||||
# -> we reformat with ext4 + move it to /var/tmp
|
||||
DEV="/dev/disk/azure/resource-part1"
|
||||
sudo umount /mnt
|
||||
sudo mkfs.ext4 -O ^has_journal -F $DEV
|
||||
sudo mount -o noatime,barrier=0 $DEV /var/tmp
|
||||
sudo chmod 1777 /var/tmp
|
||||
|
||||
# disk usage afterwards
|
||||
sudo df -h /
|
||||
sudo df -h /var/tmp
|
||||
sudo fstrim -a
|
||||
echo "::endgroup::"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
build)
|
||||
prerun
|
||||
mod_build
|
||||
;;
|
||||
tests)
|
||||
prerun
|
||||
mod_install
|
||||
;;
|
||||
esac
|
@ -1,24 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eu
|
||||
|
||||
TDIR="/usr/share/zfs/zfs-tests/tests/functional"
|
||||
echo -n "TODO="
|
||||
case "$1" in
|
||||
part1)
|
||||
# ~1h 20m
|
||||
echo "cli_root"
|
||||
;;
|
||||
part2)
|
||||
# ~1h
|
||||
ls $TDIR|grep '^[a-m]'|grep -v "cli_root"|xargs|tr -s ' ' ','
|
||||
;;
|
||||
part3)
|
||||
# ~1h
|
||||
ls $TDIR|grep '^[n-qs-z]'|xargs|tr -s ' ' ','
|
||||
;;
|
||||
part4)
|
||||
# ~1h
|
||||
ls $TDIR|grep '^r'|xargs|tr -s ' ' ','
|
||||
;;
|
||||
esac
|
@ -1,124 +0,0 @@
|
||||
name: zfs-linux-tests
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
os:
|
||||
description: 'The ubuntu version: 20.02 or 22.04'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
|
||||
zloop:
|
||||
runs-on: ubuntu-${{ inputs.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: modules-${{ inputs.os }}
|
||||
- name: Install modules
|
||||
run: |
|
||||
tar xzf modules-${{ inputs.os }}.tgz
|
||||
.github/workflows/scripts/setup-dependencies.sh tests
|
||||
- name: Tests
|
||||
timeout-minutes: 30
|
||||
run: |
|
||||
sudo mkdir -p /var/tmp/zloop
|
||||
# run for 10 minutes or at most 2 iterations for a maximum runner
|
||||
# time of 20 minutes.
|
||||
sudo /usr/share/zfs/zloop.sh -t 600 -I 2 -l -m1 -- -T 120 -P 60
|
||||
- name: Prepare artifacts
|
||||
if: failure()
|
||||
run: |
|
||||
sudo chmod +r -R /var/tmp/zloop/
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: Zloop-logs-${{ inputs.os }}
|
||||
path: |
|
||||
/var/tmp/zloop/*/
|
||||
!/var/tmp/zloop/*/vdev/
|
||||
retention-days: 14
|
||||
if-no-files-found: ignore
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: Zloop-files-${{ inputs.os }}
|
||||
path: |
|
||||
/var/tmp/zloop/*/vdev/
|
||||
retention-days: 14
|
||||
if-no-files-found: ignore
|
||||
|
||||
sanity:
|
||||
runs-on: ubuntu-${{ inputs.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: modules-${{ inputs.os }}
|
||||
- name: Install modules
|
||||
run: |
|
||||
tar xzf modules-${{ inputs.os }}.tgz
|
||||
.github/workflows/scripts/setup-dependencies.sh tests
|
||||
- name: Tests
|
||||
timeout-minutes: 60
|
||||
shell: bash
|
||||
run: |
|
||||
set -o pipefail
|
||||
/usr/share/zfs/zfs-tests.sh -vKR -s 3G -r sanity | scripts/zfs-tests-color.sh
|
||||
- name: Prepare artifacts
|
||||
if: success() || failure()
|
||||
run: |
|
||||
RESPATH="/var/tmp/test_results"
|
||||
mv -f $RESPATH/current $RESPATH/testfiles
|
||||
tar cf $RESPATH/sanity.tar -h -C $RESPATH testfiles
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: success() || failure()
|
||||
with:
|
||||
name: Logs-${{ inputs.os }}-sanity
|
||||
path: /var/tmp/test_results/sanity.tar
|
||||
if-no-files-found: ignore
|
||||
|
||||
functional:
|
||||
runs-on: ubuntu-${{ inputs.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
tests: [ part1, part2, part3, part4 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: modules-${{ inputs.os }}
|
||||
- name: Install modules
|
||||
run: |
|
||||
tar xzf modules-${{ inputs.os }}.tgz
|
||||
.github/workflows/scripts/setup-dependencies.sh tests
|
||||
- name: Setup tests
|
||||
run: |
|
||||
.github/workflows/scripts/setup-functional.sh ${{ matrix.tests }} >> $GITHUB_ENV
|
||||
- name: Tests
|
||||
timeout-minutes: 120
|
||||
shell: bash
|
||||
run: |
|
||||
set -o pipefail
|
||||
/usr/share/zfs/zfs-tests.sh -vKR -s 3G -T ${{ env.TODO }} | scripts/zfs-tests-color.sh
|
||||
- name: Prepare artifacts
|
||||
if: success() || failure()
|
||||
run: |
|
||||
RESPATH="/var/tmp/test_results"
|
||||
mv -f $RESPATH/current $RESPATH/testfiles
|
||||
tar cf $RESPATH/${{ matrix.tests }}.tar -h -C $RESPATH testfiles
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: success() || failure()
|
||||
with:
|
||||
name: Logs-${{ inputs.os }}-functional-${{ matrix.tests }}
|
||||
path: /var/tmp/test_results/${{ matrix.tests }}.tar
|
||||
if-no-files-found: ignore
|
@ -1,64 +0,0 @@
|
||||
name: zfs-linux
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
name: Build
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [20.04, 22.04]
|
||||
runs-on: ubuntu-${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Build modules
|
||||
run: .github/workflows/scripts/setup-dependencies.sh build
|
||||
- name: Prepare modules upload
|
||||
run: tar czf modules-${{ matrix.os }}.tgz *.deb .github tests/test-runner tests/ImageOS.txt
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: modules-${{ matrix.os }}
|
||||
path: modules-${{ matrix.os }}.tgz
|
||||
retention-days: 14
|
||||
|
||||
testings:
|
||||
name: Testing
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [20.04, 22.04]
|
||||
needs: build
|
||||
uses: ./.github/workflows/zfs-linux-tests.yml
|
||||
with:
|
||||
os: ${{ matrix.os }}
|
||||
|
||||
cleanup:
|
||||
if: always()
|
||||
name: Cleanup
|
||||
runs-on: ubuntu-22.04
|
||||
needs: testings
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- name: Generating summary
|
||||
run: |
|
||||
tar xzf modules-22.04/modules-22.04.tgz .github tests
|
||||
.github/workflows/scripts/generate-summary.sh
|
||||
# up to 4 steps, each can have 1 MiB output (for debugging log files)
|
||||
- name: Summary for errors #1
|
||||
run: .github/workflows/scripts/generate-summary.sh 1
|
||||
- name: Summary for errors #2
|
||||
run: .github/workflows/scripts/generate-summary.sh 2
|
||||
- name: Summary for errors #3
|
||||
run: .github/workflows/scripts/generate-summary.sh 3
|
||||
- name: Summary for errors #4
|
||||
run: .github/workflows/scripts/generate-summary.sh 4
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Summary Files
|
||||
path: Summary/
|
175
sys/contrib/openzfs/.github/workflows/zfs-qemu.yml
vendored
Normal file
175
sys/contrib/openzfs/.github/workflows/zfs-qemu.yml
vendored
Normal file
@ -0,0 +1,175 @@
|
||||
name: zfs-qemu
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test-config:
|
||||
name: Setup
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
test_os: ${{ steps.os.outputs.os }}
|
||||
ci_type: ${{ steps.os.outputs.ci_type }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Generate OS config and CI type
|
||||
id: os
|
||||
run: |
|
||||
FULL_OS='["almalinux8", "almalinux9", "centos-stream9", "debian11", "debian12", "fedora39", "fedora40", "freebsd13", "freebsd13r", "freebsd14", "freebsd14r", "ubuntu20", "ubuntu22", "ubuntu24"]'
|
||||
QUICK_OS='["almalinux8", "almalinux9", "debian12", "fedora40", "freebsd13", "freebsd14", "ubuntu24"]'
|
||||
# determine CI type when running on PR
|
||||
ci_type="full"
|
||||
if ${{ github.event_name == 'pull_request' }}; then
|
||||
head=${{ github.event.pull_request.head.sha }}
|
||||
base=${{ github.event.pull_request.base.sha }}
|
||||
ci_type=$(python3 .github/workflows/scripts/generate-ci-type.py $head $base)
|
||||
fi
|
||||
if [ "$ci_type" == "quick" ]; then
|
||||
os_selection="$QUICK_OS"
|
||||
else
|
||||
os_selection="$FULL_OS"
|
||||
fi
|
||||
os_json=$(echo ${os_selection} | jq -c)
|
||||
echo "os=$os_json" >> $GITHUB_OUTPUT
|
||||
echo "ci_type=$ci_type" >> $GITHUB_OUTPUT
|
||||
|
||||
qemu-vm:
|
||||
name: qemu-x86
|
||||
needs: [ test-config ]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# all:
|
||||
# os: [almalinux8, almalinux9, archlinux, centos-stream9, fedora39, fedora40, debian11, debian12, freebsd13, freebsd13r, freebsd14, freebsd14r, freebsd15, ubuntu20, ubuntu22, ubuntu24]
|
||||
# openzfs:
|
||||
# os: [almalinux8, almalinux9, centos-stream9, debian11, debian12, fedora39, fedora40, freebsd13, freebsd13r, freebsd14, freebsd14r, ubuntu20, ubuntu22, ubuntu24]
|
||||
os: ${{ fromJson(needs.test-config.outputs.test_os) }}
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: Setup QEMU
|
||||
timeout-minutes: 10
|
||||
run: .github/workflows/scripts/qemu-1-setup.sh
|
||||
|
||||
- name: Start build machine
|
||||
timeout-minutes: 10
|
||||
run: .github/workflows/scripts/qemu-2-start.sh ${{ matrix.os }}
|
||||
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
echo "Install dependencies in QEMU machine"
|
||||
IP=192.168.122.10
|
||||
while pidof /usr/bin/qemu-system-x86_64 >/dev/null; do
|
||||
ssh 2>/dev/null zfs@$IP "uname -a" && break
|
||||
done
|
||||
scp .github/workflows/scripts/qemu-3-deps.sh zfs@$IP:qemu-3-deps.sh
|
||||
PID=`pidof /usr/bin/qemu-system-x86_64`
|
||||
ssh zfs@$IP '$HOME/qemu-3-deps.sh' ${{ matrix.os }}
|
||||
# wait for poweroff to succeed
|
||||
tail --pid=$PID -f /dev/null
|
||||
sleep 5 # avoid this: "error: Domain is already active"
|
||||
rm -f $HOME/.ssh/known_hosts
|
||||
|
||||
- name: Build modules
|
||||
timeout-minutes: 30
|
||||
run: |
|
||||
echo "Build modules in QEMU machine"
|
||||
sudo virsh start openzfs
|
||||
IP=192.168.122.10
|
||||
while pidof /usr/bin/qemu-system-x86_64 >/dev/null; do
|
||||
ssh 2>/dev/null zfs@$IP "uname -a" && break
|
||||
done
|
||||
rsync -ar $HOME/work/zfs/zfs zfs@$IP:./
|
||||
ssh zfs@$IP '$HOME/zfs/.github/workflows/scripts/qemu-4-build.sh' ${{ matrix.os }}
|
||||
|
||||
- name: Setup testing machines
|
||||
timeout-minutes: 5
|
||||
run: .github/workflows/scripts/qemu-5-setup.sh
|
||||
|
||||
- name: Run tests
|
||||
timeout-minutes: 270
|
||||
run: .github/workflows/scripts/qemu-6-tests.sh
|
||||
env:
|
||||
CI_TYPE: ${{ needs.test-config.outputs.ci_type }}
|
||||
|
||||
- name: Prepare artifacts
|
||||
if: always()
|
||||
timeout-minutes: 10
|
||||
run: .github/workflows/scripts/qemu-7-prepare.sh
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
id: artifact-upload
|
||||
if: always()
|
||||
with:
|
||||
name: Logs-functional-${{ matrix.os }}
|
||||
path: /tmp/qemu-${{ matrix.os }}.tar
|
||||
if-no-files-found: ignore
|
||||
|
||||
- name: Test Summary
|
||||
if: always()
|
||||
run: .github/workflows/scripts/qemu-8-summary.sh '${{ steps.artifact-upload.outputs.artifact-url }}'
|
||||
|
||||
cleanup:
|
||||
if: always()
|
||||
name: Cleanup
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ qemu-vm ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- uses: actions/download-artifact@v4
|
||||
- name: Generating summary
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 2
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 3
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 4
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 5
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 6
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 7
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 8
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 9
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 10
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 11
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 12
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 13
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 14
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 15
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 16
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 17
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 18
|
||||
- name: Generating summary...
|
||||
run: .github/workflows/scripts/qemu-9-summary-page.sh 19
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Summary Files
|
||||
path: out-*
|
77
sys/contrib/openzfs/.github/workflows/zloop.yml
vendored
Normal file
77
sys/contrib/openzfs/.github/workflows/zloop.yml
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
name: zloop
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
zloop:
|
||||
runs-on: ubuntu-24.04
|
||||
env:
|
||||
TEST_DIR: /var/tmp/zloop
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get purge -y snapd google-chrome-stable firefox
|
||||
ONLY_DEPS=1 .github/workflows/scripts/qemu-3-deps.sh ubuntu24
|
||||
- name: Autogen.sh
|
||||
run: |
|
||||
sed -i '/DEBUG_CFLAGS="-Werror"/s/^/#/' config/zfs-build.m4
|
||||
./autogen.sh
|
||||
- name: Configure
|
||||
run: |
|
||||
./configure --prefix=/usr --enable-debug --enable-debuginfo \
|
||||
--enable-asan --enable-ubsan \
|
||||
--enable-debug-kmem --enable-debug-kmem-tracking
|
||||
- name: Make
|
||||
run: |
|
||||
make -j$(nproc)
|
||||
- name: Install
|
||||
run: |
|
||||
sudo make install
|
||||
sudo depmod
|
||||
sudo modprobe zfs
|
||||
- name: Tests
|
||||
run: |
|
||||
sudo mkdir -p $TEST_DIR
|
||||
# run for 10 minutes or at most 6 iterations for a maximum runner
|
||||
# time of 60 minutes.
|
||||
sudo /usr/share/zfs/zloop.sh -t 600 -I 6 -l -m 1 -- -T 120 -P 60
|
||||
- name: Prepare artifacts
|
||||
if: failure()
|
||||
run: |
|
||||
sudo chmod +r -R $TEST_DIR/
|
||||
- name: Ztest log
|
||||
if: failure()
|
||||
run: |
|
||||
grep -B10 -A1000 'ASSERT' $TEST_DIR/*/ztest.out || tail -n 1000 $TEST_DIR/*/ztest.out
|
||||
- name: Gdb log
|
||||
if: failure()
|
||||
run: |
|
||||
sed -n '/Backtraces (full)/q;p' $TEST_DIR/*/ztest.gdb
|
||||
- name: Zdb log
|
||||
if: failure()
|
||||
run: |
|
||||
cat $TEST_DIR/*/ztest.zdb
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: Logs
|
||||
path: |
|
||||
/var/tmp/zloop/*/
|
||||
!/var/tmp/zloop/*/vdev/
|
||||
if-no-files-found: ignore
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: Pool files
|
||||
path: |
|
||||
/var/tmp/zloop/*/vdev/
|
||||
if-no-files-found: ignore
|
@ -208,6 +208,7 @@ Vaibhav Bhanawat <vaibhav.bhanawat@delphix.com> <88050553+vaibhav-delphix@users.
|
||||
Violet Purcell <vimproved@inventati.org> <66446404+vimproved@users.noreply.github.com>
|
||||
Vipin Kumar Verma <vipin.verma@hpe.com> <75025470+vermavipinkumar@users.noreply.github.com>
|
||||
Wolfgang Bumiller <w.bumiller@proxmox.com> <Blub@users.noreply.github.com>
|
||||
XDTG <click1799@163.com> <35128600+XDTG@users.noreply.github.com>
|
||||
xtouqh <xtouqh@hotmail.com> <72357159+xtouqh@users.noreply.github.com>
|
||||
Yuri Pankov <yuripv@FreeBSD.org> <113725409+yuripv@users.noreply.github.com>
|
||||
Yuri Pankov <yuripv@FreeBSD.org> <82001006+yuripv@users.noreply.github.com>
|
||||
|
@ -248,6 +248,7 @@ CONTRIBUTORS:
|
||||
Gian-Carlo DeFazio <defazio1@llnl.gov>
|
||||
Gionatan Danti <g.danti@assyoma.it>
|
||||
Giuseppe Di Natale <guss80@gmail.com>
|
||||
Gleb Smirnoff <glebius@FreeBSD.org>
|
||||
Glenn Washburn <development@efficientek.com>
|
||||
glibg10b <glibg10b@users.noreply.github.com>
|
||||
gofaster <felix.gofaster@gmail.com>
|
||||
@ -565,6 +566,7 @@ CONTRIBUTORS:
|
||||
Sen Haerens <sen@senhaerens.be>
|
||||
Serapheim Dimitropoulos <serapheim@delphix.com>
|
||||
Seth Forshee <seth.forshee@canonical.com>
|
||||
Seth Hoffert <Seth.Hoffert@gmail.com>
|
||||
Seth Troisi <sethtroisi@google.com>
|
||||
Shaan Nobee <sniper111@gmail.com>
|
||||
Shampavman <sham.pavman@nexenta.com>
|
||||
@ -598,6 +600,7 @@ CONTRIBUTORS:
|
||||
Tamas TEVESZ <ice@extreme.hu>
|
||||
Teodor Spæren <teodor_spaeren@riseup.net>
|
||||
TerraTech <TerraTech@users.noreply.github.com>
|
||||
Theera K. <tkittich@hotmail.com>
|
||||
Thijs Cramer <thijs.cramer@gmail.com>
|
||||
Thomas Bertschinger <bertschinger@lanl.gov>
|
||||
Thomas Geppert <geppi@digitx.de>
|
||||
@ -648,6 +651,7 @@ CONTRIBUTORS:
|
||||
Windel Bouwman <windel@windel.nl>
|
||||
Wojciech Małota-Wójcik <outofforest@users.noreply.github.com>
|
||||
Wolfgang Bumiller <w.bumiller@proxmox.com>
|
||||
XDTG <click1799@163.com>
|
||||
Xin Li <delphij@FreeBSD.org>
|
||||
Xinliang Liu <xinliang.liu@linaro.org>
|
||||
xtouqh <xtouqh@hotmail.com>
|
||||
|
@ -1,10 +1,10 @@
|
||||
Meta: 1
|
||||
Name: zfs
|
||||
Branch: 1.0
|
||||
Version: 2.2.99
|
||||
Release: 1
|
||||
Version: 2.3.0
|
||||
Release: rc1
|
||||
Release-Tags: relext
|
||||
License: CDDL
|
||||
Author: OpenZFS
|
||||
Linux-Maximum: 6.10
|
||||
Linux-Minimum: 3.10
|
||||
Linux-Maximum: 6.11
|
||||
Linux-Minimum: 4.18
|
||||
|
@ -566,7 +566,7 @@ def section_arc(kstats_dict):
|
||||
l2_hdr_size = arc_stats['l2_hdr_size']
|
||||
abd_chunk_waste_size = arc_stats['abd_chunk_waste_size']
|
||||
|
||||
prt_1('ARC structal breakdown (current size):', f_bytes(arc_size))
|
||||
prt_1('ARC structural breakdown (current size):', f_bytes(arc_size))
|
||||
prt_i2('Compressed size:',
|
||||
f_perc(compressed_size, arc_size), f_bytes(compressed_size))
|
||||
prt_i2('Overhead size:',
|
||||
|
@ -152,6 +152,7 @@ cols = {
|
||||
"l2asize": [7, 1024, "Actual (compressed) size of the L2ARC"],
|
||||
"l2size": [6, 1024, "Size of the L2ARC"],
|
||||
"l2bytes": [7, 1024, "Bytes read per second from the L2ARC"],
|
||||
"l2wbytes": [8, 1024, "Bytes written per second to the L2ARC"],
|
||||
"grow": [4, 1000, "ARC grow disabled"],
|
||||
"need": [5, 1024, "ARC reclaim need"],
|
||||
"free": [5, 1024, "ARC free memory"],
|
||||
@ -169,6 +170,83 @@ cols = {
|
||||
"zactive": [7, 1000, "zfetch prefetches active per second"],
|
||||
}
|
||||
|
||||
# ARC structural breakdown from arc_summary
|
||||
structfields = {
|
||||
"cmp": ["compressed", "Compressed"],
|
||||
"ovh": ["overhead", "Overhead"],
|
||||
"bon": ["bonus", "Bonus"],
|
||||
"dno": ["dnode", "Dnode"],
|
||||
"dbu": ["dbuf", "Dbuf"],
|
||||
"hdr": ["hdr", "Header"],
|
||||
"l2h": ["l2_hdr", "L2 header"],
|
||||
"abd": ["abd_chunk_waste", "ABD chunk waste"],
|
||||
}
|
||||
structstats = { # size stats
|
||||
"percent": "size", # percentage of this value
|
||||
"sz": ["_size", "size"],
|
||||
}
|
||||
|
||||
# ARC types breakdown from arc_summary
|
||||
typefields = {
|
||||
"data": ["data", "ARC data"],
|
||||
"meta": ["metadata", "ARC metadata"],
|
||||
}
|
||||
typestats = { # size stats
|
||||
"percent": "cachessz", # percentage of this value
|
||||
"tg": ["_target", "target"],
|
||||
"sz": ["_size", "size"],
|
||||
}
|
||||
|
||||
# ARC states breakdown from arc_summary
|
||||
statefields = {
|
||||
"ano": ["anon", "Anonymous"],
|
||||
"mfu": ["mfu", "MFU"],
|
||||
"mru": ["mru", "MRU"],
|
||||
"unc": ["uncached", "Uncached"],
|
||||
}
|
||||
targetstats = {
|
||||
"percent": "cachessz", # percentage of this value
|
||||
"fields": ["mfu", "mru"], # only applicable to these fields
|
||||
"tg": ["_target", "target"],
|
||||
"dt": ["_data_target", "data target"],
|
||||
"mt": ["_metadata_target", "metadata target"],
|
||||
}
|
||||
statestats = { # size stats
|
||||
"percent": "cachessz", # percentage of this value
|
||||
"sz": ["_size", "size"],
|
||||
"da": ["_data", "data size"],
|
||||
"me": ["_metadata", "metadata size"],
|
||||
"ed": ["_evictable_data", "evictable data size"],
|
||||
"em": ["_evictable_metadata", "evictable metadata size"],
|
||||
}
|
||||
ghoststats = {
|
||||
"fields": ["mfu", "mru"], # only applicable to these fields
|
||||
"gsz": ["_ghost_size", "ghost size"],
|
||||
"gd": ["_ghost_data", "ghost data size"],
|
||||
"gm": ["_ghost_metadata", "ghost metadata size"],
|
||||
}
|
||||
|
||||
# fields and stats
|
||||
fieldstats = [
|
||||
[structfields, structstats],
|
||||
[typefields, typestats],
|
||||
[statefields, targetstats, statestats, ghoststats],
|
||||
]
|
||||
for fs in fieldstats:
|
||||
fields, stats = fs[0], fs[1:]
|
||||
for field, fieldval in fields.items():
|
||||
for group in stats:
|
||||
for stat, statval in group.items():
|
||||
if stat in ["fields", "percent"] or \
|
||||
("fields" in group and field not in group["fields"]):
|
||||
continue
|
||||
colname = field + stat
|
||||
coldesc = fieldval[1] + " " + statval[1]
|
||||
cols[colname] = [len(colname), 1024, coldesc]
|
||||
if "percent" in group:
|
||||
cols[colname + "%"] = [len(colname) + 1, 100, \
|
||||
coldesc + " percentage"]
|
||||
|
||||
v = {}
|
||||
hdr = ["time", "read", "ddread", "ddh%", "dmread", "dmh%", "pread", "ph%",
|
||||
"size", "c", "avail"]
|
||||
@ -286,6 +364,29 @@ def snap_stats():
|
||||
kstat_update()
|
||||
|
||||
cur = kstat
|
||||
|
||||
# fill in additional values from arc_summary
|
||||
cur["caches_size"] = caches_size = cur["anon_data"]+cur["anon_metadata"]+\
|
||||
cur["mfu_data"]+cur["mfu_metadata"]+cur["mru_data"]+cur["mru_metadata"]+\
|
||||
cur["uncached_data"]+cur["uncached_metadata"]
|
||||
s = 4294967296
|
||||
pd = cur["pd"]
|
||||
pm = cur["pm"]
|
||||
meta = cur["meta"]
|
||||
v = (s-int(pd))*(s-int(meta))/s
|
||||
cur["mfu_data_target"] = v / 65536 * caches_size / 65536
|
||||
v = (s-int(pm))*int(meta)/s
|
||||
cur["mfu_metadata_target"] = v / 65536 * caches_size / 65536
|
||||
v = int(pd)*(s-int(meta))/s
|
||||
cur["mru_data_target"] = v / 65536 * caches_size / 65536
|
||||
v = int(pm)*int(meta)/s
|
||||
cur["mru_metadata_target"] = v / 65536 * caches_size / 65536
|
||||
|
||||
cur["data_target"] = cur["mfu_data_target"] + cur["mru_data_target"]
|
||||
cur["metadata_target"] = cur["mfu_metadata_target"] + cur["mru_metadata_target"]
|
||||
cur["mfu_target"] = cur["mfu_data_target"] + cur["mfu_metadata_target"]
|
||||
cur["mru_target"] = cur["mru_data_target"] + cur["mru_metadata_target"]
|
||||
|
||||
for key in cur:
|
||||
if re.match(key, "class"):
|
||||
continue
|
||||
@ -295,31 +396,34 @@ def snap_stats():
|
||||
d[key] = cur[key]
|
||||
|
||||
|
||||
def isint(num):
|
||||
if isinstance(num, float):
|
||||
return num.is_integer()
|
||||
if isinstance(num, int):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def prettynum(sz, scale, num=0):
|
||||
suffix = [' ', 'K', 'M', 'G', 'T', 'P', 'E', 'Z']
|
||||
suffix = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z']
|
||||
index = 0
|
||||
save = 0
|
||||
|
||||
# Special case for date field
|
||||
if scale == -1:
|
||||
return "%s" % num
|
||||
|
||||
# Rounding error, return 0
|
||||
elif 0 < num < 1:
|
||||
num = 0
|
||||
if scale != 100:
|
||||
while abs(num) > scale and index < 5:
|
||||
num = num / scale
|
||||
index += 1
|
||||
|
||||
while abs(num) > scale and index < 5:
|
||||
save = num
|
||||
num = num / scale
|
||||
index += 1
|
||||
|
||||
if index == 0:
|
||||
return "%*d" % (sz, num)
|
||||
|
||||
if abs(save / scale) < 10:
|
||||
return "%*.1f%s" % (sz - 1, num, suffix[index])
|
||||
width = sz - (0 if index == 0 else 1)
|
||||
intlen = len("%.0f" % num) # %.0f rounds to nearest int
|
||||
if sint == 1 and isint(num) or width < intlen + 2:
|
||||
decimal = 0
|
||||
else:
|
||||
return "%*d%s" % (sz - 1, num, suffix[index])
|
||||
decimal = 1
|
||||
return "%*.*f%s" % (width, decimal, num, suffix[index])
|
||||
|
||||
|
||||
def print_values():
|
||||
@ -509,131 +613,148 @@ def calculate():
|
||||
|
||||
v = dict()
|
||||
v["time"] = time.strftime("%H:%M:%S", time.localtime())
|
||||
v["hits"] = d["hits"] // sint
|
||||
v["iohs"] = d["iohits"] // sint
|
||||
v["miss"] = d["misses"] // sint
|
||||
v["hits"] = d["hits"] / sint
|
||||
v["iohs"] = d["iohits"] / sint
|
||||
v["miss"] = d["misses"] / sint
|
||||
v["read"] = v["hits"] + v["iohs"] + v["miss"]
|
||||
v["hit%"] = 100 * v["hits"] // v["read"] if v["read"] > 0 else 0
|
||||
v["ioh%"] = 100 * v["iohs"] // v["read"] if v["read"] > 0 else 0
|
||||
v["hit%"] = 100 * v["hits"] / v["read"] if v["read"] > 0 else 0
|
||||
v["ioh%"] = 100 * v["iohs"] / v["read"] if v["read"] > 0 else 0
|
||||
v["miss%"] = 100 - v["hit%"] - v["ioh%"] if v["read"] > 0 else 0
|
||||
|
||||
v["dhit"] = (d["demand_data_hits"] + d["demand_metadata_hits"]) // sint
|
||||
v["dioh"] = (d["demand_data_iohits"] + d["demand_metadata_iohits"]) // sint
|
||||
v["dmis"] = (d["demand_data_misses"] + d["demand_metadata_misses"]) // sint
|
||||
v["dhit"] = (d["demand_data_hits"] + d["demand_metadata_hits"]) / sint
|
||||
v["dioh"] = (d["demand_data_iohits"] + d["demand_metadata_iohits"]) / sint
|
||||
v["dmis"] = (d["demand_data_misses"] + d["demand_metadata_misses"]) / sint
|
||||
|
||||
v["dread"] = v["dhit"] + v["dioh"] + v["dmis"]
|
||||
v["dh%"] = 100 * v["dhit"] // v["dread"] if v["dread"] > 0 else 0
|
||||
v["di%"] = 100 * v["dioh"] // v["dread"] if v["dread"] > 0 else 0
|
||||
v["dh%"] = 100 * v["dhit"] / v["dread"] if v["dread"] > 0 else 0
|
||||
v["di%"] = 100 * v["dioh"] / v["dread"] if v["dread"] > 0 else 0
|
||||
v["dm%"] = 100 - v["dh%"] - v["di%"] if v["dread"] > 0 else 0
|
||||
|
||||
v["ddhit"] = d["demand_data_hits"] // sint
|
||||
v["ddioh"] = d["demand_data_iohits"] // sint
|
||||
v["ddmis"] = d["demand_data_misses"] // sint
|
||||
v["ddhit"] = d["demand_data_hits"] / sint
|
||||
v["ddioh"] = d["demand_data_iohits"] / sint
|
||||
v["ddmis"] = d["demand_data_misses"] / sint
|
||||
|
||||
v["ddread"] = v["ddhit"] + v["ddioh"] + v["ddmis"]
|
||||
v["ddh%"] = 100 * v["ddhit"] // v["ddread"] if v["ddread"] > 0 else 0
|
||||
v["ddi%"] = 100 * v["ddioh"] // v["ddread"] if v["ddread"] > 0 else 0
|
||||
v["ddh%"] = 100 * v["ddhit"] / v["ddread"] if v["ddread"] > 0 else 0
|
||||
v["ddi%"] = 100 * v["ddioh"] / v["ddread"] if v["ddread"] > 0 else 0
|
||||
v["ddm%"] = 100 - v["ddh%"] - v["ddi%"] if v["ddread"] > 0 else 0
|
||||
|
||||
v["dmhit"] = d["demand_metadata_hits"] // sint
|
||||
v["dmioh"] = d["demand_metadata_iohits"] // sint
|
||||
v["dmmis"] = d["demand_metadata_misses"] // sint
|
||||
v["dmhit"] = d["demand_metadata_hits"] / sint
|
||||
v["dmioh"] = d["demand_metadata_iohits"] / sint
|
||||
v["dmmis"] = d["demand_metadata_misses"] / sint
|
||||
|
||||
v["dmread"] = v["dmhit"] + v["dmioh"] + v["dmmis"]
|
||||
v["dmh%"] = 100 * v["dmhit"] // v["dmread"] if v["dmread"] > 0 else 0
|
||||
v["dmi%"] = 100 * v["dmioh"] // v["dmread"] if v["dmread"] > 0 else 0
|
||||
v["dmh%"] = 100 * v["dmhit"] / v["dmread"] if v["dmread"] > 0 else 0
|
||||
v["dmi%"] = 100 * v["dmioh"] / v["dmread"] if v["dmread"] > 0 else 0
|
||||
v["dmm%"] = 100 - v["dmh%"] - v["dmi%"] if v["dmread"] > 0 else 0
|
||||
|
||||
v["phit"] = (d["prefetch_data_hits"] + d["prefetch_metadata_hits"]) // sint
|
||||
v["phit"] = (d["prefetch_data_hits"] + d["prefetch_metadata_hits"]) / sint
|
||||
v["pioh"] = (d["prefetch_data_iohits"] +
|
||||
d["prefetch_metadata_iohits"]) // sint
|
||||
d["prefetch_metadata_iohits"]) / sint
|
||||
v["pmis"] = (d["prefetch_data_misses"] +
|
||||
d["prefetch_metadata_misses"]) // sint
|
||||
d["prefetch_metadata_misses"]) / sint
|
||||
|
||||
v["pread"] = v["phit"] + v["pioh"] + v["pmis"]
|
||||
v["ph%"] = 100 * v["phit"] // v["pread"] if v["pread"] > 0 else 0
|
||||
v["pi%"] = 100 * v["pioh"] // v["pread"] if v["pread"] > 0 else 0
|
||||
v["ph%"] = 100 * v["phit"] / v["pread"] if v["pread"] > 0 else 0
|
||||
v["pi%"] = 100 * v["pioh"] / v["pread"] if v["pread"] > 0 else 0
|
||||
v["pm%"] = 100 - v["ph%"] - v["pi%"] if v["pread"] > 0 else 0
|
||||
|
||||
v["pdhit"] = d["prefetch_data_hits"] // sint
|
||||
v["pdioh"] = d["prefetch_data_iohits"] // sint
|
||||
v["pdmis"] = d["prefetch_data_misses"] // sint
|
||||
v["pdhit"] = d["prefetch_data_hits"] / sint
|
||||
v["pdioh"] = d["prefetch_data_iohits"] / sint
|
||||
v["pdmis"] = d["prefetch_data_misses"] / sint
|
||||
|
||||
v["pdread"] = v["pdhit"] + v["pdioh"] + v["pdmis"]
|
||||
v["pdh%"] = 100 * v["pdhit"] // v["pdread"] if v["pdread"] > 0 else 0
|
||||
v["pdi%"] = 100 * v["pdioh"] // v["pdread"] if v["pdread"] > 0 else 0
|
||||
v["pdh%"] = 100 * v["pdhit"] / v["pdread"] if v["pdread"] > 0 else 0
|
||||
v["pdi%"] = 100 * v["pdioh"] / v["pdread"] if v["pdread"] > 0 else 0
|
||||
v["pdm%"] = 100 - v["pdh%"] - v["pdi%"] if v["pdread"] > 0 else 0
|
||||
|
||||
v["pmhit"] = d["prefetch_metadata_hits"] // sint
|
||||
v["pmioh"] = d["prefetch_metadata_iohits"] // sint
|
||||
v["pmmis"] = d["prefetch_metadata_misses"] // sint
|
||||
v["pmhit"] = d["prefetch_metadata_hits"] / sint
|
||||
v["pmioh"] = d["prefetch_metadata_iohits"] / sint
|
||||
v["pmmis"] = d["prefetch_metadata_misses"] / sint
|
||||
|
||||
v["pmread"] = v["pmhit"] + v["pmioh"] + v["pmmis"]
|
||||
v["pmh%"] = 100 * v["pmhit"] // v["pmread"] if v["pmread"] > 0 else 0
|
||||
v["pmi%"] = 100 * v["pmioh"] // v["pmread"] if v["pmread"] > 0 else 0
|
||||
v["pmh%"] = 100 * v["pmhit"] / v["pmread"] if v["pmread"] > 0 else 0
|
||||
v["pmi%"] = 100 * v["pmioh"] / v["pmread"] if v["pmread"] > 0 else 0
|
||||
v["pmm%"] = 100 - v["pmh%"] - v["pmi%"] if v["pmread"] > 0 else 0
|
||||
|
||||
v["mhit"] = (d["prefetch_metadata_hits"] +
|
||||
d["demand_metadata_hits"]) // sint
|
||||
d["demand_metadata_hits"]) / sint
|
||||
v["mioh"] = (d["prefetch_metadata_iohits"] +
|
||||
d["demand_metadata_iohits"]) // sint
|
||||
d["demand_metadata_iohits"]) / sint
|
||||
v["mmis"] = (d["prefetch_metadata_misses"] +
|
||||
d["demand_metadata_misses"]) // sint
|
||||
d["demand_metadata_misses"]) / sint
|
||||
|
||||
v["mread"] = v["mhit"] + v["mioh"] + v["mmis"]
|
||||
v["mh%"] = 100 * v["mhit"] // v["mread"] if v["mread"] > 0 else 0
|
||||
v["mi%"] = 100 * v["mioh"] // v["mread"] if v["mread"] > 0 else 0
|
||||
v["mh%"] = 100 * v["mhit"] / v["mread"] if v["mread"] > 0 else 0
|
||||
v["mi%"] = 100 * v["mioh"] / v["mread"] if v["mread"] > 0 else 0
|
||||
v["mm%"] = 100 - v["mh%"] - v["mi%"] if v["mread"] > 0 else 0
|
||||
|
||||
v["arcsz"] = cur["size"]
|
||||
v["size"] = cur["size"]
|
||||
v["c"] = cur["c"]
|
||||
v["mfu"] = d["mfu_hits"] // sint
|
||||
v["mru"] = d["mru_hits"] // sint
|
||||
v["mrug"] = d["mru_ghost_hits"] // sint
|
||||
v["mfug"] = d["mfu_ghost_hits"] // sint
|
||||
v["unc"] = d["uncached_hits"] // sint
|
||||
v["eskip"] = d["evict_skip"] // sint
|
||||
v["el2skip"] = d["evict_l2_skip"] // sint
|
||||
v["el2cach"] = d["evict_l2_cached"] // sint
|
||||
v["el2el"] = d["evict_l2_eligible"] // sint
|
||||
v["el2mfu"] = d["evict_l2_eligible_mfu"] // sint
|
||||
v["el2mru"] = d["evict_l2_eligible_mru"] // sint
|
||||
v["el2inel"] = d["evict_l2_ineligible"] // sint
|
||||
v["mtxmis"] = d["mutex_miss"] // sint
|
||||
v["mfu"] = d["mfu_hits"] / sint
|
||||
v["mru"] = d["mru_hits"] / sint
|
||||
v["mrug"] = d["mru_ghost_hits"] / sint
|
||||
v["mfug"] = d["mfu_ghost_hits"] / sint
|
||||
v["unc"] = d["uncached_hits"] / sint
|
||||
v["eskip"] = d["evict_skip"] / sint
|
||||
v["el2skip"] = d["evict_l2_skip"] / sint
|
||||
v["el2cach"] = d["evict_l2_cached"] / sint
|
||||
v["el2el"] = d["evict_l2_eligible"] / sint
|
||||
v["el2mfu"] = d["evict_l2_eligible_mfu"] / sint
|
||||
v["el2mru"] = d["evict_l2_eligible_mru"] / sint
|
||||
v["el2inel"] = d["evict_l2_ineligible"] / sint
|
||||
v["mtxmis"] = d["mutex_miss"] / sint
|
||||
v["ztotal"] = (d["zfetch_hits"] + d["zfetch_future"] + d["zfetch_stride"] +
|
||||
d["zfetch_past"] + d["zfetch_misses"]) // sint
|
||||
v["zhits"] = d["zfetch_hits"] // sint
|
||||
v["zahead"] = (d["zfetch_future"] + d["zfetch_stride"]) // sint
|
||||
v["zpast"] = d["zfetch_past"] // sint
|
||||
v["zmisses"] = d["zfetch_misses"] // sint
|
||||
v["zmax"] = d["zfetch_max_streams"] // sint
|
||||
v["zfuture"] = d["zfetch_future"] // sint
|
||||
v["zstride"] = d["zfetch_stride"] // sint
|
||||
v["zissued"] = d["zfetch_io_issued"] // sint
|
||||
v["zactive"] = d["zfetch_io_active"] // sint
|
||||
d["zfetch_past"] + d["zfetch_misses"]) / sint
|
||||
v["zhits"] = d["zfetch_hits"] / sint
|
||||
v["zahead"] = (d["zfetch_future"] + d["zfetch_stride"]) / sint
|
||||
v["zpast"] = d["zfetch_past"] / sint
|
||||
v["zmisses"] = d["zfetch_misses"] / sint
|
||||
v["zmax"] = d["zfetch_max_streams"] / sint
|
||||
v["zfuture"] = d["zfetch_future"] / sint
|
||||
v["zstride"] = d["zfetch_stride"] / sint
|
||||
v["zissued"] = d["zfetch_io_issued"] / sint
|
||||
v["zactive"] = d["zfetch_io_active"] / sint
|
||||
|
||||
# ARC structural breakdown, ARC types breakdown, ARC states breakdown
|
||||
v["cachessz"] = cur["caches_size"]
|
||||
for fs in fieldstats:
|
||||
fields, stats = fs[0], fs[1:]
|
||||
for field, fieldval in fields.items():
|
||||
for group in stats:
|
||||
for stat, statval in group.items():
|
||||
if stat in ["fields", "percent"] or \
|
||||
("fields" in group and field not in group["fields"]):
|
||||
continue
|
||||
colname = field + stat
|
||||
v[colname] = cur[fieldval[0] + statval[0]]
|
||||
if "percent" in group:
|
||||
v[colname + "%"] = 100 * v[colname] / \
|
||||
v[group["percent"]] if v[group["percent"]] > 0 else 0
|
||||
|
||||
if l2exist:
|
||||
v["l2hits"] = d["l2_hits"] // sint
|
||||
v["l2miss"] = d["l2_misses"] // sint
|
||||
v["l2hits"] = d["l2_hits"] / sint
|
||||
v["l2miss"] = d["l2_misses"] / sint
|
||||
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["l2asize"] = cur["l2_asize"]
|
||||
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["l2pref"] = cur["l2_prefetch_asize"]
|
||||
v["l2mfu"] = cur["l2_mfu_asize"]
|
||||
v["l2mru"] = cur["l2_mru_asize"]
|
||||
v["l2data"] = cur["l2_bufc_data_asize"]
|
||||
v["l2meta"] = cur["l2_bufc_metadata_asize"]
|
||||
v["l2pref%"] = 100 * v["l2pref"] // v["l2asize"]
|
||||
v["l2mfu%"] = 100 * v["l2mfu"] // v["l2asize"]
|
||||
v["l2mru%"] = 100 * v["l2mru"] // v["l2asize"]
|
||||
v["l2data%"] = 100 * v["l2data"] // v["l2asize"]
|
||||
v["l2meta%"] = 100 * v["l2meta"] // v["l2asize"]
|
||||
v["l2pref%"] = 100 * v["l2pref"] / v["l2asize"]
|
||||
v["l2mfu%"] = 100 * v["l2mfu"] / v["l2asize"]
|
||||
v["l2mru%"] = 100 * v["l2mru"] / v["l2asize"]
|
||||
v["l2data%"] = 100 * v["l2data"] / v["l2asize"]
|
||||
v["l2meta%"] = 100 * v["l2meta"] / v["l2asize"]
|
||||
|
||||
v["grow"] = 0 if cur["arc_no_grow"] else 1
|
||||
v["need"] = cur["arc_need_free"]
|
||||
|
@ -1117,7 +1117,7 @@ dump_zap(objset_t *os, uint64_t object, void *data, size_t size)
|
||||
{
|
||||
(void) data, (void) size;
|
||||
zap_cursor_t zc;
|
||||
zap_attribute_t attr;
|
||||
zap_attribute_t *attrp = zap_attribute_long_alloc();
|
||||
void *prop;
|
||||
unsigned i;
|
||||
|
||||
@ -1125,53 +1125,54 @@ dump_zap(objset_t *os, uint64_t object, void *data, size_t size)
|
||||
(void) printf("\n");
|
||||
|
||||
for (zap_cursor_init(&zc, os, object);
|
||||
zap_cursor_retrieve(&zc, &attr) == 0;
|
||||
zap_cursor_retrieve(&zc, attrp) == 0;
|
||||
zap_cursor_advance(&zc)) {
|
||||
boolean_t key64 =
|
||||
!!(zap_getflags(zc.zc_zap) & ZAP_FLAG_UINT64_KEY);
|
||||
|
||||
if (key64)
|
||||
(void) printf("\t\t0x%010llx = ",
|
||||
(u_longlong_t)*(uint64_t *)attr.za_name);
|
||||
(void) printf("\t\t0x%010" PRIu64 "x = ",
|
||||
*(uint64_t *)attrp->za_name);
|
||||
else
|
||||
(void) printf("\t\t%s = ", attr.za_name);
|
||||
(void) printf("\t\t%s = ", attrp->za_name);
|
||||
|
||||
if (attr.za_num_integers == 0) {
|
||||
if (attrp->za_num_integers == 0) {
|
||||
(void) printf("\n");
|
||||
continue;
|
||||
}
|
||||
prop = umem_zalloc(attr.za_num_integers *
|
||||
attr.za_integer_length, UMEM_NOFAIL);
|
||||
prop = umem_zalloc(attrp->za_num_integers *
|
||||
attrp->za_integer_length, UMEM_NOFAIL);
|
||||
|
||||
if (key64)
|
||||
(void) zap_lookup_uint64(os, object,
|
||||
(const uint64_t *)attr.za_name, 1,
|
||||
attr.za_integer_length, attr.za_num_integers,
|
||||
(const uint64_t *)attrp->za_name, 1,
|
||||
attrp->za_integer_length, attrp->za_num_integers,
|
||||
prop);
|
||||
else
|
||||
(void) zap_lookup(os, object, attr.za_name,
|
||||
attr.za_integer_length, attr.za_num_integers,
|
||||
(void) zap_lookup(os, object, attrp->za_name,
|
||||
attrp->za_integer_length, attrp->za_num_integers,
|
||||
prop);
|
||||
|
||||
if (attr.za_integer_length == 1 && !key64) {
|
||||
if (strcmp(attr.za_name,
|
||||
if (attrp->za_integer_length == 1 && !key64) {
|
||||
if (strcmp(attrp->za_name,
|
||||
DSL_CRYPTO_KEY_MASTER_KEY) == 0 ||
|
||||
strcmp(attr.za_name,
|
||||
strcmp(attrp->za_name,
|
||||
DSL_CRYPTO_KEY_HMAC_KEY) == 0 ||
|
||||
strcmp(attr.za_name, DSL_CRYPTO_KEY_IV) == 0 ||
|
||||
strcmp(attr.za_name, DSL_CRYPTO_KEY_MAC) == 0 ||
|
||||
strcmp(attr.za_name, DMU_POOL_CHECKSUM_SALT) == 0) {
|
||||
strcmp(attrp->za_name, DSL_CRYPTO_KEY_IV) == 0 ||
|
||||
strcmp(attrp->za_name, DSL_CRYPTO_KEY_MAC) == 0 ||
|
||||
strcmp(attrp->za_name,
|
||||
DMU_POOL_CHECKSUM_SALT) == 0) {
|
||||
uint8_t *u8 = prop;
|
||||
|
||||
for (i = 0; i < attr.za_num_integers; i++) {
|
||||
for (i = 0; i < attrp->za_num_integers; i++) {
|
||||
(void) printf("%02x", u8[i]);
|
||||
}
|
||||
} else {
|
||||
(void) printf("%s", (char *)prop);
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < attr.za_num_integers; i++) {
|
||||
switch (attr.za_integer_length) {
|
||||
for (i = 0; i < attrp->za_num_integers; i++) {
|
||||
switch (attrp->za_integer_length) {
|
||||
case 1:
|
||||
(void) printf("%u ",
|
||||
((uint8_t *)prop)[i]);
|
||||
@ -1192,9 +1193,11 @@ dump_zap(objset_t *os, uint64_t object, void *data, size_t size)
|
||||
}
|
||||
}
|
||||
(void) printf("\n");
|
||||
umem_free(prop, attr.za_num_integers * attr.za_integer_length);
|
||||
umem_free(prop,
|
||||
attrp->za_num_integers * attrp->za_integer_length);
|
||||
}
|
||||
zap_cursor_fini(&zc);
|
||||
zap_attribute_free(attrp);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1295,26 +1298,27 @@ dump_sa_attrs(objset_t *os, uint64_t object, void *data, size_t size)
|
||||
{
|
||||
(void) data, (void) size;
|
||||
zap_cursor_t zc;
|
||||
zap_attribute_t attr;
|
||||
zap_attribute_t *attrp = zap_attribute_alloc();
|
||||
|
||||
dump_zap_stats(os, object);
|
||||
(void) printf("\n");
|
||||
|
||||
for (zap_cursor_init(&zc, os, object);
|
||||
zap_cursor_retrieve(&zc, &attr) == 0;
|
||||
zap_cursor_retrieve(&zc, attrp) == 0;
|
||||
zap_cursor_advance(&zc)) {
|
||||
(void) printf("\t\t%s = ", attr.za_name);
|
||||
if (attr.za_num_integers == 0) {
|
||||
(void) printf("\t\t%s = ", attrp->za_name);
|
||||
if (attrp->za_num_integers == 0) {
|
||||
(void) printf("\n");
|
||||
continue;
|
||||
}
|
||||
(void) printf(" %llx : [%d:%d:%d]\n",
|
||||
(u_longlong_t)attr.za_first_integer,
|
||||
(int)ATTR_LENGTH(attr.za_first_integer),
|
||||
(int)ATTR_BSWAP(attr.za_first_integer),
|
||||
(int)ATTR_NUM(attr.za_first_integer));
|
||||
(u_longlong_t)attrp->za_first_integer,
|
||||
(int)ATTR_LENGTH(attrp->za_first_integer),
|
||||
(int)ATTR_BSWAP(attrp->za_first_integer),
|
||||
(int)ATTR_NUM(attrp->za_first_integer));
|
||||
}
|
||||
zap_cursor_fini(&zc);
|
||||
zap_attribute_free(attrp);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1322,7 +1326,7 @@ dump_sa_layouts(objset_t *os, uint64_t object, void *data, size_t size)
|
||||
{
|
||||
(void) data, (void) size;
|
||||
zap_cursor_t zc;
|
||||
zap_attribute_t attr;
|
||||
zap_attribute_t *attrp = zap_attribute_alloc();
|
||||
uint16_t *layout_attrs;
|
||||
unsigned i;
|
||||
|
||||
@ -1330,29 +1334,30 @@ dump_sa_layouts(objset_t *os, uint64_t object, void *data, size_t size)
|
||||
(void) printf("\n");
|
||||
|
||||
for (zap_cursor_init(&zc, os, object);
|
||||
zap_cursor_retrieve(&zc, &attr) == 0;
|
||||
zap_cursor_retrieve(&zc, attrp) == 0;
|
||||
zap_cursor_advance(&zc)) {
|
||||
(void) printf("\t\t%s = [", attr.za_name);
|
||||
if (attr.za_num_integers == 0) {
|
||||
(void) printf("\t\t%s = [", attrp->za_name);
|
||||
if (attrp->za_num_integers == 0) {
|
||||
(void) printf("\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
VERIFY(attr.za_integer_length == 2);
|
||||
layout_attrs = umem_zalloc(attr.za_num_integers *
|
||||
attr.za_integer_length, UMEM_NOFAIL);
|
||||
VERIFY(attrp->za_integer_length == 2);
|
||||
layout_attrs = umem_zalloc(attrp->za_num_integers *
|
||||
attrp->za_integer_length, UMEM_NOFAIL);
|
||||
|
||||
VERIFY(zap_lookup(os, object, attr.za_name,
|
||||
attr.za_integer_length,
|
||||
attr.za_num_integers, layout_attrs) == 0);
|
||||
VERIFY(zap_lookup(os, object, attrp->za_name,
|
||||
attrp->za_integer_length,
|
||||
attrp->za_num_integers, layout_attrs) == 0);
|
||||
|
||||
for (i = 0; i != attr.za_num_integers; i++)
|
||||
for (i = 0; i != attrp->za_num_integers; i++)
|
||||
(void) printf(" %d ", (int)layout_attrs[i]);
|
||||
(void) printf("]\n");
|
||||
umem_free(layout_attrs,
|
||||
attr.za_num_integers * attr.za_integer_length);
|
||||
attrp->za_num_integers * attrp->za_integer_length);
|
||||
}
|
||||
zap_cursor_fini(&zc);
|
||||
zap_attribute_free(attrp);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1360,7 +1365,7 @@ dump_zpldir(objset_t *os, uint64_t object, void *data, size_t size)
|
||||
{
|
||||
(void) data, (void) size;
|
||||
zap_cursor_t zc;
|
||||
zap_attribute_t attr;
|
||||
zap_attribute_t *attrp = zap_attribute_long_alloc();
|
||||
const char *typenames[] = {
|
||||
/* 0 */ "not specified",
|
||||
/* 1 */ "FIFO",
|
||||
@ -1384,13 +1389,14 @@ dump_zpldir(objset_t *os, uint64_t object, void *data, size_t size)
|
||||
(void) printf("\n");
|
||||
|
||||
for (zap_cursor_init(&zc, os, object);
|
||||
zap_cursor_retrieve(&zc, &attr) == 0;
|
||||
zap_cursor_retrieve(&zc, attrp) == 0;
|
||||
zap_cursor_advance(&zc)) {
|
||||
(void) printf("\t\t%s = %lld (type: %s)\n",
|
||||
attr.za_name, ZFS_DIRENT_OBJ(attr.za_first_integer),
|
||||
typenames[ZFS_DIRENT_TYPE(attr.za_first_integer)]);
|
||||
attrp->za_name, ZFS_DIRENT_OBJ(attrp->za_first_integer),
|
||||
typenames[ZFS_DIRENT_TYPE(attrp->za_first_integer)]);
|
||||
}
|
||||
zap_cursor_fini(&zc);
|
||||
zap_attribute_free(attrp);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -2155,23 +2161,25 @@ dump_brt(spa_t *spa)
|
||||
continue;
|
||||
|
||||
zap_cursor_t zc;
|
||||
zap_attribute_t za;
|
||||
zap_attribute_t *za = zap_attribute_alloc();
|
||||
for (zap_cursor_init(&zc, brt->brt_mos, brtvd->bv_mos_entries);
|
||||
zap_cursor_retrieve(&zc, &za) == 0;
|
||||
zap_cursor_retrieve(&zc, za) == 0;
|
||||
zap_cursor_advance(&zc)) {
|
||||
uint64_t refcnt;
|
||||
VERIFY0(zap_lookup_uint64(brt->brt_mos,
|
||||
brtvd->bv_mos_entries,
|
||||
(const uint64_t *)za.za_name, 1,
|
||||
za.za_integer_length, za.za_num_integers, &refcnt));
|
||||
(const uint64_t *)za->za_name, 1,
|
||||
za->za_integer_length, za->za_num_integers,
|
||||
&refcnt));
|
||||
|
||||
uint64_t offset = *(const uint64_t *)za.za_name;
|
||||
uint64_t offset = *(const uint64_t *)za->za_name;
|
||||
|
||||
snprintf(dva, sizeof (dva), "%" PRIu64 ":%llx", vdevid,
|
||||
(u_longlong_t)offset);
|
||||
printf("%-16s %-10llu\n", dva, (u_longlong_t)refcnt);
|
||||
}
|
||||
zap_cursor_fini(&zc);
|
||||
zap_attribute_free(za);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2953,28 +2961,30 @@ static void
|
||||
dump_bookmarks(objset_t *os, int verbosity)
|
||||
{
|
||||
zap_cursor_t zc;
|
||||
zap_attribute_t attr;
|
||||
zap_attribute_t *attrp;
|
||||
dsl_dataset_t *ds = dmu_objset_ds(os);
|
||||
dsl_pool_t *dp = spa_get_dsl(os->os_spa);
|
||||
objset_t *mos = os->os_spa->spa_meta_objset;
|
||||
if (verbosity < 4)
|
||||
return;
|
||||
attrp = zap_attribute_alloc();
|
||||
dsl_pool_config_enter(dp, FTAG);
|
||||
|
||||
for (zap_cursor_init(&zc, mos, ds->ds_bookmarks_obj);
|
||||
zap_cursor_retrieve(&zc, &attr) == 0;
|
||||
zap_cursor_retrieve(&zc, attrp) == 0;
|
||||
zap_cursor_advance(&zc)) {
|
||||
char osname[ZFS_MAX_DATASET_NAME_LEN];
|
||||
char buf[ZFS_MAX_DATASET_NAME_LEN];
|
||||
int len;
|
||||
dmu_objset_name(os, osname);
|
||||
len = snprintf(buf, sizeof (buf), "%s#%s", osname,
|
||||
attr.za_name);
|
||||
attrp->za_name);
|
||||
VERIFY3S(len, <, ZFS_MAX_DATASET_NAME_LEN);
|
||||
(void) dump_bookmark(dp, buf, verbosity >= 5, verbosity >= 6);
|
||||
}
|
||||
zap_cursor_fini(&zc);
|
||||
dsl_pool_config_exit(dp, FTAG);
|
||||
zap_attribute_free(attrp);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -6857,18 +6867,19 @@ iterate_deleted_livelists(spa_t *spa, ll_iter_t func, void *arg)
|
||||
ASSERT0(err);
|
||||
|
||||
zap_cursor_t zc;
|
||||
zap_attribute_t attr;
|
||||
zap_attribute_t *attrp = zap_attribute_alloc();
|
||||
dsl_deadlist_t ll;
|
||||
/* NULL out os prior to dsl_deadlist_open in case it's garbage */
|
||||
ll.dl_os = NULL;
|
||||
for (zap_cursor_init(&zc, mos, zap_obj);
|
||||
zap_cursor_retrieve(&zc, &attr) == 0;
|
||||
zap_cursor_retrieve(&zc, attrp) == 0;
|
||||
(void) zap_cursor_advance(&zc)) {
|
||||
dsl_deadlist_open(&ll, mos, attr.za_first_integer);
|
||||
dsl_deadlist_open(&ll, mos, attrp->za_first_integer);
|
||||
func(&ll, arg);
|
||||
dsl_deadlist_close(&ll);
|
||||
}
|
||||
zap_cursor_fini(&zc);
|
||||
zap_attribute_free(attrp);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -8082,13 +8093,14 @@ static void
|
||||
errorlog_count_refd(objset_t *mos, uint64_t errlog)
|
||||
{
|
||||
zap_cursor_t zc;
|
||||
zap_attribute_t za;
|
||||
zap_attribute_t *za = zap_attribute_alloc();
|
||||
for (zap_cursor_init(&zc, mos, errlog);
|
||||
zap_cursor_retrieve(&zc, &za) == 0;
|
||||
zap_cursor_retrieve(&zc, za) == 0;
|
||||
zap_cursor_advance(&zc)) {
|
||||
mos_obj_refd(za.za_first_integer);
|
||||
mos_obj_refd(za->za_first_integer);
|
||||
}
|
||||
zap_cursor_fini(&zc);
|
||||
zap_attribute_free(za);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -8788,7 +8800,7 @@ zdb_read_block(char *thing, spa_t *spa)
|
||||
void *lbuf, *buf;
|
||||
char *s, *p, *dup, *flagstr, *sizes, *tmp = NULL;
|
||||
const char *vdev, *errmsg = NULL;
|
||||
int i, error;
|
||||
int i, len, error;
|
||||
boolean_t borrowed = B_FALSE, found = B_FALSE;
|
||||
|
||||
dup = strdup(thing);
|
||||
@ -8816,7 +8828,8 @@ zdb_read_block(char *thing, spa_t *spa)
|
||||
for (s = strtok_r(flagstr, ":", &tmp);
|
||||
s != NULL;
|
||||
s = strtok_r(NULL, ":", &tmp)) {
|
||||
for (i = 0; i < strlen(flagstr); i++) {
|
||||
len = strlen(flagstr);
|
||||
for (i = 0; i < len; i++) {
|
||||
int bit = flagbits[(uchar_t)flagstr[i]];
|
||||
|
||||
if (bit == 0) {
|
||||
@ -9086,13 +9099,14 @@ zdb_embedded_block(char *thing)
|
||||
static boolean_t
|
||||
zdb_numeric(char *str)
|
||||
{
|
||||
int i = 0;
|
||||
int i = 0, len;
|
||||
|
||||
if (strlen(str) == 0)
|
||||
len = strlen(str);
|
||||
if (len == 0)
|
||||
return (B_FALSE);
|
||||
if (strncmp(str, "0x", 2) == 0 || strncmp(str, "0X", 2) == 0)
|
||||
i = 2;
|
||||
for (; i < strlen(str); i++) {
|
||||
for (; i < len; i++) {
|
||||
if (!isxdigit(str[i]))
|
||||
return (B_FALSE);
|
||||
}
|
||||
|
@ -64,7 +64,8 @@ static void
|
||||
zil_prt_rec_create(zilog_t *zilog, int txtype, const void *arg)
|
||||
{
|
||||
(void) zilog;
|
||||
const lr_create_t *lr = arg;
|
||||
const lr_create_t *lrc = arg;
|
||||
const _lr_create_t *lr = &lrc->lr_create;
|
||||
time_t crtime = lr->lr_crtime[0];
|
||||
char *name, *link;
|
||||
lr_attr_t *lrattr;
|
||||
@ -121,7 +122,8 @@ static void
|
||||
zil_prt_rec_rename(zilog_t *zilog, int txtype, const void *arg)
|
||||
{
|
||||
(void) zilog, (void) txtype;
|
||||
const lr_rename_t *lr = arg;
|
||||
const lr_rename_t *lrr = arg;
|
||||
const _lr_rename_t *lr = &lrr->lr_rename;
|
||||
char *snm = (char *)(lr + 1);
|
||||
char *tnm = snm + strlen(snm) + 1;
|
||||
|
||||
|
@ -71,6 +71,7 @@ typedef struct zfs_case_data {
|
||||
uint64_t zc_ena;
|
||||
uint64_t zc_pool_guid;
|
||||
uint64_t zc_vdev_guid;
|
||||
uint64_t zc_parent_guid;
|
||||
int zc_pool_state;
|
||||
char zc_serd_checksum[MAX_SERDLEN];
|
||||
char zc_serd_io[MAX_SERDLEN];
|
||||
@ -181,10 +182,10 @@ zfs_case_unserialize(fmd_hdl_t *hdl, fmd_case_t *cp)
|
||||
}
|
||||
|
||||
/*
|
||||
* count other unique slow-io cases in a pool
|
||||
* Return count of other unique SERD cases under same vdev parent
|
||||
*/
|
||||
static uint_t
|
||||
zfs_other_slow_cases(fmd_hdl_t *hdl, const zfs_case_data_t *zfs_case)
|
||||
zfs_other_serd_cases(fmd_hdl_t *hdl, const zfs_case_data_t *zfs_case)
|
||||
{
|
||||
zfs_case_t *zcp;
|
||||
uint_t cases = 0;
|
||||
@ -206,10 +207,32 @@ zfs_other_slow_cases(fmd_hdl_t *hdl, const zfs_case_data_t *zfs_case)
|
||||
|
||||
for (zcp = uu_list_first(zfs_cases); zcp != NULL;
|
||||
zcp = uu_list_next(zfs_cases, zcp)) {
|
||||
if (zcp->zc_data.zc_pool_guid == zfs_case->zc_pool_guid &&
|
||||
zcp->zc_data.zc_vdev_guid != zfs_case->zc_vdev_guid &&
|
||||
zcp->zc_data.zc_serd_slow_io[0] != '\0' &&
|
||||
fmd_serd_active(hdl, zcp->zc_data.zc_serd_slow_io)) {
|
||||
zfs_case_data_t *zcd = &zcp->zc_data;
|
||||
|
||||
/*
|
||||
* must be same pool and parent vdev but different leaf vdev
|
||||
*/
|
||||
if (zcd->zc_pool_guid != zfs_case->zc_pool_guid ||
|
||||
zcd->zc_parent_guid != zfs_case->zc_parent_guid ||
|
||||
zcd->zc_vdev_guid == zfs_case->zc_vdev_guid) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if there is another active serd case besides zfs_case
|
||||
*
|
||||
* Only one serd engine will be assigned to the case
|
||||
*/
|
||||
if (zcd->zc_serd_checksum[0] == zfs_case->zc_serd_checksum[0] &&
|
||||
fmd_serd_active(hdl, zcd->zc_serd_checksum)) {
|
||||
cases++;
|
||||
}
|
||||
if (zcd->zc_serd_io[0] == zfs_case->zc_serd_io[0] &&
|
||||
fmd_serd_active(hdl, zcd->zc_serd_io)) {
|
||||
cases++;
|
||||
}
|
||||
if (zcd->zc_serd_slow_io[0] == zfs_case->zc_serd_slow_io[0] &&
|
||||
fmd_serd_active(hdl, zcd->zc_serd_slow_io)) {
|
||||
cases++;
|
||||
}
|
||||
}
|
||||
@ -502,6 +525,34 @@ zfs_ereport_when(fmd_hdl_t *hdl, nvlist_t *nvl, er_timeval_t *when)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Record the specified event in the SERD engine and return a
|
||||
* boolean value indicating whether or not the engine fired as
|
||||
* the result of inserting this event.
|
||||
*
|
||||
* When the pool has similar active cases on other vdevs, then
|
||||
* the fired state is disregarded and the case is retired.
|
||||
*/
|
||||
static int
|
||||
zfs_fm_serd_record(fmd_hdl_t *hdl, const char *name, fmd_event_t *ep,
|
||||
zfs_case_t *zcp, const char *err_type)
|
||||
{
|
||||
int fired = fmd_serd_record(hdl, name, ep);
|
||||
int peers = 0;
|
||||
|
||||
if (fired && (peers = zfs_other_serd_cases(hdl, &zcp->zc_data)) > 0) {
|
||||
fmd_hdl_debug(hdl, "pool %llu is tracking %d other %s cases "
|
||||
"-- skip faulting the vdev %llu",
|
||||
(u_longlong_t)zcp->zc_data.zc_pool_guid,
|
||||
peers, err_type,
|
||||
(u_longlong_t)zcp->zc_data.zc_vdev_guid);
|
||||
zfs_case_retire(hdl, zcp);
|
||||
fired = 0;
|
||||
}
|
||||
|
||||
return (fired);
|
||||
}
|
||||
|
||||
/*
|
||||
* Main fmd entry point.
|
||||
*/
|
||||
@ -510,7 +561,7 @@ zfs_fm_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class)
|
||||
{
|
||||
zfs_case_t *zcp, *dcp;
|
||||
int32_t pool_state;
|
||||
uint64_t ena, pool_guid, vdev_guid;
|
||||
uint64_t ena, pool_guid, vdev_guid, parent_guid;
|
||||
uint64_t checksum_n, checksum_t;
|
||||
uint64_t io_n, io_t;
|
||||
er_timeval_t pool_load;
|
||||
@ -600,6 +651,9 @@ zfs_fm_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class)
|
||||
if (nvlist_lookup_uint64(nvl,
|
||||
FM_EREPORT_PAYLOAD_ZFS_VDEV_GUID, &vdev_guid) != 0)
|
||||
vdev_guid = 0;
|
||||
if (nvlist_lookup_uint64(nvl,
|
||||
FM_EREPORT_PAYLOAD_ZFS_PARENT_GUID, &parent_guid) != 0)
|
||||
parent_guid = 0;
|
||||
if (nvlist_lookup_uint64(nvl, FM_EREPORT_ENA, &ena) != 0)
|
||||
ena = 0;
|
||||
|
||||
@ -710,6 +764,7 @@ zfs_fm_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class)
|
||||
data.zc_ena = ena;
|
||||
data.zc_pool_guid = pool_guid;
|
||||
data.zc_vdev_guid = vdev_guid;
|
||||
data.zc_parent_guid = parent_guid;
|
||||
data.zc_pool_state = (int)pool_state;
|
||||
|
||||
fmd_buf_write(hdl, cs, CASE_DATA, &data, sizeof (data));
|
||||
@ -872,8 +927,10 @@ zfs_fm_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class)
|
||||
SEC2NSEC(io_t));
|
||||
zfs_case_serialize(zcp);
|
||||
}
|
||||
if (fmd_serd_record(hdl, zcp->zc_data.zc_serd_io, ep))
|
||||
if (zfs_fm_serd_record(hdl, zcp->zc_data.zc_serd_io,
|
||||
ep, zcp, "io error")) {
|
||||
checkremove = B_TRUE;
|
||||
}
|
||||
} else if (fmd_nvl_class_match(hdl, nvl,
|
||||
ZFS_MAKE_EREPORT(FM_EREPORT_ZFS_DELAY))) {
|
||||
uint64_t slow_io_n, slow_io_t;
|
||||
@ -899,25 +956,10 @@ zfs_fm_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class)
|
||||
}
|
||||
/* Pass event to SERD engine and see if this triggers */
|
||||
if (zcp->zc_data.zc_serd_slow_io[0] != '\0' &&
|
||||
fmd_serd_record(hdl, zcp->zc_data.zc_serd_slow_io,
|
||||
ep)) {
|
||||
/*
|
||||
* Ignore a slow io diagnosis when other
|
||||
* VDEVs in the pool show signs of being slow.
|
||||
*/
|
||||
if (zfs_other_slow_cases(hdl, &zcp->zc_data)) {
|
||||
zfs_case_retire(hdl, zcp);
|
||||
fmd_hdl_debug(hdl, "pool %llu has "
|
||||
"multiple slow io cases -- skip "
|
||||
"degrading vdev %llu",
|
||||
(u_longlong_t)
|
||||
zcp->zc_data.zc_pool_guid,
|
||||
(u_longlong_t)
|
||||
zcp->zc_data.zc_vdev_guid);
|
||||
} else {
|
||||
zfs_case_solve(hdl, zcp,
|
||||
"fault.fs.zfs.vdev.slow_io");
|
||||
}
|
||||
zfs_fm_serd_record(hdl,
|
||||
zcp->zc_data.zc_serd_slow_io, ep, zcp, "slow io")) {
|
||||
zfs_case_solve(hdl, zcp,
|
||||
"fault.fs.zfs.vdev.slow_io");
|
||||
}
|
||||
} else if (fmd_nvl_class_match(hdl, nvl,
|
||||
ZFS_MAKE_EREPORT(FM_EREPORT_ZFS_CHECKSUM))) {
|
||||
@ -968,8 +1010,9 @@ zfs_fm_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class)
|
||||
SEC2NSEC(checksum_t));
|
||||
zfs_case_serialize(zcp);
|
||||
}
|
||||
if (fmd_serd_record(hdl,
|
||||
zcp->zc_data.zc_serd_checksum, ep)) {
|
||||
if (zfs_fm_serd_record(hdl,
|
||||
zcp->zc_data.zc_serd_checksum, ep, zcp,
|
||||
"checksum")) {
|
||||
zfs_case_solve(hdl, zcp,
|
||||
"fault.fs.zfs.vdev.checksum");
|
||||
}
|
||||
|
@ -203,26 +203,27 @@ static void
|
||||
dump_obj(objset_t *os, uint64_t obj, const char *name)
|
||||
{
|
||||
zap_cursor_t zc;
|
||||
zap_attribute_t za;
|
||||
zap_attribute_t *za = zap_attribute_long_alloc();
|
||||
|
||||
(void) printf("%s_obj:\n", name);
|
||||
|
||||
for (zap_cursor_init(&zc, os, obj);
|
||||
zap_cursor_retrieve(&zc, &za) == 0;
|
||||
zap_cursor_retrieve(&zc, za) == 0;
|
||||
zap_cursor_advance(&zc)) {
|
||||
if (za.za_integer_length == 8) {
|
||||
ASSERT(za.za_num_integers == 1);
|
||||
if (za->za_integer_length == 8) {
|
||||
ASSERT(za->za_num_integers == 1);
|
||||
(void) printf("\t%s = %llu\n",
|
||||
za.za_name, (u_longlong_t)za.za_first_integer);
|
||||
za->za_name, (u_longlong_t)za->za_first_integer);
|
||||
} else {
|
||||
ASSERT(za.za_integer_length == 1);
|
||||
ASSERT(za->za_integer_length == 1);
|
||||
char val[1024];
|
||||
VERIFY(zap_lookup(os, obj, za.za_name,
|
||||
VERIFY(zap_lookup(os, obj, za->za_name,
|
||||
1, sizeof (val), val) == 0);
|
||||
(void) printf("\t%s = %s\n", za.za_name, val);
|
||||
(void) printf("\t%s = %s\n", za->za_name, val);
|
||||
}
|
||||
}
|
||||
zap_cursor_fini(&zc);
|
||||
zap_attribute_free(za);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -140,12 +140,14 @@ dist_zpoolcompat_DATA = \
|
||||
%D%/compatibility.d/freebsd-11.2 \
|
||||
%D%/compatibility.d/freebsd-11.3 \
|
||||
%D%/compatibility.d/freenas-9.10.2 \
|
||||
%D%/compatibility.d/grub2 \
|
||||
%D%/compatibility.d/grub2-2.06 \
|
||||
%D%/compatibility.d/grub2-2.12 \
|
||||
%D%/compatibility.d/openzfs-2.0-freebsd \
|
||||
%D%/compatibility.d/openzfs-2.0-linux \
|
||||
%D%/compatibility.d/openzfs-2.1-freebsd \
|
||||
%D%/compatibility.d/openzfs-2.1-linux \
|
||||
%D%/compatibility.d/openzfs-2.2 \
|
||||
%D%/compatibility.d/openzfs-2.3 \
|
||||
%D%/compatibility.d/openzfsonosx-1.7.0 \
|
||||
%D%/compatibility.d/openzfsonosx-1.8.1 \
|
||||
%D%/compatibility.d/openzfsonosx-1.9.3 \
|
||||
@ -171,6 +173,7 @@ zpoolcompatlinks = \
|
||||
"freebsd-11.3 freebsd-12.2" \
|
||||
"freebsd-11.3 freebsd-12.3" \
|
||||
"freebsd-11.3 freebsd-12.4" \
|
||||
"grub2-2.12 grub2" \
|
||||
"openzfs-2.1-freebsd freebsd-13.0" \
|
||||
"openzfs-2.1-freebsd freebsd-13.1" \
|
||||
"openzfs-2.1-freebsd freebsd-13.2" \
|
||||
@ -182,7 +185,9 @@ zpoolcompatlinks = \
|
||||
"zol-0.8 ubuntu-20.04" \
|
||||
"openzfs-2.1-linux ubuntu-22.04" \
|
||||
"openzfs-2.2 openzfs-2.2-linux" \
|
||||
"openzfs-2.2 openzfs-2.2-freebsd"
|
||||
"openzfs-2.2 openzfs-2.2-freebsd" \
|
||||
"openzfs-2.3 openzfs-2.3-linux" \
|
||||
"openzfs-2.3 openzfs-2.3-freebsd"
|
||||
|
||||
zpoolconfdir = $(sysconfdir)/zfs/zpool.d
|
||||
INSTALL_DATA_HOOKS += zpool-install-data-hook
|
||||
|
23
sys/contrib/openzfs/cmd/zpool/compatibility.d/grub2-2.06
Normal file
23
sys/contrib/openzfs/cmd/zpool/compatibility.d/grub2-2.06
Normal file
@ -0,0 +1,23 @@
|
||||
# Features which are supported by GRUB2 versions prior to v2.12.
|
||||
#
|
||||
# GRUB is not able to detect ZFS pool if snaphsot of top level boot pool
|
||||
# is created. This issue is observed with GRUB versions before v2.12 if
|
||||
# extensible_dataset feature is enabled on ZFS boot pool.
|
||||
#
|
||||
# This file lists all read-only comaptible features except
|
||||
# extensible_dataset and any other feature that depends on it.
|
||||
#
|
||||
allocation_classes
|
||||
async_destroy
|
||||
block_cloning
|
||||
device_rebuild
|
||||
embedded_data
|
||||
empty_bpobj
|
||||
enabled_txg
|
||||
hole_birth
|
||||
log_spacemap
|
||||
lz4_compress
|
||||
resilver_defer
|
||||
spacemap_histogram
|
||||
spacemap_v2
|
||||
zpool_checkpoint
|
@ -1,4 +1,4 @@
|
||||
# Features which are supported by GRUB2
|
||||
# Features which are supported by GRUB2 versions from v2.12 onwards.
|
||||
allocation_classes
|
||||
async_destroy
|
||||
block_cloning
|
45
sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.3
Normal file
45
sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.3
Normal file
@ -0,0 +1,45 @@
|
||||
# Features supported by OpenZFS 2.3 on Linux and FreeBSD
|
||||
allocation_classes
|
||||
async_destroy
|
||||
blake3
|
||||
block_cloning
|
||||
bookmark_v2
|
||||
bookmark_written
|
||||
bookmarks
|
||||
device_rebuild
|
||||
device_removal
|
||||
draid
|
||||
edonr
|
||||
embedded_data
|
||||
empty_bpobj
|
||||
enabled_txg
|
||||
encryption
|
||||
extensible_dataset
|
||||
fast_dedup
|
||||
filesystem_limits
|
||||
head_errlog
|
||||
hole_birth
|
||||
large_blocks
|
||||
large_dnode
|
||||
large_microzap
|
||||
livelist
|
||||
log_spacemap
|
||||
longname
|
||||
lz4_compress
|
||||
multi_vdev_crash_dump
|
||||
obsolete_counts
|
||||
project_quota
|
||||
raidz_expansion
|
||||
redacted_datasets
|
||||
redaction_bookmarks
|
||||
redaction_list_spill
|
||||
resilver_defer
|
||||
sha512
|
||||
skein
|
||||
spacemap_histogram
|
||||
spacemap_v2
|
||||
userobj_accounting
|
||||
vdev_zaps_v2
|
||||
zilsaxattr
|
||||
zpool_checkpoint
|
||||
zstd_compress
|
@ -522,7 +522,7 @@ get_usage(zpool_help_t idx)
|
||||
return (gettext("\tstatus [--power] [-j [--json-int, "
|
||||
"--json-flat-vdevs, ...\n"
|
||||
"\t --json-pool-key-guid]] [-c [script1,script2,...]] "
|
||||
"[-DegiLpPstvx] ...\n"
|
||||
"[-dDegiLpPstvx] ...\n"
|
||||
"\t [-T d|u] [pool] [interval [count]]\n"));
|
||||
case HELP_UPGRADE:
|
||||
return (gettext("\tupgrade\n"
|
||||
@ -2602,6 +2602,7 @@ typedef struct status_cbdata {
|
||||
boolean_t cb_print_unhealthy;
|
||||
boolean_t cb_print_status;
|
||||
boolean_t cb_print_slow_ios;
|
||||
boolean_t cb_print_dio_verify;
|
||||
boolean_t cb_print_vdev_init;
|
||||
boolean_t cb_print_vdev_trim;
|
||||
vdev_cmd_data_list_t *vcdl;
|
||||
@ -2879,7 +2880,7 @@ print_status_config(zpool_handle_t *zhp, status_cbdata_t *cb, const char *name,
|
||||
uint_t c, i, vsc, children;
|
||||
pool_scan_stat_t *ps = NULL;
|
||||
vdev_stat_t *vs;
|
||||
char rbuf[6], wbuf[6], cbuf[6];
|
||||
char rbuf[6], wbuf[6], cbuf[6], dbuf[6];
|
||||
char *vname;
|
||||
uint64_t notpresent;
|
||||
spare_cbdata_t spare_cb;
|
||||
@ -2997,6 +2998,17 @@ print_status_config(zpool_handle_t *zhp, status_cbdata_t *cb, const char *name,
|
||||
printf(" %5s", "-");
|
||||
}
|
||||
}
|
||||
if (VDEV_STAT_VALID(vs_dio_verify_errors, vsc) &&
|
||||
cb->cb_print_dio_verify) {
|
||||
zfs_nicenum(vs->vs_dio_verify_errors, dbuf,
|
||||
sizeof (dbuf));
|
||||
|
||||
if (cb->cb_literal)
|
||||
printf(" %5llu",
|
||||
(u_longlong_t)vs->vs_dio_verify_errors);
|
||||
else
|
||||
printf(" %5s", dbuf);
|
||||
}
|
||||
}
|
||||
|
||||
if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT,
|
||||
@ -10873,6 +10885,10 @@ status_callback(zpool_handle_t *zhp, void *data)
|
||||
printf_color(ANSI_BOLD, " %5s", gettext("POWER"));
|
||||
}
|
||||
|
||||
if (cbp->cb_print_dio_verify) {
|
||||
printf_color(ANSI_BOLD, " %5s", gettext("DIO"));
|
||||
}
|
||||
|
||||
if (cbp->vcdl != NULL)
|
||||
print_cmd_columns(cbp->vcdl, 0);
|
||||
|
||||
@ -10921,10 +10937,11 @@ status_callback(zpool_handle_t *zhp, void *data)
|
||||
}
|
||||
|
||||
/*
|
||||
* zpool status [-c [script1,script2,...]] [-DegiLpPstvx] [--power] [-T d|u] ...
|
||||
* [pool] [interval [count]]
|
||||
* zpool status [-c [script1,script2,...]] [-dDegiLpPstvx] [--power] ...
|
||||
* [-T d|u] [pool] [interval [count]]
|
||||
*
|
||||
* -c CMD For each vdev, run command CMD
|
||||
* -d Display Direct I/O write verify errors
|
||||
* -D Display dedup status (undocumented)
|
||||
* -e Display only unhealthy vdevs
|
||||
* -g Display guid for individual vdev name.
|
||||
@ -10967,7 +10984,7 @@ zpool_do_status(int argc, char **argv)
|
||||
};
|
||||
|
||||
/* check options */
|
||||
while ((c = getopt_long(argc, argv, "c:jDegiLpPstT:vx", long_options,
|
||||
while ((c = getopt_long(argc, argv, "c:jdDegiLpPstT:vx", long_options,
|
||||
NULL)) != -1) {
|
||||
switch (c) {
|
||||
case 'c':
|
||||
@ -10994,6 +11011,9 @@ zpool_do_status(int argc, char **argv)
|
||||
}
|
||||
cmd = optarg;
|
||||
break;
|
||||
case 'd':
|
||||
cb.cb_print_dio_verify = B_TRUE;
|
||||
break;
|
||||
case 'D':
|
||||
if (++cb.cb_dedup_stats > 2)
|
||||
cb.cb_dedup_stats = 2;
|
||||
|
@ -288,7 +288,8 @@ zstream_do_recompress(int argc, char *argv[])
|
||||
abd_t *pabd =
|
||||
abd_get_from_buf_struct(&abd, buf, bufsz);
|
||||
size_t csize = zio_compress_data(ctype, &dabd,
|
||||
&pabd, drrw->drr_logical_size, level);
|
||||
&pabd, drrw->drr_logical_size,
|
||||
drrw->drr_logical_size, level);
|
||||
size_t rounded =
|
||||
P2ROUNDUP(csize, SPA_MINBLOCKSIZE);
|
||||
if (rounded >= drrw->drr_logical_size) {
|
||||
|
@ -132,7 +132,7 @@ static void
|
||||
rdt_insert(redup_table_t *rdt,
|
||||
uint64_t guid, uint64_t object, uint64_t offset, uint64_t stream_offset)
|
||||
{
|
||||
uint64_t ch = cityhash4(guid, object, offset, 0);
|
||||
uint64_t ch = cityhash3(guid, object, offset);
|
||||
uint64_t hashcode = BF64_GET(ch, 0, rdt->numhashbits);
|
||||
redup_entry_t **rdepp;
|
||||
|
||||
@ -152,7 +152,7 @@ rdt_lookup(redup_table_t *rdt,
|
||||
uint64_t guid, uint64_t object, uint64_t offset,
|
||||
uint64_t *stream_offsetp)
|
||||
{
|
||||
uint64_t ch = cityhash4(guid, object, offset, 0);
|
||||
uint64_t ch = cityhash3(guid, object, offset);
|
||||
uint64_t hashcode = BF64_GET(ch, 0, rdt->numhashbits);
|
||||
|
||||
for (redup_entry_t *rde = rdt->redup_hash_array[hashcode];
|
||||
|
@ -685,15 +685,17 @@ static int
|
||||
str2shift(const char *buf)
|
||||
{
|
||||
const char *ends = "BKMGTPEZ";
|
||||
int i;
|
||||
int i, len;
|
||||
|
||||
if (buf[0] == '\0')
|
||||
return (0);
|
||||
for (i = 0; i < strlen(ends); i++) {
|
||||
|
||||
len = strlen(ends);
|
||||
for (i = 0; i < len; i++) {
|
||||
if (toupper(buf[0]) == ends[i])
|
||||
break;
|
||||
}
|
||||
if (i == strlen(ends)) {
|
||||
if (i == len) {
|
||||
(void) fprintf(stderr, "ztest: invalid bytes suffix: %s\n",
|
||||
buf);
|
||||
usage(B_FALSE);
|
||||
@ -1940,7 +1942,7 @@ ztest_verify_unused_bonus(dmu_buf_t *db, void *end, uint64_t obj,
|
||||
static void
|
||||
ztest_log_create(ztest_ds_t *zd, dmu_tx_t *tx, lr_create_t *lr)
|
||||
{
|
||||
char *name = (void *)(lr + 1); /* name follows lr */
|
||||
char *name = (char *)&lr->lr_data[0]; /* name follows lr */
|
||||
size_t namesize = strlen(name) + 1;
|
||||
itx_t *itx;
|
||||
|
||||
@ -1948,7 +1950,7 @@ ztest_log_create(ztest_ds_t *zd, dmu_tx_t *tx, lr_create_t *lr)
|
||||
return;
|
||||
|
||||
itx = zil_itx_create(TX_CREATE, sizeof (*lr) + namesize);
|
||||
memcpy(&itx->itx_lr + 1, &lr->lr_common + 1,
|
||||
memcpy(&itx->itx_lr + 1, &lr->lr_create.lr_common + 1,
|
||||
sizeof (*lr) + namesize - sizeof (lr_t));
|
||||
|
||||
zil_itx_assign(zd->zd_zilog, itx, tx);
|
||||
@ -1957,7 +1959,7 @@ ztest_log_create(ztest_ds_t *zd, dmu_tx_t *tx, lr_create_t *lr)
|
||||
static void
|
||||
ztest_log_remove(ztest_ds_t *zd, dmu_tx_t *tx, lr_remove_t *lr, uint64_t object)
|
||||
{
|
||||
char *name = (void *)(lr + 1); /* name follows lr */
|
||||
char *name = (char *)&lr->lr_data[0]; /* name follows lr */
|
||||
size_t namesize = strlen(name) + 1;
|
||||
itx_t *itx;
|
||||
|
||||
@ -2043,8 +2045,9 @@ static int
|
||||
ztest_replay_create(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
ztest_ds_t *zd = arg1;
|
||||
lr_create_t *lr = arg2;
|
||||
char *name = (void *)(lr + 1); /* name follows lr */
|
||||
lr_create_t *lrc = arg2;
|
||||
_lr_create_t *lr = &lrc->lr_create;
|
||||
char *name = (char *)&lrc->lr_data[0]; /* name follows lr */
|
||||
objset_t *os = zd->zd_os;
|
||||
ztest_block_tag_t *bbt;
|
||||
dmu_buf_t *db;
|
||||
@ -2122,7 +2125,7 @@ ztest_replay_create(void *arg1, void *arg2, boolean_t byteswap)
|
||||
VERIFY0(zap_add(os, lr->lr_doid, name, sizeof (uint64_t), 1,
|
||||
&lr->lr_foid, tx));
|
||||
|
||||
(void) ztest_log_create(zd, tx, lr);
|
||||
(void) ztest_log_create(zd, tx, lrc);
|
||||
|
||||
dmu_tx_commit(tx);
|
||||
|
||||
@ -2134,7 +2137,7 @@ ztest_replay_remove(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
ztest_ds_t *zd = arg1;
|
||||
lr_remove_t *lr = arg2;
|
||||
char *name = (void *)(lr + 1); /* name follows lr */
|
||||
char *name = (char *)&lr->lr_data[0]; /* name follows lr */
|
||||
objset_t *os = zd->zd_os;
|
||||
dmu_object_info_t doi;
|
||||
dmu_tx_t *tx;
|
||||
@ -2188,9 +2191,9 @@ ztest_replay_write(void *arg1, void *arg2, boolean_t byteswap)
|
||||
ztest_ds_t *zd = arg1;
|
||||
lr_write_t *lr = arg2;
|
||||
objset_t *os = zd->zd_os;
|
||||
void *data = lr + 1; /* data follows lr */
|
||||
uint8_t *data = &lr->lr_data[0]; /* data follows lr */
|
||||
uint64_t offset, length;
|
||||
ztest_block_tag_t *bt = data;
|
||||
ztest_block_tag_t *bt = (ztest_block_tag_t *)data;
|
||||
ztest_block_tag_t *bbt;
|
||||
uint64_t gen, txg, lrtxg, crtxg;
|
||||
dmu_object_info_t doi;
|
||||
@ -2262,6 +2265,13 @@ ztest_replay_write(void *arg1, void *arg2, boolean_t byteswap)
|
||||
if (ztest_random(4) != 0) {
|
||||
int prefetch = ztest_random(2) ?
|
||||
DMU_READ_PREFETCH : DMU_READ_NO_PREFETCH;
|
||||
|
||||
/*
|
||||
* We will randomly set when to do O_DIRECT on a read.
|
||||
*/
|
||||
if (ztest_random(4) == 0)
|
||||
prefetch |= DMU_DIRECTIO;
|
||||
|
||||
ztest_block_tag_t rbt;
|
||||
|
||||
VERIFY(dmu_read(os, lr->lr_foid, offset,
|
||||
@ -2642,7 +2652,8 @@ ztest_create(ztest_ds_t *zd, ztest_od_t *od, int count)
|
||||
continue;
|
||||
}
|
||||
|
||||
lr_create_t *lr = ztest_lr_alloc(sizeof (*lr), od->od_name);
|
||||
lr_create_t *lrc = ztest_lr_alloc(sizeof (*lrc), od->od_name);
|
||||
_lr_create_t *lr = &lrc->lr_create;
|
||||
|
||||
lr->lr_doid = od->od_dir;
|
||||
lr->lr_foid = 0; /* 0 to allocate, > 0 to claim */
|
||||
@ -2726,7 +2737,7 @@ ztest_write(ztest_ds_t *zd, uint64_t object, uint64_t offset, uint64_t size,
|
||||
lr->lr_blkoff = 0;
|
||||
BP_ZERO(&lr->lr_blkptr);
|
||||
|
||||
memcpy(lr + 1, data, size);
|
||||
memcpy(&lr->lr_data[0], data, size);
|
||||
|
||||
error = ztest_replay_write(zd, lr, B_FALSE);
|
||||
|
||||
@ -2813,6 +2824,13 @@ ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t offset)
|
||||
enum ztest_io_type io_type;
|
||||
uint64_t blocksize;
|
||||
void *data;
|
||||
uint32_t dmu_read_flags = DMU_READ_NO_PREFETCH;
|
||||
|
||||
/*
|
||||
* We will randomly set when to do O_DIRECT on a read.
|
||||
*/
|
||||
if (ztest_random(4) == 0)
|
||||
dmu_read_flags |= DMU_DIRECTIO;
|
||||
|
||||
VERIFY0(dmu_object_info(zd->zd_os, object, &doi));
|
||||
blocksize = doi.doi_data_block_size;
|
||||
@ -2878,7 +2896,7 @@ ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t offset)
|
||||
(void) pthread_rwlock_unlock(&ztest_name_lock);
|
||||
|
||||
VERIFY0(dmu_read(zd->zd_os, object, offset, blocksize, data,
|
||||
DMU_READ_NO_PREFETCH));
|
||||
dmu_read_flags));
|
||||
|
||||
(void) ztest_write(zd, object, offset, blocksize, data);
|
||||
break;
|
||||
@ -5045,6 +5063,13 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id)
|
||||
uint64_t stride = 123456789ULL;
|
||||
uint64_t width = 40;
|
||||
int free_percent = 5;
|
||||
uint32_t dmu_read_flags = DMU_READ_PREFETCH;
|
||||
|
||||
/*
|
||||
* We will randomly set when to do O_DIRECT on a read.
|
||||
*/
|
||||
if (ztest_random(4) == 0)
|
||||
dmu_read_flags |= DMU_DIRECTIO;
|
||||
|
||||
/*
|
||||
* This test uses two objects, packobj and bigobj, that are always
|
||||
@ -5123,10 +5148,10 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id)
|
||||
* Read the current contents of our objects.
|
||||
*/
|
||||
error = dmu_read(os, packobj, packoff, packsize, packbuf,
|
||||
DMU_READ_PREFETCH);
|
||||
dmu_read_flags);
|
||||
ASSERT0(error);
|
||||
error = dmu_read(os, bigobj, bigoff, bigsize, bigbuf,
|
||||
DMU_READ_PREFETCH);
|
||||
dmu_read_flags);
|
||||
ASSERT0(error);
|
||||
|
||||
/*
|
||||
@ -5244,9 +5269,9 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id)
|
||||
void *bigcheck = umem_alloc(bigsize, UMEM_NOFAIL);
|
||||
|
||||
VERIFY0(dmu_read(os, packobj, packoff,
|
||||
packsize, packcheck, DMU_READ_PREFETCH));
|
||||
packsize, packcheck, dmu_read_flags));
|
||||
VERIFY0(dmu_read(os, bigobj, bigoff,
|
||||
bigsize, bigcheck, DMU_READ_PREFETCH));
|
||||
bigsize, bigcheck, dmu_read_flags));
|
||||
|
||||
ASSERT0(memcmp(packbuf, packcheck, packsize));
|
||||
ASSERT0(memcmp(bigbuf, bigcheck, bigsize));
|
||||
@ -5336,6 +5361,13 @@ ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id)
|
||||
dmu_buf_t *bonus_db;
|
||||
arc_buf_t **bigbuf_arcbufs;
|
||||
dmu_object_info_t doi;
|
||||
uint32_t dmu_read_flags = DMU_READ_PREFETCH;
|
||||
|
||||
/*
|
||||
* We will randomly set when to do O_DIRECT on a read.
|
||||
*/
|
||||
if (ztest_random(4) == 0)
|
||||
dmu_read_flags |= DMU_DIRECTIO;
|
||||
|
||||
size = sizeof (ztest_od_t) * OD_ARRAY_SIZE;
|
||||
od = umem_alloc(size, UMEM_NOFAIL);
|
||||
@ -5466,10 +5498,10 @@ ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id)
|
||||
*/
|
||||
if (i != 0 || ztest_random(2) != 0) {
|
||||
error = dmu_read(os, packobj, packoff,
|
||||
packsize, packbuf, DMU_READ_PREFETCH);
|
||||
packsize, packbuf, dmu_read_flags);
|
||||
ASSERT0(error);
|
||||
error = dmu_read(os, bigobj, bigoff, bigsize,
|
||||
bigbuf, DMU_READ_PREFETCH);
|
||||
bigbuf, dmu_read_flags);
|
||||
ASSERT0(error);
|
||||
}
|
||||
compare_and_update_pbbufs(s, packbuf, bigbuf, bigsize,
|
||||
@ -5529,9 +5561,9 @@ ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id)
|
||||
void *bigcheck = umem_alloc(bigsize, UMEM_NOFAIL);
|
||||
|
||||
VERIFY0(dmu_read(os, packobj, packoff,
|
||||
packsize, packcheck, DMU_READ_PREFETCH));
|
||||
packsize, packcheck, dmu_read_flags));
|
||||
VERIFY0(dmu_read(os, bigobj, bigoff,
|
||||
bigsize, bigcheck, DMU_READ_PREFETCH));
|
||||
bigsize, bigcheck, dmu_read_flags));
|
||||
|
||||
ASSERT0(memcmp(packbuf, packcheck, packsize));
|
||||
ASSERT0(memcmp(bigbuf, bigcheck, bigsize));
|
||||
|
177
sys/contrib/openzfs/config/ax_compare_version.m4
Normal file
177
sys/contrib/openzfs/config/ax_compare_version.m4
Normal file
@ -0,0 +1,177 @@
|
||||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_compare_version.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# This macro compares two version strings. Due to the various number of
|
||||
# minor-version numbers that can exist, and the fact that string
|
||||
# comparisons are not compatible with numeric comparisons, this is not
|
||||
# necessarily trivial to do in a autoconf script. This macro makes doing
|
||||
# these comparisons easy.
|
||||
#
|
||||
# The six basic comparisons are available, as well as checking equality
|
||||
# limited to a certain number of minor-version levels.
|
||||
#
|
||||
# The operator OP determines what type of comparison to do, and can be one
|
||||
# of:
|
||||
#
|
||||
# eq - equal (test A == B)
|
||||
# ne - not equal (test A != B)
|
||||
# le - less than or equal (test A <= B)
|
||||
# ge - greater than or equal (test A >= B)
|
||||
# lt - less than (test A < B)
|
||||
# gt - greater than (test A > B)
|
||||
#
|
||||
# Additionally, the eq and ne operator can have a number after it to limit
|
||||
# the test to that number of minor versions.
|
||||
#
|
||||
# eq0 - equal up to the length of the shorter version
|
||||
# ne0 - not equal up to the length of the shorter version
|
||||
# eqN - equal up to N sub-version levels
|
||||
# neN - not equal up to N sub-version levels
|
||||
#
|
||||
# When the condition is true, shell commands ACTION-IF-TRUE are run,
|
||||
# otherwise shell commands ACTION-IF-FALSE are run. The environment
|
||||
# variable 'ax_compare_version' is always set to either 'true' or 'false'
|
||||
# as well.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
|
||||
# AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
|
||||
#
|
||||
# would both be true.
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
|
||||
# AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
|
||||
#
|
||||
# would both be false.
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
|
||||
#
|
||||
# would be true because it is only comparing two minor versions.
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
|
||||
#
|
||||
# would be true because it is only comparing the lesser number of minor
|
||||
# versions of the two values.
|
||||
#
|
||||
# Note: The characters that separate the version numbers do not matter. An
|
||||
# empty string is the same as version 0. OP is evaluated by autoconf, not
|
||||
# configure, so must be a string, not a variable.
|
||||
#
|
||||
# The author would like to acknowledge Guido Draheim whose advice about
|
||||
# the m4_case and m4_ifvaln functions make this macro only include the
|
||||
# portions necessary to perform the specific comparison specified by the
|
||||
# OP argument in the final configure script.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 13
|
||||
|
||||
dnl #########################################################################
|
||||
AC_DEFUN([AX_COMPARE_VERSION], [
|
||||
AC_REQUIRE([AC_PROG_AWK])
|
||||
|
||||
# Used to indicate true or false condition
|
||||
ax_compare_version=false
|
||||
|
||||
# Convert the two version strings to be compared into a format that
|
||||
# allows a simple string comparison. The end result is that a version
|
||||
# string of the form 1.12.5-r617 will be converted to the form
|
||||
# 0001001200050617. In other words, each number is zero padded to four
|
||||
# digits, and non digits are removed.
|
||||
AS_VAR_PUSHDEF([A],[ax_compare_version_A])
|
||||
A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
|
||||
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/[[^0-9]]//g'`
|
||||
|
||||
AS_VAR_PUSHDEF([B],[ax_compare_version_B])
|
||||
B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
|
||||
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/[[^0-9]]//g'`
|
||||
|
||||
dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
|
||||
dnl # then the first line is used to determine if the condition is true.
|
||||
dnl # The sed right after the echo is to remove any indented white space.
|
||||
m4_case(m4_tolower($2),
|
||||
[lt],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
|
||||
],
|
||||
[gt],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
|
||||
],
|
||||
[le],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
|
||||
],
|
||||
[ge],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
|
||||
],[
|
||||
dnl Split the operator from the subversion count if present.
|
||||
m4_bmatch(m4_substr($2,2),
|
||||
[0],[
|
||||
# A count of zero means use the length of the shorter version.
|
||||
# Determine the number of characters in A and B.
|
||||
ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
|
||||
ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
|
||||
|
||||
# Set A to no more than B's length and B to no more than A's length.
|
||||
A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
|
||||
B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
|
||||
],
|
||||
[[0-9]+],[
|
||||
# A count greater than zero means use only that many subversions
|
||||
A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
|
||||
B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
|
||||
],
|
||||
[.+],[
|
||||
AC_WARNING(
|
||||
[invalid OP numeric parameter: $2])
|
||||
],[])
|
||||
|
||||
# Pad zeros at end of numbers to make same length.
|
||||
ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
|
||||
B="$B`echo $A | sed 's/./0/g'`"
|
||||
A="$ax_compare_version_tmp_A"
|
||||
|
||||
# Check for equality or inequality as necessary.
|
||||
m4_case(m4_tolower(m4_substr($2,0,2)),
|
||||
[eq],[
|
||||
test "x$A" = "x$B" && ax_compare_version=true
|
||||
],
|
||||
[ne],[
|
||||
test "x$A" != "x$B" && ax_compare_version=true
|
||||
],[
|
||||
AC_WARNING([invalid OP parameter: $2])
|
||||
])
|
||||
])
|
||||
|
||||
AS_VAR_POPDEF([A])dnl
|
||||
AS_VAR_POPDEF([B])dnl
|
||||
|
||||
dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
|
||||
if test "$ax_compare_version" = "true" ; then
|
||||
m4_ifvaln([$4],[$4],[:])dnl
|
||||
m4_ifvaln([$5],[else $5])dnl
|
||||
fi
|
||||
]) dnl AX_COMPARE_VERSION
|
@ -101,3 +101,5 @@ native-deb-kmod: native-deb-local debian
|
||||
fakeroot debian/rules override_dh_binary-modules;
|
||||
|
||||
native-deb: native-deb-utils native-deb-kmod
|
||||
|
||||
.NOTPARALLEL: native-deb native-deb-utils native-deb-kmod
|
||||
|
@ -1,72 +0,0 @@
|
||||
# intlmacosx.m4 serial 6 (gettext-0.20)
|
||||
dnl Copyright (C) 2004-2014, 2016, 2019 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
dnl
|
||||
dnl This file can be used in projects which are not available under
|
||||
dnl the GNU General Public License or the GNU Library General Public
|
||||
dnl License but which still want to provide support for the GNU gettext
|
||||
dnl functionality.
|
||||
dnl Please note that the actual code of the GNU gettext library is covered
|
||||
dnl by the GNU Library General Public License, and the rest of the GNU
|
||||
dnl gettext package is covered by the GNU General Public License.
|
||||
dnl They are *not* in the public domain.
|
||||
|
||||
dnl Checks for special options needed on Mac OS X.
|
||||
dnl Defines INTL_MACOSX_LIBS.
|
||||
AC_DEFUN([gt_INTL_MACOSX],
|
||||
[
|
||||
dnl Check for API introduced in Mac OS X 10.4.
|
||||
AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
|
||||
[gt_cv_func_CFPreferencesCopyAppValue],
|
||||
[gt_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <CoreFoundation/CFPreferences.h>]],
|
||||
[[CFPreferencesCopyAppValue(NULL, NULL)]])],
|
||||
[gt_cv_func_CFPreferencesCopyAppValue=yes],
|
||||
[gt_cv_func_CFPreferencesCopyAppValue=no])
|
||||
LIBS="$gt_save_LIBS"])
|
||||
if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
|
||||
AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
|
||||
[Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
|
||||
fi
|
||||
dnl Check for API introduced in Mac OS X 10.5.
|
||||
AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
|
||||
[gt_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <CoreFoundation/CFLocale.h>]],
|
||||
[[CFLocaleCopyCurrent();]])],
|
||||
[gt_cv_func_CFLocaleCopyCurrent=yes],
|
||||
[gt_cv_func_CFLocaleCopyCurrent=no])
|
||||
LIBS="$gt_save_LIBS"])
|
||||
if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
|
||||
AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
|
||||
[Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
|
||||
fi
|
||||
AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages],
|
||||
[gt_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <CoreFoundation/CFLocale.h>]],
|
||||
[[CFLocaleCopyPreferredLanguages();]])],
|
||||
[gt_cv_func_CFLocaleCopyPreferredLanguages=yes],
|
||||
[gt_cv_func_CFLocaleCopyPreferredLanguages=no])
|
||||
LIBS="$gt_save_LIBS"])
|
||||
if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
|
||||
AC_DEFINE([HAVE_CFLOCALECOPYPREFERREDLANGUAGES], [1],
|
||||
[Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework.])
|
||||
fi
|
||||
INTL_MACOSX_LIBS=
|
||||
if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
|
||||
|| test $gt_cv_func_CFLocaleCopyCurrent = yes \
|
||||
|| test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
|
||||
INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
|
||||
fi
|
||||
AC_SUBST([INTL_MACOSX_LIBS])
|
||||
])
|
@ -1,112 +1,3 @@
|
||||
dnl #
|
||||
dnl # Check if posix_acl_release can be used from a ZFS_META_LICENSED
|
||||
dnl # module. The is_owner_or_cap macro was replaced by
|
||||
dnl # inode_owner_or_capable
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_RELEASE], [
|
||||
ZFS_LINUX_TEST_SRC([posix_acl_release], [
|
||||
#include <linux/cred.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/posix_acl.h>
|
||||
], [
|
||||
struct posix_acl *tmp = posix_acl_alloc(1, 0);
|
||||
posix_acl_release(tmp);
|
||||
], [], [ZFS_META_LICENSE])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_RELEASE], [
|
||||
AC_MSG_CHECKING([whether posix_acl_release() is available])
|
||||
ZFS_LINUX_TEST_RESULT([posix_acl_release], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_POSIX_ACL_RELEASE, 1,
|
||||
[posix_acl_release() is available])
|
||||
|
||||
AC_MSG_CHECKING([whether posix_acl_release() is GPL-only])
|
||||
ZFS_LINUX_TEST_RESULT([posix_acl_release_license], [
|
||||
AC_MSG_RESULT(no)
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_POSIX_ACL_RELEASE_GPL_ONLY, 1,
|
||||
[posix_acl_release() is GPL-only])
|
||||
])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.14 API change,
|
||||
dnl # set_cached_acl() and forget_cached_acl() changed from inline to
|
||||
dnl # EXPORT_SYMBOL. In the former case, they may not be usable because of
|
||||
dnl # posix_acl_release. In the latter case, we can always use them.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_SET_CACHED_ACL_USABLE], [
|
||||
ZFS_LINUX_TEST_SRC([set_cached_acl], [
|
||||
#include <linux/cred.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/posix_acl.h>
|
||||
], [
|
||||
struct inode *ip = NULL;
|
||||
struct posix_acl *acl = posix_acl_alloc(1, 0);
|
||||
set_cached_acl(ip, ACL_TYPE_ACCESS, acl);
|
||||
forget_cached_acl(ip, ACL_TYPE_ACCESS);
|
||||
], [], [ZFS_META_LICENSE])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE], [
|
||||
AC_MSG_CHECKING([whether set_cached_acl() is usable])
|
||||
ZFS_LINUX_TEST_RESULT([set_cached_acl_license], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SET_CACHED_ACL_USABLE, 1,
|
||||
[set_cached_acl() is usable])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.1 API change,
|
||||
dnl # posix_acl_chmod() was added as the preferred interface.
|
||||
dnl #
|
||||
dnl # 3.14 API change,
|
||||
dnl # posix_acl_chmod() was changed to __posix_acl_chmod()
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_CHMOD], [
|
||||
ZFS_LINUX_TEST_SRC([posix_acl_chmod], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/posix_acl.h>
|
||||
],[
|
||||
posix_acl_chmod(NULL, 0, 0)
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([__posix_acl_chmod], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/posix_acl.h>
|
||||
],[
|
||||
__posix_acl_chmod(NULL, 0, 0)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_CHMOD], [
|
||||
AC_MSG_CHECKING([whether __posix_acl_chmod exists])
|
||||
ZFS_LINUX_TEST_RESULT([__posix_acl_chmod], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE___POSIX_ACL_CHMOD, 1,
|
||||
[__posix_acl_chmod() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether posix_acl_chmod exists])
|
||||
ZFS_LINUX_TEST_RESULT([posix_acl_chmod], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_POSIX_ACL_CHMOD, 1,
|
||||
[posix_acl_chmod() exists])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([posix_acl_chmod()])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.1 API change,
|
||||
dnl # posix_acl_equiv_mode now wants an umode_t instead of a mode_t
|
||||
@ -130,34 +21,6 @@ AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.8 API change,
|
||||
dnl # The function posix_acl_valid now must be passed a namespace.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_VALID_WITH_NS], [
|
||||
ZFS_LINUX_TEST_SRC([posix_acl_valid_with_ns], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/posix_acl.h>
|
||||
],[
|
||||
struct user_namespace *user_ns = NULL;
|
||||
const struct posix_acl *acl = NULL;
|
||||
int error;
|
||||
|
||||
error = posix_acl_valid(user_ns, acl);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS], [
|
||||
AC_MSG_CHECKING([whether posix_acl_valid() wants user namespace])
|
||||
ZFS_LINUX_TEST_RESULT([posix_acl_valid_with_ns], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_POSIX_ACL_VALID_WITH_NS, 1,
|
||||
[posix_acl_valid() wants user namespace])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.1 API change,
|
||||
dnl # Check if inode_operations contains the function get_acl
|
||||
@ -226,9 +89,6 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.14 API change,
|
||||
dnl # Check if inode_operations contains the function set_acl
|
||||
dnl #
|
||||
dnl # 5.12 API change,
|
||||
dnl # set_acl() added a user_namespace* parameter first
|
||||
@ -290,106 +150,35 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL], [
|
||||
AC_MSG_CHECKING([whether iops->set_acl() exists])
|
||||
AC_MSG_CHECKING([whether iops->set_acl() with 4 args exists])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_userns], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
|
||||
AC_DEFINE(HAVE_SET_ACL_USERNS, 1, [iops->set_acl() takes 4 args])
|
||||
],[
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_mnt_idmap_dentry], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
|
||||
AC_DEFINE(HAVE_SET_ACL_IDMAP_DENTRY, 1,
|
||||
[iops->set_acl() takes 4 args, arg1 is struct mnt_idmap *])
|
||||
],[
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_userns_dentry], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
|
||||
AC_DEFINE(HAVE_SET_ACL_USERNS_DENTRY_ARG2, 1,
|
||||
[iops->set_acl() takes 4 args, arg2 is struct dentry *])
|
||||
],[
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists, takes 3 args])
|
||||
],[
|
||||
ZFS_LINUX_REQUIRE_API([i_op->set_acl()], [3.14])
|
||||
])
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.7 API change,
|
||||
dnl # The kernel get_acl will now check cache before calling i_op->get_acl and
|
||||
dnl # do set_cached_acl after that, so i_op->get_acl don't need to do that
|
||||
dnl # anymore.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_ACL_HANDLE_CACHE], [
|
||||
ZFS_LINUX_TEST_SRC([get_acl_handle_cache], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
void *sentinel __attribute__ ((unused)) =
|
||||
uncached_acl_sentinel(NULL);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE], [
|
||||
AC_MSG_CHECKING([whether uncached_acl_sentinel() exists])
|
||||
ZFS_LINUX_TEST_RESULT([get_acl_handle_cache], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KERNEL_GET_ACL_HANDLE_CACHE, 1,
|
||||
[uncached_acl_sentinel() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.16 kernel: check if struct posix_acl acl.a_refcount is a refcount_t.
|
||||
dnl # It's an atomic_t on older kernels.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_ACL_HAS_REFCOUNT], [
|
||||
ZFS_LINUX_TEST_SRC([acl_refcount], [
|
||||
#include <linux/backing-dev.h>
|
||||
#include <linux/refcount.h>
|
||||
#include <linux/posix_acl.h>
|
||||
],[
|
||||
struct posix_acl acl;
|
||||
refcount_t *r __attribute__ ((unused)) = &acl.a_refcount;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_ACL_HAS_REFCOUNT], [
|
||||
AC_MSG_CHECKING([whether posix_acl has refcount_t])
|
||||
ZFS_LINUX_TEST_RESULT([acl_refcount], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_ACL_REFCOUNT, 1, [posix_acl has refcount_t])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_ACL], [
|
||||
ZFS_AC_KERNEL_SRC_POSIX_ACL_RELEASE
|
||||
ZFS_AC_KERNEL_SRC_SET_CACHED_ACL_USABLE
|
||||
ZFS_AC_KERNEL_SRC_POSIX_ACL_CHMOD
|
||||
ZFS_AC_KERNEL_SRC_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T
|
||||
ZFS_AC_KERNEL_SRC_POSIX_ACL_VALID_WITH_NS
|
||||
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL
|
||||
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL
|
||||
ZFS_AC_KERNEL_SRC_GET_ACL_HANDLE_CACHE
|
||||
ZFS_AC_KERNEL_SRC_ACL_HAS_REFCOUNT
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_ACL], [
|
||||
ZFS_AC_KERNEL_POSIX_ACL_RELEASE
|
||||
ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE
|
||||
ZFS_AC_KERNEL_POSIX_ACL_CHMOD
|
||||
ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T
|
||||
ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS
|
||||
ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL
|
||||
ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL
|
||||
ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE
|
||||
ZFS_AC_KERNEL_ACL_HAS_REFCOUNT
|
||||
])
|
||||
|
@ -1,23 +0,0 @@
|
||||
dnl #
|
||||
dnl # Linux 4.9-rc5+ ABI, removal of the .aio_fsync field
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_AIO_FSYNC], [
|
||||
ZFS_LINUX_TEST_SRC([aio_fsync], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static const struct file_operations
|
||||
fops __attribute__ ((unused)) = {
|
||||
.aio_fsync = NULL,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_AIO_FSYNC], [
|
||||
AC_MSG_CHECKING([whether fops->aio_fsync() exists])
|
||||
ZFS_LINUX_TEST_RESULT([aio_fsync], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FILE_AIO_FSYNC, 1, [fops->aio_fsync() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
62
sys/contrib/openzfs/config/kernel-assign_str.m4
Normal file
62
sys/contrib/openzfs/config/kernel-assign_str.m4
Normal file
@ -0,0 +1,62 @@
|
||||
dnl #
|
||||
dnl # 6.10 kernel, check number of args of __assign_str() for trace:
|
||||
dnl
|
||||
dnl # 6.10+: one arg
|
||||
dnl # 6.9 and older: two args
|
||||
dnl #
|
||||
dnl # More specifically, this will test to see if __assign_str() takes one
|
||||
dnl # arg. If __assign_str() takes two args, or is not defined, then
|
||||
dnl # HAVE_1ARG_ASSIGN_STR will not be set.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_1ARG_ASSIGN_STR], [
|
||||
AC_MSG_CHECKING([whether __assign_str() has one arg])
|
||||
ZFS_LINUX_TRY_COMPILE_HEADER([
|
||||
#include <linux/module.h>
|
||||
MODULE_LICENSE("$ZFS_META_LICENSE");
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include "conftest.h"
|
||||
],[
|
||||
trace_zfs_autoconf_event_one("1");
|
||||
trace_zfs_autoconf_event_two("2");
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_1ARG_ASSIGN_STR, 1,
|
||||
[__assign_str() has one arg])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
],[
|
||||
#if !defined(_CONFTEST_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _CONFTEST_H
|
||||
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM zfs
|
||||
#include <linux/tracepoint.h>
|
||||
|
||||
DECLARE_EVENT_CLASS(zfs_autoconf_event_class,
|
||||
TP_PROTO(char *string),
|
||||
TP_ARGS(string),
|
||||
TP_STRUCT__entry(
|
||||
__string(str, string)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__assign_str(str);
|
||||
),
|
||||
TP_printk("str = %s", __get_str(str))
|
||||
);
|
||||
|
||||
#define DEFINE_AUTOCONF_EVENT(name) \
|
||||
DEFINE_EVENT(zfs_autoconf_event_class, name, \
|
||||
TP_PROTO(char * str), \
|
||||
TP_ARGS(str))
|
||||
DEFINE_AUTOCONF_EVENT(zfs_autoconf_event_one);
|
||||
DEFINE_AUTOCONF_EVENT(zfs_autoconf_event_two);
|
||||
|
||||
#endif /* _CONFTEST_H */
|
||||
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
#define TRACE_INCLUDE_PATH .
|
||||
#define TRACE_INCLUDE_FILE conftest
|
||||
#include <trace/define_trace.h>
|
||||
])
|
||||
])
|
@ -1,81 +0,0 @@
|
||||
dnl #
|
||||
dnl # Check available BDI interfaces.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BDI], [
|
||||
ZFS_LINUX_TEST_SRC([super_setup_bdi_name], [
|
||||
#include <linux/fs.h>
|
||||
struct super_block sb;
|
||||
], [
|
||||
char *name = "bdi";
|
||||
atomic_long_t zfs_bdi_seq;
|
||||
int error __attribute__((unused));
|
||||
atomic_long_set(&zfs_bdi_seq, 0);
|
||||
error =
|
||||
super_setup_bdi_name(&sb, "%.28s-%ld", name,
|
||||
atomic_long_inc_return(&zfs_bdi_seq));
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([bdi_setup_and_register], [
|
||||
#include <linux/backing-dev.h>
|
||||
struct backing_dev_info bdi;
|
||||
], [
|
||||
char *name = "bdi";
|
||||
int error __attribute__((unused)) =
|
||||
bdi_setup_and_register(&bdi, name);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([bdi_setup_and_register_3args], [
|
||||
#include <linux/backing-dev.h>
|
||||
struct backing_dev_info bdi;
|
||||
], [
|
||||
char *name = "bdi";
|
||||
unsigned int cap = BDI_CAP_MAP_COPY;
|
||||
int error __attribute__((unused)) =
|
||||
bdi_setup_and_register(&bdi, name, cap);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BDI], [
|
||||
dnl #
|
||||
dnl # 4.12, super_setup_bdi_name() introduced.
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether super_setup_bdi_name() exists])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([super_setup_bdi_name],
|
||||
[super_setup_bdi_name], [fs/super.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
|
||||
[super_setup_bdi_name() exits])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 4.0 - 4.11, bdi_setup_and_register() takes 2 arguments.
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether bdi_setup_and_register() wants 2 args])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([bdi_setup_and_register],
|
||||
[bdi_setup_and_register], [mm/backing-dev.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_2ARGS_BDI_SETUP_AND_REGISTER, 1,
|
||||
[bdi_setup_and_register() wants 2 args])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.34 - 3.19, bdi_setup_and_register()
|
||||
dnl # takes 3 arguments.
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether bdi_setup_and_register() wants 3 args])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL(
|
||||
[bdi_setup_and_register_3args],
|
||||
[bdi_setup_and_register], [mm/backing-dev.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_3ARGS_BDI_SETUP_AND_REGISTER, 1,
|
||||
[bdi_setup_and_register() wants 3 args])
|
||||
], [
|
||||
ZFS_LINUX_TEST_ERROR([bdi_setup])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
@ -1,81 +1,3 @@
|
||||
dnl #
|
||||
dnl # 2.6.36 API change,
|
||||
dnl # REQ_FAILFAST_{DEV|TRANSPORT|DRIVER}
|
||||
dnl # REQ_DISCARD
|
||||
dnl # REQ_FLUSH
|
||||
dnl #
|
||||
dnl # 4.8 - 4.9 API,
|
||||
dnl # REQ_FLUSH was renamed to REQ_PREFLUSH
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_REQ], [
|
||||
ZFS_LINUX_TEST_SRC([req_failfast_mask], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
int flags __attribute__ ((unused));
|
||||
flags = REQ_FAILFAST_MASK;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([req_discard], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
int flags __attribute__ ((unused));
|
||||
flags = REQ_DISCARD;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([req_flush], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
int flags __attribute__ ((unused));
|
||||
flags = REQ_FLUSH;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([req_preflush], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
int flags __attribute__ ((unused));
|
||||
flags = REQ_PREFLUSH;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_FAILFAST_MASK], [
|
||||
AC_MSG_CHECKING([whether REQ_FAILFAST_MASK is defined])
|
||||
ZFS_LINUX_TEST_RESULT([req_failfast_mask], [
|
||||
AC_MSG_RESULT(yes)
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([REQ_FAILFAST_MASK])
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_DISCARD], [
|
||||
AC_MSG_CHECKING([whether REQ_DISCARD is defined])
|
||||
ZFS_LINUX_TEST_RESULT([req_discard], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_REQ_DISCARD, 1, [REQ_DISCARD is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_FLUSH], [
|
||||
AC_MSG_CHECKING([whether REQ_FLUSH is defined])
|
||||
ZFS_LINUX_TEST_RESULT([req_flush], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_REQ_FLUSH, 1, [REQ_FLUSH is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_PREFLUSH], [
|
||||
AC_MSG_CHECKING([whether REQ_PREFLUSH is defined])
|
||||
ZFS_LINUX_TEST_RESULT([req_preflush], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_REQ_PREFLUSH, 1, [REQ_PREFLUSH is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 4.8 API,
|
||||
dnl #
|
||||
@ -84,31 +6,6 @@ dnl # checking the bio->bi_rw flags. The following checks are used to
|
||||
dnl # detect if a specific operation is supported.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_OPS], [
|
||||
ZFS_LINUX_TEST_SRC([req_op_discard], [
|
||||
#include <linux/blk_types.h>
|
||||
],[
|
||||
int op __attribute__ ((unused)) = REQ_OP_DISCARD;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([req_op_secure_erase], [
|
||||
#include <linux/blk_types.h>
|
||||
],[
|
||||
int op __attribute__ ((unused)) = REQ_OP_SECURE_ERASE;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([req_op_flush], [
|
||||
#include <linux/blk_types.h>
|
||||
],[
|
||||
int op __attribute__ ((unused)) = REQ_OP_FLUSH;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([bio_bi_opf], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
struct bio bio __attribute__ ((unused));
|
||||
bio.bi_opf = 0;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([bio_set_op_attrs], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
@ -117,47 +14,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_OPS], [
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_OP_DISCARD], [
|
||||
AC_MSG_CHECKING([whether REQ_OP_DISCARD is defined])
|
||||
ZFS_LINUX_TEST_RESULT([req_op_discard], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_REQ_OP_DISCARD, 1, [REQ_OP_DISCARD is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_OP_SECURE_ERASE], [
|
||||
AC_MSG_CHECKING([whether REQ_OP_SECURE_ERASE is defined])
|
||||
ZFS_LINUX_TEST_RESULT([req_op_secure_erase], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_REQ_OP_SECURE_ERASE, 1,
|
||||
[REQ_OP_SECURE_ERASE is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_OP_FLUSH], [
|
||||
AC_MSG_CHECKING([whether REQ_OP_FLUSH is defined])
|
||||
ZFS_LINUX_TEST_RESULT([req_op_flush], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_REQ_OP_FLUSH, 1, [REQ_OP_FLUSH is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_BI_OPF], [
|
||||
AC_MSG_CHECKING([whether bio->bi_opf is defined])
|
||||
ZFS_LINUX_TEST_RESULT([bio_bi_opf], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BIO_BI_OPF, 1, [bio->bi_opf is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_OP_ATTRS], [
|
||||
AC_MSG_CHECKING([whether bio_set_op_attrs is available])
|
||||
ZFS_LINUX_TEST_RESULT([bio_set_op_attrs], [
|
||||
@ -210,127 +66,20 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_SET_DEV_MACRO], [
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV], [
|
||||
AC_MSG_CHECKING([whether bio_set_dev() is available])
|
||||
ZFS_LINUX_TEST_RESULT([bio_set_dev], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BIO_SET_DEV, 1, [bio_set_dev() is available])
|
||||
|
||||
AC_MSG_CHECKING([whether bio_set_dev() is GPL-only])
|
||||
ZFS_LINUX_TEST_RESULT([bio_set_dev_license], [
|
||||
AC_MSG_RESULT(no)
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BIO_SET_DEV_GPL_ONLY, 1,
|
||||
[bio_set_dev() GPL-only])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether bio_set_dev() is a macro])
|
||||
ZFS_LINUX_TEST_RESULT([bio_set_dev_macro], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BIO_SET_DEV_MACRO, 1,
|
||||
[bio_set_dev() is a macro])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
],[
|
||||
AC_MSG_CHECKING([whether bio_set_dev() is GPL-only])
|
||||
ZFS_LINUX_TEST_RESULT([bio_set_dev_license], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.3 API change
|
||||
dnl # Error argument dropped from bio_endio in favor of newly introduced
|
||||
dnl # bio->bi_error. This also replaces bio->bi_flags value BIO_UPTODATE.
|
||||
dnl # Introduced by torvalds/linux@4246a0b63bd8f56a1469b12eafeb875b1041a451
|
||||
dnl # ("block: add a bi_error field to struct bio").
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_END_IO_T_ARGS], [
|
||||
ZFS_LINUX_TEST_SRC([bio_end_io_t_args], [
|
||||
#include <linux/bio.h>
|
||||
static void wanted_end_io(struct bio *bio) { return; }
|
||||
bio_end_io_t *end_io __attribute__ ((unused)) = wanted_end_io;
|
||||
], [])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_END_IO_T_ARGS], [
|
||||
AC_MSG_CHECKING([whether bio_end_io_t wants 1 arg])
|
||||
ZFS_LINUX_TEST_RESULT([bio_end_io_t_args], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_1ARG_BIO_END_IO_T, 1,
|
||||
[bio_end_io_t wants 1 arg])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.13 API change
|
||||
dnl # The bio->bi_error field was replaced with bio->bi_status which is an
|
||||
dnl # enum which describes all possible error types.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_BI_STATUS], [
|
||||
ZFS_LINUX_TEST_SRC([bio_bi_status], [
|
||||
#include <linux/bio.h>
|
||||
], [
|
||||
struct bio bio __attribute__ ((unused));
|
||||
blk_status_t status __attribute__ ((unused)) = BLK_STS_OK;
|
||||
bio.bi_status = status;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_BI_STATUS], [
|
||||
AC_MSG_CHECKING([whether bio->bi_status exists])
|
||||
ZFS_LINUX_TEST_RESULT([bio_bi_status], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BIO_BI_STATUS, 1, [bio->bi_status exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.14 API change,
|
||||
dnl # Immutable biovecs. A number of fields of struct bio are moved to
|
||||
dnl # struct bvec_iter.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_BVEC_ITER], [
|
||||
ZFS_LINUX_TEST_SRC([bio_bvec_iter], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
struct bio bio;
|
||||
bio.bi_iter.bi_sector = 0;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_BVEC_ITER], [
|
||||
AC_MSG_CHECKING([whether bio has bi_iter])
|
||||
ZFS_LINUX_TEST_RESULT([bio_bvec_iter], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BIO_BVEC_ITER, 1, [bio has bi_iter])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(HAVE_BIO_SET_DEV_GPL_ONLY, 1,
|
||||
[bio_set_dev() GPL-only])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.8 API change
|
||||
dnl # The rw argument has been removed from submit_bio/submit_bio_wait.
|
||||
dnl # Callers are now expected to set bio->bi_rw instead of passing it in.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_SUBMIT_BIO], [
|
||||
ZFS_LINUX_TEST_SRC([submit_bio], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
struct bio *bio = NULL;
|
||||
(void) submit_bio(bio);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_SUBMIT_BIO], [
|
||||
AC_MSG_CHECKING([whether submit_bio() wants 1 arg])
|
||||
ZFS_LINUX_TEST_RESULT([submit_bio], [
|
||||
AC_MSG_CHECKING([whether bio_set_dev() is a macro])
|
||||
ZFS_LINUX_TEST_RESULT([bio_set_dev_macro], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_1ARG_SUBMIT_BIO, 1, [submit_bio() wants 1 arg])
|
||||
AC_DEFINE(HAVE_BIO_SET_DEV_MACRO, 1,
|
||||
[bio_set_dev() is a macro])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
@ -449,31 +198,6 @@ AC_DEFUN([ZFS_AC_KERNEL_BDEV_SUBMIT_BIO_RETURNS_VOID], [
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 5.16 API
|
||||
dnl #
|
||||
dnl # The Linux 5.16 API moved struct blkcg_gq into linux/blk-cgroup.h, which
|
||||
dnl # has been around since 2015. This test looks for the presence of that
|
||||
dnl # header, so that it can be conditionally included where it exists, but
|
||||
dnl # still be backward compatible with kernels that pre-date its introduction.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_CGROUP_HEADER], [
|
||||
ZFS_LINUX_TEST_SRC([blk_cgroup_header], [
|
||||
#include <linux/blk-cgroup.h>
|
||||
], [])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_CGROUP_HEADER], [
|
||||
AC_MSG_CHECKING([whether linux/blk-cgroup.h exists])
|
||||
ZFS_LINUX_TEST_RESULT([blk_cgroup_header],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_LINUX_BLK_CGROUP_HEADER, 1,
|
||||
[linux/blk-cgroup.h exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 5.18 API
|
||||
dnl #
|
||||
@ -510,43 +234,22 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_ALLOC_4ARG], [
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO], [
|
||||
ZFS_AC_KERNEL_SRC_REQ
|
||||
ZFS_AC_KERNEL_SRC_BIO_OPS
|
||||
ZFS_AC_KERNEL_SRC_BIO_SET_DEV
|
||||
ZFS_AC_KERNEL_SRC_BIO_END_IO_T_ARGS
|
||||
ZFS_AC_KERNEL_SRC_BIO_BI_STATUS
|
||||
ZFS_AC_KERNEL_SRC_BIO_BVEC_ITER
|
||||
ZFS_AC_KERNEL_SRC_BIO_SUBMIT_BIO
|
||||
ZFS_AC_KERNEL_SRC_BIO_CURRENT_BIO_LIST
|
||||
ZFS_AC_KERNEL_SRC_BLKG_TRYGET
|
||||
ZFS_AC_KERNEL_SRC_BIO_BDEV_DISK
|
||||
ZFS_AC_KERNEL_SRC_BDEV_SUBMIT_BIO_RETURNS_VOID
|
||||
ZFS_AC_KERNEL_SRC_BIO_SET_DEV_MACRO
|
||||
ZFS_AC_KERNEL_SRC_BLK_CGROUP_HEADER
|
||||
ZFS_AC_KERNEL_SRC_BIO_ALLOC_4ARG
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO], [
|
||||
ZFS_AC_KERNEL_BIO_REQ_FAILFAST_MASK
|
||||
ZFS_AC_KERNEL_BIO_REQ_DISCARD
|
||||
ZFS_AC_KERNEL_BIO_REQ_FLUSH
|
||||
ZFS_AC_KERNEL_BIO_REQ_PREFLUSH
|
||||
|
||||
ZFS_AC_KERNEL_BIO_REQ_OP_DISCARD
|
||||
ZFS_AC_KERNEL_BIO_REQ_OP_SECURE_ERASE
|
||||
ZFS_AC_KERNEL_BIO_REQ_OP_FLUSH
|
||||
ZFS_AC_KERNEL_BIO_BI_OPF
|
||||
ZFS_AC_KERNEL_BIO_SET_OP_ATTRS
|
||||
|
||||
ZFS_AC_KERNEL_BIO_SET_DEV
|
||||
ZFS_AC_KERNEL_BIO_END_IO_T_ARGS
|
||||
ZFS_AC_KERNEL_BIO_BI_STATUS
|
||||
ZFS_AC_KERNEL_BIO_BVEC_ITER
|
||||
ZFS_AC_KERNEL_BIO_SUBMIT_BIO
|
||||
ZFS_AC_KERNEL_BIO_CURRENT_BIO_LIST
|
||||
ZFS_AC_KERNEL_BLKG_TRYGET
|
||||
ZFS_AC_KERNEL_BIO_BDEV_DISK
|
||||
ZFS_AC_KERNEL_BDEV_SUBMIT_BIO_RETURNS_VOID
|
||||
ZFS_AC_KERNEL_BLK_CGROUP_HEADER
|
||||
ZFS_AC_KERNEL_BIO_ALLOC_4ARG
|
||||
])
|
||||
|
@ -161,7 +161,6 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_DISCARD], [
|
||||
dnl #
|
||||
dnl # 5.19: bdev_max_secure_erase_sectors() available
|
||||
dnl # 4.8: blk_queue_secure_erase() available
|
||||
dnl # 2.6.36: blk_queue_secdiscard() available
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_SECURE_ERASE], [
|
||||
ZFS_LINUX_TEST_SRC([bdev_max_secure_erase_sectors], [
|
||||
@ -182,16 +181,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_SECURE_ERASE], [
|
||||
memset(q, 0, sizeof(r));
|
||||
value = blk_queue_secure_erase(q);
|
||||
],[-Wframe-larger-than=8192])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([blk_queue_secdiscard], [
|
||||
#include <linux/blkdev.h>
|
||||
],[
|
||||
struct request_queue r;
|
||||
struct request_queue *q = &r;
|
||||
int value __attribute__ ((unused));
|
||||
memset(q, 0, sizeof(r));
|
||||
value = blk_queue_secdiscard(q);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_SECURE_ERASE], [
|
||||
@ -209,137 +198,11 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_SECURE_ERASE], [
|
||||
AC_DEFINE(HAVE_BLK_QUEUE_SECURE_ERASE, 1,
|
||||
[blk_queue_secure_erase() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether blk_queue_secdiscard() is available])
|
||||
ZFS_LINUX_TEST_RESULT([blk_queue_secdiscard], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_QUEUE_SECDISCARD, 1,
|
||||
[blk_queue_secdiscard() is available])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([blk_queue_secure_erase])
|
||||
])
|
||||
ZFS_LINUX_TEST_ERROR([blk_queue_secure_erase])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.16 API change,
|
||||
dnl # Introduction of blk_queue_flag_set and blk_queue_flag_clear
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLAG_SET], [
|
||||
ZFS_LINUX_TEST_SRC([blk_queue_flag_set], [
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/blkdev.h>
|
||||
],[
|
||||
struct request_queue *q = NULL;
|
||||
blk_queue_flag_set(0, q);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLAG_SET], [
|
||||
AC_MSG_CHECKING([whether blk_queue_flag_set() exists])
|
||||
ZFS_LINUX_TEST_RESULT([blk_queue_flag_set], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_QUEUE_FLAG_SET, 1,
|
||||
[blk_queue_flag_set() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLAG_CLEAR], [
|
||||
ZFS_LINUX_TEST_SRC([blk_queue_flag_clear], [
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/blkdev.h>
|
||||
],[
|
||||
struct request_queue *q = NULL;
|
||||
blk_queue_flag_clear(0, q);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLAG_CLEAR], [
|
||||
AC_MSG_CHECKING([whether blk_queue_flag_clear() exists])
|
||||
ZFS_LINUX_TEST_RESULT([blk_queue_flag_clear], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_QUEUE_FLAG_CLEAR, 1,
|
||||
[blk_queue_flag_clear() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.36 API change,
|
||||
dnl # Added blk_queue_flush() interface, while the previous interface
|
||||
dnl # was available to all the new one is GPL-only. Thus in addition to
|
||||
dnl # detecting if this function is available we determine if it is
|
||||
dnl # GPL-only. If the GPL-only interface is there we implement our own
|
||||
dnl # compatibility function, otherwise we use the function. The hope
|
||||
dnl # is that long term this function will be opened up.
|
||||
dnl #
|
||||
dnl # 4.7 API change,
|
||||
dnl # Replace blk_queue_flush with blk_queue_write_cache
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLUSH], [
|
||||
ZFS_LINUX_TEST_SRC([blk_queue_flush], [
|
||||
#include <linux/blkdev.h>
|
||||
], [
|
||||
struct request_queue *q __attribute__ ((unused)) = NULL;
|
||||
(void) blk_queue_flush(q, REQ_FLUSH);
|
||||
], [], [ZFS_META_LICENSE])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([blk_queue_write_cache], [
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/blkdev.h>
|
||||
], [
|
||||
struct request_queue *q __attribute__ ((unused)) = NULL;
|
||||
blk_queue_write_cache(q, true, true);
|
||||
], [], [ZFS_META_LICENSE])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLUSH], [
|
||||
AC_MSG_CHECKING([whether blk_queue_flush() is available])
|
||||
ZFS_LINUX_TEST_RESULT([blk_queue_flush], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_QUEUE_FLUSH, 1,
|
||||
[blk_queue_flush() is available])
|
||||
|
||||
AC_MSG_CHECKING([whether blk_queue_flush() is GPL-only])
|
||||
ZFS_LINUX_TEST_RESULT([blk_queue_flush_license], [
|
||||
AC_MSG_RESULT(no)
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_QUEUE_FLUSH_GPL_ONLY, 1,
|
||||
[blk_queue_flush() is GPL-only])
|
||||
])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.7 API change
|
||||
dnl # Replace blk_queue_flush with blk_queue_write_cache
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether blk_queue_write_cache() exists])
|
||||
ZFS_LINUX_TEST_RESULT([blk_queue_write_cache], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_QUEUE_WRITE_CACHE, 1,
|
||||
[blk_queue_write_cache() exists])
|
||||
|
||||
AC_MSG_CHECKING([whether blk_queue_write_cache() is GPL-only])
|
||||
ZFS_LINUX_TEST_RESULT([blk_queue_write_cache_license], [
|
||||
AC_MSG_RESULT(no)
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY, 1,
|
||||
[blk_queue_write_cache() is GPL-only])
|
||||
])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.34 API change
|
||||
dnl # blk_queue_max_hw_sectors() replaces blk_queue_max_sectors().
|
||||
@ -385,24 +248,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS], [
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # See if kernel supports block multi-queue and blk_status_t.
|
||||
dnl # blk_status_t represents the new status codes introduced in the 4.13
|
||||
dnl # kernel patch:
|
||||
dnl #
|
||||
dnl # block: introduce new block status code type
|
||||
dnl #
|
||||
dnl # We do not currently support the "old" block multi-queue interfaces from
|
||||
dnl # prior kernels.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_MQ], [
|
||||
ZFS_LINUX_TEST_SRC([blk_mq], [
|
||||
#include <linux/blk-mq.h>
|
||||
], [
|
||||
struct blk_mq_tag_set tag_set __attribute__ ((unused)) = {0};
|
||||
(void) blk_mq_alloc_tag_set(&tag_set);
|
||||
return BLK_STS_OK;
|
||||
], [])
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_MQ_RQ_HCTX], [
|
||||
ZFS_LINUX_TEST_SRC([blk_mq_rq_hctx], [
|
||||
#include <linux/blk-mq.h>
|
||||
#include <linux/blkdev.h>
|
||||
@ -413,18 +259,11 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_MQ], [
|
||||
], [])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_MQ], [
|
||||
AC_MSG_CHECKING([whether block multiqueue with blk_status_t is available])
|
||||
ZFS_LINUX_TEST_RESULT([blk_mq], [
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_MQ_RQ_HCTX], [
|
||||
AC_MSG_CHECKING([whether block multiqueue hardware context is cached in struct request])
|
||||
ZFS_LINUX_TEST_RESULT([blk_mq_rq_hctx], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_MQ, 1, [block multiqueue is available])
|
||||
AC_MSG_CHECKING([whether block multiqueue hardware context is cached in struct request])
|
||||
ZFS_LINUX_TEST_RESULT([blk_mq_rq_hctx], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_MQ_RQ_HCTX, 1, [block multiqueue hardware context is cached in struct request])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
AC_DEFINE(HAVE_BLK_MQ_RQ_HCTX, 1, [block multiqueue hardware context is cached in struct request])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
@ -437,12 +276,9 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE], [
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_UPDATE_READAHEAD
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_DISCARD
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_SECURE_ERASE
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLAG_SET
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLAG_CLEAR
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLUSH
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_MAX_HW_SECTORS
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_MAX_SEGMENTS
|
||||
ZFS_AC_KERNEL_SRC_BLK_MQ
|
||||
ZFS_AC_KERNEL_SRC_BLK_MQ_RQ_HCTX
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE], [
|
||||
@ -452,10 +288,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE], [
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_UPDATE_READAHEAD
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_DISCARD
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_SECURE_ERASE
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_FLAG_SET
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_FLAG_CLEAR
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_FLUSH
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_MAX_HW_SECTORS
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS
|
||||
ZFS_AC_KERNEL_BLK_MQ
|
||||
ZFS_AC_KERNEL_BLK_MQ_RQ_HCTX
|
||||
])
|
||||
|
@ -396,7 +396,6 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_INVALIDATE_BDEV], [
|
||||
dnl #
|
||||
dnl # 5.11 API, lookup_bdev() takes dev_t argument.
|
||||
dnl # 2.6.27 API, lookup_bdev() was first exported.
|
||||
dnl # 4.4.0-6.21 API, lookup_bdev() on Ubuntu takes mode argument.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_LOOKUP_BDEV], [
|
||||
ZFS_LINUX_TEST_SRC([lookup_bdev_devt], [
|
||||
@ -418,15 +417,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_LOOKUP_BDEV], [
|
||||
|
||||
bdev = lookup_bdev(path);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([lookup_bdev_mode], [
|
||||
#include <linux/fs.h>
|
||||
], [
|
||||
struct block_device *bdev __attribute__ ((unused));
|
||||
const char path[] = "/example/path";
|
||||
|
||||
bdev = lookup_bdev(path, FMODE_READ);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_LOOKUP_BDEV], [
|
||||
@ -446,17 +436,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_LOOKUP_BDEV], [
|
||||
AC_DEFINE(HAVE_1ARG_LOOKUP_BDEV, 1,
|
||||
[lookup_bdev() wants 1 arg])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether lookup_bdev() wants mode arg])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_mode],
|
||||
[lookup_bdev], [fs/block_dev.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_MODE_LOOKUP_BDEV, 1,
|
||||
[lookup_bdev() wants mode arg])
|
||||
], [
|
||||
ZFS_LINUX_TEST_ERROR([lookup_bdev()])
|
||||
])
|
||||
ZFS_LINUX_TEST_ERROR([lookup_bdev()])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
@ -1,39 +0,0 @@
|
||||
dnl #
|
||||
dnl # 3.5.0 API change
|
||||
dnl # torvalds/linux@dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430 and
|
||||
dnl # torvalds/linux@7994e6f7254354e03028a11f98a27bd67dace9f1 reworked
|
||||
dnl # where inode_sync_wait() is called.
|
||||
dnl #
|
||||
dnl # Prior to these changes it would occur in end_writeback() but due
|
||||
dnl # to various issues (described in the above commits) it has been
|
||||
dnl # moved to evict(). This changes the ordering is which sync occurs
|
||||
dnl # but otherwise doesn't impact the zpl implementation.
|
||||
dnl #
|
||||
dnl # The major impact here is the renaming of end_writeback() to
|
||||
dnl # clear_inode(). However, care must be taken when detecting this
|
||||
dnl # API change because as recently as 2.6.35 there was a clear_inode()
|
||||
dnl # function. However, it was made obsolete by the evict_inode() API
|
||||
dnl # change at the same time.
|
||||
dnl #
|
||||
dnl # Therefore, to ensure we have the correct API we only allow the
|
||||
dnl # clear_inode() compatibility code to be defined iff the evict_inode()
|
||||
dnl # functionality is also detected.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_CLEAR_INODE], [
|
||||
ZFS_LINUX_TEST_SRC([clear_inode], [
|
||||
#include <linux/fs.h>
|
||||
], [
|
||||
clear_inode(NULL);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_CLEAR_INODE], [
|
||||
AC_MSG_CHECKING([whether clear_inode() is available])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([clear_inode],
|
||||
[clear_inode], [fs/inode.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_CLEAR_INODE, 1, [clear_inode() is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
@ -4,21 +4,6 @@ dnl # detected at configure time and cause a build failure. Otherwise
|
||||
dnl # modules may be successfully built that behave incorrectly.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_DEFINED], [
|
||||
AS_IF([test "x$cross_compiling" != xyes], [
|
||||
AC_RUN_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#include "$LINUX/include/linux/license.h"
|
||||
], [
|
||||
return !license_is_gpl_compatible(
|
||||
"$ZFS_META_LICENSE");
|
||||
])
|
||||
], [
|
||||
AC_DEFINE([ZFS_IS_GPL_COMPATIBLE], [1],
|
||||
[Define to 1 if GPL-only symbols can be used])
|
||||
], [
|
||||
])
|
||||
])
|
||||
|
||||
ZFS_AC_KERNEL_SRC_CONFIG_MODULES
|
||||
ZFS_AC_KERNEL_SRC_CONFIG_BLOCK
|
||||
ZFS_AC_KERNEL_SRC_CONFIG_DEBUG_LOCK_ALLOC
|
||||
|
@ -1,26 +0,0 @@
|
||||
dnl #
|
||||
dnl # 4.9, current_time() added
|
||||
dnl # 4.18, return type changed from timespec to timespec64
|
||||
dnl #
|
||||
dnl # Note that we don't care about the return type in this check. If we have
|
||||
dnl # to implement a fallback, we'll know we're <4.9, which was timespec.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_CURRENT_TIME], [
|
||||
ZFS_LINUX_TEST_SRC([current_time], [
|
||||
#include <linux/fs.h>
|
||||
], [
|
||||
struct inode ip __attribute__ ((unused));
|
||||
(void) current_time(&ip);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_CURRENT_TIME], [
|
||||
AC_MSG_CHECKING([whether current_time() exists])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([current_time],
|
||||
[current_time], [fs/inode.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_CURRENT_TIME, 1, [current_time() exists])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
@ -1,30 +0,0 @@
|
||||
dnl #
|
||||
dnl # 3.18 API change
|
||||
dnl # Dentry aliases are in d_u struct dentry member
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_DENTRY_ALIAS_D_U], [
|
||||
ZFS_LINUX_TEST_SRC([dentry_alias_d_u], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/dcache.h>
|
||||
#include <linux/list.h>
|
||||
], [
|
||||
struct inode *inode __attribute__ ((unused)) = NULL;
|
||||
struct dentry *dentry __attribute__ ((unused)) = NULL;
|
||||
hlist_for_each_entry(dentry, &inode->i_dentry,
|
||||
d_u.d_alias) {
|
||||
d_drop(dentry);
|
||||
}
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_DENTRY_ALIAS_D_U], [
|
||||
AC_MSG_CHECKING([whether dentry aliases are in d_u member])
|
||||
ZFS_LINUX_TEST_RESULT([dentry_alias_d_u], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_DENTRY_D_U_ALIASES, 1,
|
||||
[dentry aliases are in d_u member])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
@ -1,26 +1,3 @@
|
||||
dnl #
|
||||
dnl # 3.4.0 API change
|
||||
dnl # Added d_make_root() to replace previous d_alloc_root() function.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_D_MAKE_ROOT], [
|
||||
ZFS_LINUX_TEST_SRC([d_make_root], [
|
||||
#include <linux/dcache.h>
|
||||
], [
|
||||
d_make_root(NULL);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_D_MAKE_ROOT], [
|
||||
AC_MSG_CHECKING([whether d_make_root() is available])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([d_make_root],
|
||||
[d_make_root], [fs/dcache.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_D_MAKE_ROOT, 1, [d_make_root() is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.28 API change
|
||||
dnl # Added d_obtain_alias() helper function.
|
||||
@ -43,31 +20,6 @@ AC_DEFUN([ZFS_AC_KERNEL_D_OBTAIN_ALIAS], [
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.12 API change
|
||||
dnl # d_prune_aliases() helper function available.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_D_PRUNE_ALIASES], [
|
||||
ZFS_LINUX_TEST_SRC([d_prune_aliases], [
|
||||
#include <linux/dcache.h>
|
||||
], [
|
||||
struct inode *ip = NULL;
|
||||
d_prune_aliases(ip);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_D_PRUNE_ALIASES], [
|
||||
AC_MSG_CHECKING([whether d_prune_aliases() is available])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([d_prune_aliases],
|
||||
[d_prune_aliases], [fs/dcache.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_D_PRUNE_ALIASES, 1,
|
||||
[d_prune_aliases() is available])
|
||||
], [
|
||||
ZFS_LINUX_TEST_ERROR([d_prune_aliases()])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.38 API change
|
||||
dnl # Added d_set_d_op() helper function.
|
||||
@ -90,101 +42,14 @@ AC_DEFUN([ZFS_AC_KERNEL_D_SET_D_OP], [
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.6 API change
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_D_REVALIDATE_NAMEIDATA], [
|
||||
ZFS_LINUX_TEST_SRC([dentry_operations_revalidate], [
|
||||
#include <linux/dcache.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
static int revalidate (struct dentry *dentry,
|
||||
struct nameidata *nidata) { return 0; }
|
||||
|
||||
static const struct dentry_operations
|
||||
dops __attribute__ ((unused)) = {
|
||||
.d_revalidate = revalidate,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA], [
|
||||
AC_MSG_CHECKING([whether dops->d_revalidate() takes struct nameidata])
|
||||
ZFS_LINUX_TEST_RESULT([dentry_operations_revalidate], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_D_REVALIDATE_NAMEIDATA, 1,
|
||||
[dops->d_revalidate() operation takes nameidata])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.30 API change
|
||||
dnl # The 'struct dentry_operations' was constified in the dentry structure.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_CONST_DENTRY_OPERATIONS], [
|
||||
ZFS_LINUX_TEST_SRC([dentry_operations_const], [
|
||||
#include <linux/dcache.h>
|
||||
|
||||
const struct dentry_operations test_d_op = {
|
||||
.d_revalidate = NULL,
|
||||
};
|
||||
],[
|
||||
struct dentry d __attribute__ ((unused));
|
||||
d.d_op = &test_d_op;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_CONST_DENTRY_OPERATIONS], [
|
||||
AC_MSG_CHECKING([whether dentry uses const struct dentry_operations])
|
||||
ZFS_LINUX_TEST_RESULT([dentry_operations_const], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_CONST_DENTRY_OPERATIONS, 1,
|
||||
[dentry uses const struct dentry_operations])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([const dentry_operations])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.38 API change
|
||||
dnl # Added sb->s_d_op default dentry_operations member
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_S_D_OP], [
|
||||
ZFS_LINUX_TEST_SRC([super_block_s_d_op], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
struct super_block sb __attribute__ ((unused));
|
||||
sb.s_d_op = NULL;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_S_D_OP], [
|
||||
AC_MSG_CHECKING([whether super_block has s_d_op])
|
||||
ZFS_LINUX_TEST_RESULT([super_block_s_d_op], [
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
ZFS_LINUX_TEST_ERROR([super_block s_d_op])
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_DENTRY], [
|
||||
ZFS_AC_KERNEL_SRC_D_MAKE_ROOT
|
||||
ZFS_AC_KERNEL_SRC_D_OBTAIN_ALIAS
|
||||
ZFS_AC_KERNEL_SRC_D_PRUNE_ALIASES
|
||||
ZFS_AC_KERNEL_SRC_D_SET_D_OP
|
||||
ZFS_AC_KERNEL_SRC_D_REVALIDATE_NAMEIDATA
|
||||
ZFS_AC_KERNEL_SRC_CONST_DENTRY_OPERATIONS
|
||||
ZFS_AC_KERNEL_SRC_S_D_OP
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_DENTRY], [
|
||||
ZFS_AC_KERNEL_D_MAKE_ROOT
|
||||
ZFS_AC_KERNEL_D_OBTAIN_ALIAS
|
||||
ZFS_AC_KERNEL_D_PRUNE_ALIASES
|
||||
ZFS_AC_KERNEL_D_SET_D_OP
|
||||
ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA
|
||||
ZFS_AC_KERNEL_CONST_DENTRY_OPERATIONS
|
||||
ZFS_AC_KERNEL_S_D_OP
|
||||
])
|
||||
|
@ -1,29 +0,0 @@
|
||||
dnl #
|
||||
dnl # 3.0 API change
|
||||
dnl # The sops->dirty_inode() callbacks were updated to take a flags
|
||||
dnl # argument. This allows the greater control over whether the
|
||||
dnl # filesystem needs to push out a transaction or not.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_DIRTY_INODE], [
|
||||
ZFS_LINUX_TEST_SRC([dirty_inode_with_flags], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static void dirty_inode(struct inode *a, int b) { return; }
|
||||
|
||||
static const struct super_operations
|
||||
sops __attribute__ ((unused)) = {
|
||||
.dirty_inode = dirty_inode,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_DIRTY_INODE], [
|
||||
AC_MSG_CHECKING([whether sops->dirty_inode() wants flags])
|
||||
ZFS_LINUX_TEST_RESULT([dirty_inode_with_flags], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_DIRTY_INODE_WITH_FLAGS, 1,
|
||||
[sops->dirty_inode() wants flags])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
])
|
@ -1,27 +0,0 @@
|
||||
dnl #
|
||||
dnl # 3.5.0 API change
|
||||
dnl # torvalds/linux@b0b0382bb4904965a9e9fca77ad87514dfda0d1c changed the
|
||||
dnl # ->encode_fh() callback to pass the child inode and its parents inode
|
||||
dnl # rather than a dentry and a boolean saying whether we want the parent.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_ENCODE_FH_WITH_INODE], [
|
||||
ZFS_LINUX_TEST_SRC([export_operations_encode_fh], [
|
||||
#include <linux/exportfs.h>
|
||||
static int encode_fh(struct inode *inode, __u32 *fh, int *max_len,
|
||||
struct inode *parent) { return 0; }
|
||||
static struct export_operations eops __attribute__ ((unused))={
|
||||
.encode_fh = encode_fh,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_ENCODE_FH_WITH_INODE], [
|
||||
AC_MSG_CHECKING([whether eops->encode_fh() wants inode])
|
||||
ZFS_LINUX_TEST_RESULT([export_operations_encode_fh], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_ENCODE_FH_WITH_INODE, 1,
|
||||
[eops->encode_fh() wants child and parent inodes])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
@ -1,24 +0,0 @@
|
||||
dnl #
|
||||
dnl # 2.6.36 API change
|
||||
dnl # The sops->delete_inode() and sops->clear_inode() callbacks have
|
||||
dnl # replaced by a single sops->evict_inode() callback.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_EVICT_INODE], [
|
||||
ZFS_LINUX_TEST_SRC([evict_inode], [
|
||||
#include <linux/fs.h>
|
||||
static void evict_inode (struct inode * t) { return; }
|
||||
static struct super_operations sops __attribute__ ((unused)) = {
|
||||
.evict_inode = evict_inode,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_EVICT_INODE], [
|
||||
AC_MSG_CHECKING([whether sops->evict_inode() exists])
|
||||
ZFS_LINUX_TEST_RESULT([evict_inode], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_EVICT_INODE, 1, [sops->evict_inode() exists])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([evict_inode])
|
||||
])
|
||||
])
|
@ -1,23 +0,0 @@
|
||||
dnl #
|
||||
dnl # Linux 4.19 API
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_FADVISE], [
|
||||
ZFS_LINUX_TEST_SRC([file_fadvise], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static const struct file_operations
|
||||
fops __attribute__ ((unused)) = {
|
||||
.fadvise = NULL,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_FADVISE], [
|
||||
AC_MSG_CHECKING([whether fops->fadvise() exists])
|
||||
ZFS_LINUX_TEST_RESULT([file_fadvise], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FILE_FADVISE, 1, [fops->fadvise() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
@ -1,44 +0,0 @@
|
||||
dnl #
|
||||
dnl # Linux 2.6.38 - 3.x API
|
||||
dnl # The fallocate callback was moved from the inode_operations
|
||||
dnl # structure to the file_operations structure.
|
||||
dnl #
|
||||
dnl #
|
||||
dnl # Linux 3.15+
|
||||
dnl # fallocate learned a new flag, FALLOC_FL_ZERO_RANGE
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_FALLOCATE], [
|
||||
ZFS_LINUX_TEST_SRC([file_fallocate], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static long test_fallocate(struct file *file, int mode,
|
||||
loff_t offset, loff_t len) { return 0; }
|
||||
|
||||
static const struct file_operations
|
||||
fops __attribute__ ((unused)) = {
|
||||
.fallocate = test_fallocate,
|
||||
};
|
||||
], [])
|
||||
ZFS_LINUX_TEST_SRC([falloc_fl_zero_range], [
|
||||
#include <linux/falloc.h>
|
||||
],[
|
||||
int flags __attribute__ ((unused));
|
||||
flags = FALLOC_FL_ZERO_RANGE;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_FALLOCATE], [
|
||||
AC_MSG_CHECKING([whether fops->fallocate() exists])
|
||||
ZFS_LINUX_TEST_RESULT([file_fallocate], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_MSG_CHECKING([whether FALLOC_FL_ZERO_RANGE exists])
|
||||
ZFS_LINUX_TEST_RESULT([falloc_fl_zero_range], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FALLOC_FL_ZERO_RANGE, 1, [FALLOC_FL_ZERO_RANGE is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([file_fallocate])
|
||||
])
|
||||
])
|
@ -1,24 +0,0 @@
|
||||
dnl #
|
||||
dnl # 4.1 API change
|
||||
dnl # struct access file->f_path.dentry was replaced by accessor function
|
||||
dnl # since fix torvalds/linux@4bacc9c9234c ("overlayfs: Make f_path always
|
||||
dnl # point to the overlay and f_inode to the underlay").
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_FILE_DENTRY], [
|
||||
ZFS_LINUX_TEST_SRC([file_dentry], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
struct file *f = NULL;
|
||||
file_dentry(f);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_FILE_DENTRY], [
|
||||
AC_MSG_CHECKING([whether file_dentry() is available])
|
||||
ZFS_LINUX_TEST_RESULT([file_dentry], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FILE_DENTRY, 1, [file_dentry() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
@ -1,23 +0,0 @@
|
||||
dnl #
|
||||
dnl # 3.19 API change
|
||||
dnl # struct access f->f_dentry->d_inode was replaced by accessor function
|
||||
dnl # file_inode(f)
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_FILE_INODE], [
|
||||
ZFS_LINUX_TEST_SRC([file_inode], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
struct file *f = NULL;
|
||||
file_inode(f);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_FILE_INODE], [
|
||||
AC_MSG_CHECKING([whether file_inode() is available])
|
||||
ZFS_LINUX_TEST_RESULT([file_inode], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FILE_INODE, 1, [file_inode() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
31
sys/contrib/openzfs/config/kernel-file.m4
Normal file
31
sys/contrib/openzfs/config/kernel-file.m4
Normal file
@ -0,0 +1,31 @@
|
||||
dnl #
|
||||
dnl # 6.12 removed f_version from struct file
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_FILE_F_VERSION], [
|
||||
ZFS_LINUX_TEST_SRC([file_f_version], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static const struct f __attribute__((unused)) = {
|
||||
.f_version = 0;
|
||||
};
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_FILE_F_VERSION], [
|
||||
AC_MSG_CHECKING([whether file->f_version exists])
|
||||
ZFS_LINUX_TEST_RESULT([file_f_version], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FILE_F_VERSION, 1,
|
||||
[file->f_version exists])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_FILE], [
|
||||
ZFS_AC_KERNEL_FILE_F_VERSION
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_FILE], [
|
||||
ZFS_AC_KERNEL_SRC_FILE_F_VERSION
|
||||
])
|
@ -1,27 +0,0 @@
|
||||
dnl #
|
||||
dnl # filemap_range_has_page was not available till 4.13
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_FILEMAP], [
|
||||
ZFS_LINUX_TEST_SRC([filemap_range_has_page], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/pagemap.h>
|
||||
],[
|
||||
struct address_space *mapping = NULL;
|
||||
loff_t lstart = 0;
|
||||
loff_t lend = 0;
|
||||
bool ret __attribute__ ((unused));
|
||||
|
||||
ret = filemap_range_has_page(mapping, lstart, lend);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_FILEMAP], [
|
||||
AC_MSG_CHECKING([whether filemap_range_has_page() is available])
|
||||
ZFS_LINUX_TEST_RESULT([filemap_range_has_page], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FILEMAP_RANGE_HAS_PAGE, 1,
|
||||
[filemap_range_has_page() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
@ -1,53 +0,0 @@
|
||||
dnl #
|
||||
dnl # Check file_operations->fsync interface.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_FSYNC], [
|
||||
ZFS_LINUX_TEST_SRC([fsync_without_dentry], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static int test_fsync(struct file *f, int x) { return 0; }
|
||||
|
||||
static const struct file_operations
|
||||
fops __attribute__ ((unused)) = {
|
||||
.fsync = test_fsync,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([fsync_range], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static int test_fsync(struct file *f, loff_t a, loff_t b, int c)
|
||||
{ return 0; }
|
||||
|
||||
static const struct file_operations
|
||||
fops __attribute__ ((unused)) = {
|
||||
.fsync = test_fsync,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_FSYNC], [
|
||||
dnl #
|
||||
dnl # Linux 2.6.35 - Linux 3.0 API
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether fops->fsync() wants no dentry])
|
||||
ZFS_LINUX_TEST_RESULT([fsync_without_dentry], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_FSYNC_WITHOUT_DENTRY, 1,
|
||||
[fops->fsync() without dentry])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 3.1 - 3.x API
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether fops->fsync() wants range])
|
||||
ZFS_LINUX_TEST_RESULT([fsync_range], [
|
||||
AC_MSG_RESULT([range])
|
||||
AC_DEFINE(HAVE_FSYNC_RANGE, 1,
|
||||
[fops->fsync() with range])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([fops->fsync])
|
||||
])
|
||||
])
|
||||
])
|
@ -48,12 +48,16 @@ AC_DEFUN([ZFS_AC_KERNEL_GENERIC_FILLATTR], [
|
||||
AC_DEFINE(HAVE_GENERIC_FILLATTR_IDMAP_REQMASK, 1,
|
||||
[generic_fillattr requires struct mnt_idmap* and u32 request_mask])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
AC_MSG_CHECKING([whether generic_fillattr requires struct mnt_idmap*])
|
||||
ZFS_LINUX_TEST_RESULT([generic_fillattr_mnt_idmap], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_GENERIC_FILLATTR_IDMAP, 1,
|
||||
[generic_fillattr requires struct mnt_idmap*])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
AC_MSG_CHECKING([whether generic_fillattr requires struct user_namespace*])
|
||||
ZFS_LINUX_TEST_RESULT([generic_fillattr_userns], [
|
||||
AC_MSG_RESULT([yes])
|
||||
|
@ -49,18 +49,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
|
||||
bio_end_io_acct(bio, start_time);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([generic_acct_3args], [
|
||||
#include <linux/bio.h>
|
||||
|
||||
void (*generic_start_io_acct_f)(int, unsigned long,
|
||||
struct hd_struct *) = &generic_start_io_acct;
|
||||
void (*generic_end_io_acct_f)(int, struct hd_struct *,
|
||||
unsigned long) = &generic_end_io_acct;
|
||||
], [
|
||||
generic_start_io_acct(0, 0, NULL);
|
||||
generic_end_io_acct(0, NULL, 0);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([generic_acct_4args], [
|
||||
#include <linux/bio.h>
|
||||
|
||||
@ -138,23 +126,6 @@ AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [
|
||||
[generic_*_io_acct() 4 arg available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 3.19 API addition
|
||||
dnl #
|
||||
dnl # torvalds/linux@394ffa50 allows us to increment
|
||||
dnl # iostat counters without generic_make_request().
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether generic_*_io_acct wants 3 args])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_3args],
|
||||
[generic_start_io_acct], [block/bio.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1,
|
||||
[generic_*_io_acct() 3 arg available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
@ -1,25 +0,0 @@
|
||||
dnl #
|
||||
dnl # 4.10 API
|
||||
dnl #
|
||||
dnl # NULL inode_operations.readlink implies generic_readlink(), which
|
||||
dnl # has been made static.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_READLINK_GLOBAL], [
|
||||
ZFS_LINUX_TEST_SRC([generic_readlink_global], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
int i __attribute__ ((unused));
|
||||
i = generic_readlink(NULL, NULL, 0);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GENERIC_READLINK_GLOBAL], [
|
||||
AC_MSG_CHECKING([whether generic_readlink is global])
|
||||
ZFS_LINUX_TEST_RESULT([generic_readlink_global], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_GENERIC_READLINK, 1,
|
||||
[generic_readlink is global])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
])
|
@ -17,12 +17,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GENHD_FLAGS], [
|
||||
], [
|
||||
int flags __attribute__ ((unused)) = GENHD_FL_NO_PART;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([genhd_fl_no_part_scan], [
|
||||
#include <linux/blkdev.h>
|
||||
], [
|
||||
int flags __attribute__ ((unused)) = GENHD_FL_NO_PART_SCAN;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GENHD_FLAGS], [
|
||||
@ -30,29 +24,18 @@ AC_DEFUN([ZFS_AC_KERNEL_GENHD_FLAGS], [
|
||||
AC_MSG_CHECKING([whether GENHD_FL_EXT_DEVT flag is available])
|
||||
ZFS_LINUX_TEST_RESULT([genhd_fl_ext_devt], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(ZFS_GENHD_FL_EXT_DEVT, GENHD_FL_EXT_DEVT,
|
||||
AC_DEFINE(HAVE_GENHD_FL_EXT_DEVT, 1,
|
||||
[GENHD_FL_EXT_DEVT flag is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(ZFS_GENHD_FL_EXT_DEVT, 0,
|
||||
[GENHD_FL_EXT_DEVT flag is not available])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether GENHD_FL_NO_PART flag is available])
|
||||
ZFS_LINUX_TEST_RESULT([genhd_fl_no_part], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(ZFS_GENHD_FL_NO_PART, GENHD_FL_NO_PART,
|
||||
AC_DEFINE(HAVE_GENHD_FL_NO_PART, 1,
|
||||
[GENHD_FL_NO_PART flag is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether GENHD_FL_NO_PART_SCAN flag is available])
|
||||
ZFS_LINUX_TEST_RESULT([genhd_fl_no_part_scan], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(ZFS_GENHD_FL_NO_PART, GENHD_FL_NO_PART_SCAN,
|
||||
[GENHD_FL_NO_PART_SCAN flag is available])
|
||||
], [
|
||||
ZFS_LINUX_TEST_ERROR([GENHD_FL_NO_PART|GENHD_FL_NO_PART_SCAN])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
@ -1,104 +0,0 @@
|
||||
dnl #
|
||||
dnl # Supported get_link() interfaces checked newest to oldest.
|
||||
dnl # Note this interface used to be named follow_link.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_LINK], [
|
||||
ZFS_LINUX_TEST_SRC([inode_operations_get_link], [
|
||||
#include <linux/fs.h>
|
||||
static const char *get_link(struct dentry *de, struct inode *ip,
|
||||
struct delayed_call *done) { return "symlink"; }
|
||||
static struct inode_operations
|
||||
iops __attribute__ ((unused)) = {
|
||||
.get_link = get_link,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([inode_operations_get_link_cookie], [
|
||||
#include <linux/fs.h>
|
||||
static const char *get_link(struct dentry *de, struct
|
||||
inode *ip, void **cookie) { return "symlink"; }
|
||||
static struct inode_operations
|
||||
iops __attribute__ ((unused)) = {
|
||||
.get_link = get_link,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([inode_operations_follow_link], [
|
||||
#include <linux/fs.h>
|
||||
static const char *follow_link(struct dentry *de,
|
||||
void **cookie) { return "symlink"; }
|
||||
static struct inode_operations
|
||||
iops __attribute__ ((unused)) = {
|
||||
.follow_link = follow_link,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([inode_operations_follow_link_nameidata], [
|
||||
#include <linux/fs.h>
|
||||
static void *follow_link(struct dentry *de, struct
|
||||
nameidata *nd) { return (void *)NULL; }
|
||||
static struct inode_operations
|
||||
iops __attribute__ ((unused)) = {
|
||||
.follow_link = follow_link,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GET_LINK], [
|
||||
dnl #
|
||||
dnl # 4.5 API change
|
||||
dnl # The get_link interface has added a delayed done call and
|
||||
dnl # used it to retire the put_link() interface.
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether iops->get_link() passes delayed])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_get_link], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GET_LINK_DELAYED, 1, [iops->get_link() delayed])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 4.5 API change
|
||||
dnl # The follow_link() interface has been replaced by
|
||||
dnl # get_link() which behaves the same as before except:
|
||||
dnl # - An inode is passed as a separate argument
|
||||
dnl # - When called in RCU mode a NULL dentry is passed.
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether iops->get_link() passes cookie])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_get_link_cookie], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GET_LINK_COOKIE, 1,
|
||||
[iops->get_link() cookie])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 4.2 API change
|
||||
dnl # This kernel retired the nameidata structure.
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether iops->follow_link() passes cookie])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_follow_link], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FOLLOW_LINK_COOKIE, 1,
|
||||
[iops->follow_link() cookie])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.32 API
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether iops->follow_link() passes nameidata])
|
||||
ZFS_LINUX_TEST_RESULT(
|
||||
[inode_operations_follow_link_nameidata],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FOLLOW_LINK_NAMEIDATA, 1,
|
||||
[iops->follow_link() nameidata])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([get_link])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
@ -1,128 +0,0 @@
|
||||
dnl #
|
||||
dnl # 4.8 API change
|
||||
dnl #
|
||||
dnl # 75ef71840539 mm, vmstat: add infrastructure for per-node vmstats
|
||||
dnl # 599d0c954f91 mm, vmscan: move LRU lists to node
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GLOBAL_NODE_PAGE_STATE], [
|
||||
ZFS_LINUX_TEST_SRC([global_node_page_state], [
|
||||
#include <linux/mm.h>
|
||||
#include <linux/vmstat.h>
|
||||
],[
|
||||
(void) global_node_page_state(0);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_NODE_PAGE_STATE], [
|
||||
AC_MSG_CHECKING([whether global_node_page_state() exists])
|
||||
ZFS_LINUX_TEST_RESULT([global_node_page_state], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(ZFS_GLOBAL_NODE_PAGE_STATE, 1,
|
||||
[global_node_page_state() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.14 API change
|
||||
dnl #
|
||||
dnl # c41f012ade0b mm: rename global_page_state to global_zone_page_state
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GLOBAL_ZONE_PAGE_STATE], [
|
||||
ZFS_LINUX_TEST_SRC([global_zone_page_state], [
|
||||
#include <linux/mm.h>
|
||||
#include <linux/vmstat.h>
|
||||
],[
|
||||
(void) global_zone_page_state(0);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE], [
|
||||
AC_MSG_CHECKING([whether global_zone_page_state() exists])
|
||||
ZFS_LINUX_TEST_RESULT([global_zone_page_state], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(ZFS_GLOBAL_ZONE_PAGE_STATE, 1,
|
||||
[global_zone_page_state() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Create a define and autoconf variable for an enum member
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_ENUM_MEMBER], [
|
||||
AC_MSG_CHECKING([whether enum $2 contains $1])
|
||||
AS_IF([AC_TRY_COMMAND(
|
||||
"${srcdir}/scripts/enum-extract.pl" "$2" "$3" | grep -Eqx $1)],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(m4_join([_], [ZFS_ENUM], m4_toupper($2), $1), 1,
|
||||
[enum $2 contains $1])
|
||||
m4_join([_], [ZFS_ENUM], m4_toupper($2), $1)=1
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Sanity check helpers
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_ERROR],[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_RESULT([$1 in either node_stat_item or zone_stat_item: $2])
|
||||
ZFS_LINUX_TEST_ERROR([global page state])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK], [
|
||||
enum_check_a="m4_join([_], [$ZFS_ENUM_NODE_STAT_ITEM], $1)"
|
||||
enum_check_b="m4_join([_], [$ZFS_ENUM_ZONE_STAT_ITEM], $1)"
|
||||
AS_IF([test -n "$enum_check_a" -a -n "$enum_check_b"],[
|
||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_ERROR([$1], [DUPLICATE])
|
||||
])
|
||||
AS_IF([test -z "$enum_check_a" -a -z "$enum_check_b"],[
|
||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_ERROR([$1], [NOT FOUND])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Ensure the config tests are finding one and only one of each enum.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE_SANITY], [
|
||||
AC_MSG_CHECKING([whether global_page_state enums are sane])
|
||||
|
||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_FILE_PAGES])
|
||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_INACTIVE_ANON])
|
||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_INACTIVE_FILE])
|
||||
|
||||
AC_MSG_RESULT(yes)
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GLOBAL_PAGE_STATE], [
|
||||
ZFS_AC_KERNEL_SRC_GLOBAL_NODE_PAGE_STATE
|
||||
ZFS_AC_KERNEL_SRC_GLOBAL_ZONE_PAGE_STATE
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # enum members in which we're interested
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE], [
|
||||
ZFS_AC_KERNEL_GLOBAL_NODE_PAGE_STATE
|
||||
ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE
|
||||
|
||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_FILE_PAGES],
|
||||
[node_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_ANON],
|
||||
[node_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_FILE],
|
||||
[node_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||
|
||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_FILE_PAGES],
|
||||
[zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_ANON],
|
||||
[zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_FILE],
|
||||
[zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||
|
||||
ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE_SANITY
|
||||
])
|
@ -1,22 +0,0 @@
|
||||
dnl #
|
||||
dnl # 4.9 API change
|
||||
dnl # group_info changed from 2d array via >blocks to 1d array via ->gid
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GROUP_INFO_GID], [
|
||||
ZFS_LINUX_TEST_SRC([group_info_gid], [
|
||||
#include <linux/cred.h>
|
||||
],[
|
||||
struct group_info gi __attribute__ ((unused)) = {};
|
||||
gi.gid[0] = KGIDT_INIT(0);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GROUP_INFO_GID], [
|
||||
AC_MSG_CHECKING([whether group_info->gid exists])
|
||||
ZFS_LINUX_TEST_RESULT([group_info_gid], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GROUP_INFO_GID, 1, [group_info->gid exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
@ -1,26 +0,0 @@
|
||||
dnl #
|
||||
dnl # 4.6 API change
|
||||
dnl # Added CPU hotplug APIs
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_CPU_HOTPLUG], [
|
||||
ZFS_LINUX_TEST_SRC([cpu_hotplug], [
|
||||
#include <linux/cpuhotplug.h>
|
||||
],[
|
||||
enum cpuhp_state state = CPUHP_ONLINE;
|
||||
int (*fp)(unsigned int, struct hlist_node *) = NULL;
|
||||
cpuhp_state_add_instance_nocalls(0, (struct hlist_node *)NULL);
|
||||
cpuhp_state_remove_instance_nocalls(0, (struct hlist_node *)NULL);
|
||||
cpuhp_setup_state_multi(state, "", fp, fp);
|
||||
cpuhp_remove_multi_state(0);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_CPU_HOTPLUG], [
|
||||
AC_MSG_CHECKING([whether CPU hotplug APIs exist])
|
||||
ZFS_LINUX_TEST_RESULT([cpu_hotplug], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_CPU_HOTPLUG, 1, [yes])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
@ -1,24 +0,0 @@
|
||||
dnl #
|
||||
dnl # 4.5 API change
|
||||
dnl # Added in_compat_syscall() which can be overridden on a per-
|
||||
dnl # architecture basis. Prior to this is_compat_task() was the
|
||||
dnl # provided interface.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_IN_COMPAT_SYSCALL], [
|
||||
ZFS_LINUX_TEST_SRC([in_compat_syscall], [
|
||||
#include <linux/compat.h>
|
||||
],[
|
||||
in_compat_syscall();
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_IN_COMPAT_SYSCALL], [
|
||||
AC_MSG_CHECKING([whether in_compat_syscall() is available])
|
||||
ZFS_LINUX_TEST_RESULT([in_compat_syscall], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1,
|
||||
[in_compat_syscall() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
@ -57,20 +57,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GETATTR], [
|
||||
.getattr = test_getattr,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([inode_operations_getattr_vfsmount], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static int test_getattr(
|
||||
struct vfsmount *mnt, struct dentry *d,
|
||||
struct kstat *k)
|
||||
{ return 0; }
|
||||
|
||||
static const struct inode_operations
|
||||
iops __attribute__ ((unused)) = {
|
||||
.getattr = test_getattr,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_GETATTR], [
|
||||
@ -105,18 +91,6 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_GETATTR], [
|
||||
[iops->getattr() takes a path])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # Kernel < 4.11 test
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether iops->getattr() takes a vfsmount])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_getattr_vfsmount], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_VFSMOUNT_IOPS_GETATTR, 1,
|
||||
[iops->getattr() takes a vfsmount])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
@ -1,24 +0,0 @@
|
||||
dnl #
|
||||
dnl # 4.7 API change
|
||||
dnl # i_mutex is changed to i_rwsem. Instead of directly using
|
||||
dnl # i_mutex/i_rwsem, we should use inode_lock() and inode_lock_shared()
|
||||
dnl # We test inode_lock_shared because inode_lock is introduced earlier.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_LOCK], [
|
||||
ZFS_LINUX_TEST_SRC([inode_lock], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
struct inode *inode = NULL;
|
||||
inode_lock_shared(inode);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_LOCK], [
|
||||
AC_MSG_CHECKING([whether inode_lock_shared() exists])
|
||||
ZFS_LINUX_TEST_RESULT([inode_lock], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_INODE_LOCK_SHARED, 1, [yes])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
@ -42,6 +42,8 @@ AC_DEFUN([ZFS_AC_KERNEL_PERMISSION], [
|
||||
AC_DEFINE(HAVE_IOPS_PERMISSION_IDMAP, 1,
|
||||
[iops->permission() takes struct mnt_idmap*])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether iops->permission() takes struct user_namespace*])
|
||||
ZFS_LINUX_TEST_RESULT([permission_userns], [
|
||||
AC_MSG_RESULT(yes)
|
||||
|
@ -1,22 +0,0 @@
|
||||
dnl #
|
||||
dnl # 3.15 API change
|
||||
dnl # inode_set_flags introduced to set i_flags
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_SET_FLAGS], [
|
||||
ZFS_LINUX_TEST_SRC([inode_set_flags], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
struct inode inode;
|
||||
inode_set_flags(&inode, S_IMMUTABLE, S_IMMUTABLE);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_SET_FLAGS], [
|
||||
AC_MSG_CHECKING([whether inode_set_flags() exists])
|
||||
ZFS_LINUX_TEST_RESULT([inode_set_flags], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_INODE_SET_FLAGS, 1, [inode_set_flags() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
@ -1,23 +0,0 @@
|
||||
dnl #
|
||||
dnl # 4.16 API change
|
||||
dnl # inode_set_iversion introduced to set i_version
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_SET_IVERSION], [
|
||||
ZFS_LINUX_TEST_SRC([inode_set_iversion], [
|
||||
#include <linux/iversion.h>
|
||||
],[
|
||||
struct inode inode;
|
||||
inode_set_iversion(&inode, 1);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_SET_IVERSION], [
|
||||
AC_MSG_CHECKING([whether inode_set_iversion() exists])
|
||||
ZFS_LINUX_TEST_RESULT([inode_set_iversion], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_INODE_SET_IVERSION, 1,
|
||||
[inode_set_iversion() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
@ -37,19 +37,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_SETATTR], [
|
||||
.setattr = test_setattr,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([inode_operations_setattr], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static int test_setattr(
|
||||
struct dentry *de, struct iattr *ia)
|
||||
{ return 0; }
|
||||
|
||||
static const struct inode_operations
|
||||
iops __attribute__ ((unused)) = {
|
||||
.setattr = test_setattr,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_SETATTR], [
|
||||
@ -73,15 +60,6 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_SETATTR], [
|
||||
[iops->setattr() takes struct user_namespace*])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether iops->setattr() exists])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_setattr], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_IOPS_SETATTR, 1,
|
||||
[iops->setattr() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
@ -14,20 +14,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_TIMES], [
|
||||
ts = timestamp_truncate(ts, &ip);
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.18 API change
|
||||
dnl # i_atime, i_mtime, and i_ctime changed from timespec to timespec64.
|
||||
dnl #
|
||||
ZFS_LINUX_TEST_SRC([inode_times], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
struct inode ip;
|
||||
struct timespec ts;
|
||||
|
||||
memset(&ip, 0, sizeof(ip));
|
||||
ts = ip.i_mtime;
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 6.6 API change
|
||||
dnl # i_ctime no longer directly accessible, must use
|
||||
@ -106,15 +92,6 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_TIMES], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether inode->i_*time's are timespec64])
|
||||
ZFS_LINUX_TEST_RESULT([inode_times], [
|
||||
AC_MSG_RESULT(no)
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_INODE_TIMESPEC64_TIMES, 1,
|
||||
[inode->i_*time's are timespec64])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether inode_get_ctime() exists])
|
||||
ZFS_LINUX_TEST_RESULT([inode_get_ctime], [
|
||||
AC_MSG_RESULT(yes)
|
||||
|
@ -1,41 +0,0 @@
|
||||
dnl #
|
||||
dnl # grsecurity API change,
|
||||
dnl # kmem_cache_create() with SLAB_USERCOPY flag replaced by
|
||||
dnl # kmem_cache_create_usercopy().
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KMEM_CACHE_CREATE_USERCOPY], [
|
||||
ZFS_LINUX_TEST_SRC([kmem_cache_create_usercopy], [
|
||||
#include <linux/slab.h>
|
||||
static void ctor(void *foo) { /* fake ctor */ }
|
||||
],[
|
||||
struct kmem_cache *skc_linux_cache;
|
||||
const char *name = "test";
|
||||
size_t size = 4096;
|
||||
size_t align = 8;
|
||||
unsigned long flags = 0;
|
||||
size_t useroffset = 0;
|
||||
size_t usersize = size - useroffset;
|
||||
|
||||
skc_linux_cache = kmem_cache_create_usercopy(
|
||||
name, size, align, flags, useroffset, usersize, ctor);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE_CREATE_USERCOPY], [
|
||||
AC_MSG_CHECKING([whether kmem_cache_create_usercopy() exists])
|
||||
ZFS_LINUX_TEST_RESULT([kmem_cache_create_usercopy], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KMEM_CACHE_CREATE_USERCOPY, 1,
|
||||
[kmem_cache_create_usercopy() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KMEM_CACHE], [
|
||||
ZFS_AC_KERNEL_SRC_KMEM_CACHE_CREATE_USERCOPY
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE], [
|
||||
ZFS_AC_KERNEL_KMEM_CACHE_CREATE_USERCOPY
|
||||
])
|
@ -57,31 +57,6 @@ AC_DEFUN([SPL_AC_DEBUG_KMEM_TRACKING], [
|
||||
AC_MSG_RESULT([$enable_debug_kmem_tracking])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.12 API,
|
||||
dnl # Added kvmalloc allocation strategy
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KVMALLOC], [
|
||||
ZFS_LINUX_TEST_SRC([kvmalloc], [
|
||||
#include <linux/mm.h>
|
||||
#include <linux/slab.h>
|
||||
],[
|
||||
void *p __attribute__ ((unused));
|
||||
|
||||
p = kvmalloc(0, GFP_KERNEL);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KVMALLOC], [
|
||||
AC_MSG_CHECKING([whether kvmalloc(ptr, flags) is available])
|
||||
ZFS_LINUX_TEST_RESULT([kvmalloc], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KVMALLOC, 1, [kvmalloc exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 5.8 API,
|
||||
dnl # __vmalloc PAGE_KERNEL removal
|
||||
@ -106,4 +81,4 @@ AC_DEFUN([ZFS_AC_KERNEL_VMALLOC_PAGE_KERNEL], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
-
|
||||
-
|
||||
|
@ -1,21 +0,0 @@
|
||||
dnl #
|
||||
dnl # 2.6.39 API change
|
||||
dnl # Added kstrtoul()
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KSTRTOUL], [
|
||||
ZFS_LINUX_TEST_SRC([kstrtoul], [
|
||||
#include <linux/kernel.h>
|
||||
],[
|
||||
int ret __attribute__ ((unused)) = kstrtoul(NULL, 10, NULL);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KSTRTOUL], [
|
||||
AC_MSG_CHECKING([whether kstrtoul() exists])
|
||||
ZFS_LINUX_TEST_RESULT([kstrtoul], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KSTRTOUL, 1, [kstrtoul() exists])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([kstrtoul()])
|
||||
])
|
||||
])
|
@ -15,7 +15,7 @@ AC_DEFUN([ZFS_AC_KERNEL_KTHREAD_COMPLETE_AND_EXIT], [
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KTHREAD_DEQUEUE_SIGNAL_4ARG], [
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KTHREAD_DEQUEUE_SIGNAL], [
|
||||
dnl #
|
||||
dnl # 5.17 API: enum pid_type * as new 4th dequeue_signal() argument,
|
||||
dnl # 5768d8906bc23d512b1a736c1e198aa833a6daa4 ("signal: Requeue signals in the appropriate queue")
|
||||
@ -23,12 +23,24 @@ AC_DEFUN([ZFS_AC_KERNEL_KTHREAD_DEQUEUE_SIGNAL_4ARG], [
|
||||
dnl # int dequeue_signal(struct task_struct *task, sigset_t *mask, kernel_siginfo_t *info);
|
||||
dnl # int dequeue_signal(struct task_struct *task, sigset_t *mask, kernel_siginfo_t *info, enum pid_type *type);
|
||||
dnl #
|
||||
dnl # 6.12 API: first arg struct_task* removed
|
||||
dnl # int dequeue_signal(sigset_t *mask, kernel_siginfo_t *info, enum pid_type *type);
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether dequeue_signal() takes 4 arguments])
|
||||
ZFS_LINUX_TEST_RESULT([kthread_dequeue_signal], [
|
||||
ZFS_LINUX_TEST_RESULT([kthread_dequeue_signal_4arg], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_DEQUEUE_SIGNAL_4ARG, 1, [dequeue_signal() takes 4 arguments])
|
||||
AC_DEFINE(HAVE_DEQUEUE_SIGNAL_4ARG, 1,
|
||||
[dequeue_signal() takes 4 arguments])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING([whether dequeue_signal() a task argument])
|
||||
ZFS_LINUX_TEST_RESULT([kthread_dequeue_signal_3arg_task], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_DEQUEUE_SIGNAL_3ARG_TASK, 1,
|
||||
[dequeue_signal() takes a task argument])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
@ -43,8 +55,19 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_KTHREAD_COMPLETE_AND_EXIT], [
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KTHREAD_DEQUEUE_SIGNAL_4ARG], [
|
||||
ZFS_LINUX_TEST_SRC([kthread_dequeue_signal], [
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KTHREAD_DEQUEUE_SIGNAL], [
|
||||
ZFS_LINUX_TEST_SRC([kthread_dequeue_signal_3arg_task], [
|
||||
#include <linux/sched/signal.h>
|
||||
], [
|
||||
struct task_struct *task = NULL;
|
||||
sigset_t *mask = NULL;
|
||||
kernel_siginfo_t *info = NULL;
|
||||
int error __attribute__ ((unused));
|
||||
|
||||
error = dequeue_signal(task, mask, info);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([kthread_dequeue_signal_4arg], [
|
||||
#include <linux/sched/signal.h>
|
||||
], [
|
||||
struct task_struct *task = NULL;
|
||||
@ -59,10 +82,10 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_KTHREAD_DEQUEUE_SIGNAL_4ARG], [
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KTHREAD], [
|
||||
ZFS_AC_KERNEL_KTHREAD_COMPLETE_AND_EXIT
|
||||
ZFS_AC_KERNEL_KTHREAD_DEQUEUE_SIGNAL_4ARG
|
||||
ZFS_AC_KERNEL_KTHREAD_DEQUEUE_SIGNAL
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KTHREAD], [
|
||||
ZFS_AC_KERNEL_SRC_KTHREAD_COMPLETE_AND_EXIT
|
||||
ZFS_AC_KERNEL_SRC_KTHREAD_DEQUEUE_SIGNAL_4ARG
|
||||
ZFS_AC_KERNEL_SRC_KTHREAD_DEQUEUE_SIGNAL
|
||||
])
|
||||
|
@ -1,55 +0,0 @@
|
||||
dnl #
|
||||
dnl # 4.18: ktime_get_coarse_real_ts64() replaces current_kernel_time64().
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KTIME_GET_COARSE_REAL_TS64], [
|
||||
ZFS_LINUX_TEST_SRC([ktime_get_coarse_real_ts64], [
|
||||
#include <linux/mm.h>
|
||||
], [
|
||||
struct timespec64 ts;
|
||||
ktime_get_coarse_real_ts64(&ts);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KTIME_GET_COARSE_REAL_TS64], [
|
||||
AC_MSG_CHECKING([whether ktime_get_coarse_real_ts64() exists])
|
||||
ZFS_LINUX_TEST_RESULT([ktime_get_coarse_real_ts64], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KTIME_GET_COARSE_REAL_TS64, 1,
|
||||
[ktime_get_coarse_real_ts64() exists])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.18: ktime_get_raw_ts64() replaces getrawmonotonic64().
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KTIME_GET_RAW_TS64], [
|
||||
ZFS_LINUX_TEST_SRC([ktime_get_raw_ts64], [
|
||||
#include <linux/mm.h>
|
||||
], [
|
||||
struct timespec64 ts;
|
||||
ktime_get_raw_ts64(&ts);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KTIME_GET_RAW_TS64], [
|
||||
AC_MSG_CHECKING([whether ktime_get_raw_ts64() exists])
|
||||
ZFS_LINUX_TEST_RESULT([ktime_get_raw_ts64], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KTIME_GET_RAW_TS64, 1,
|
||||
[ktime_get_raw_ts64() exists])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KTIME], [
|
||||
ZFS_AC_KERNEL_SRC_KTIME_GET_COARSE_REAL_TS64
|
||||
ZFS_AC_KERNEL_SRC_KTIME_GET_RAW_TS64
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KTIME], [
|
||||
ZFS_AC_KERNEL_KTIME_GET_COARSE_REAL_TS64
|
||||
ZFS_AC_KERNEL_KTIME_GET_RAW_TS64
|
||||
])
|
@ -1,27 +0,0 @@
|
||||
dnl #
|
||||
dnl # 3.11 API change
|
||||
dnl # lseek_execute helper exported
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_LSEEK_EXECUTE], [
|
||||
ZFS_LINUX_TEST_SRC([lseek_execute], [
|
||||
#include <linux/fs.h>
|
||||
], [
|
||||
struct file *fp __attribute__ ((unused)) = NULL;
|
||||
struct inode *ip __attribute__ ((unused)) = NULL;
|
||||
loff_t offset __attribute__ ((unused)) = 0;
|
||||
loff_t maxsize __attribute__ ((unused)) = 0;
|
||||
|
||||
lseek_execute(fp, ip, offset, maxsize);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_LSEEK_EXECUTE], [
|
||||
AC_MSG_CHECKING([whether lseek_execute() is available])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([lseek_execute],
|
||||
[lseek_exclusive], [fs/read_write.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_LSEEK_EXECUTE, 1, [lseek_execute() is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
@ -2,14 +2,6 @@ dnl #
|
||||
dnl # Check for make_request_fn interface.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN], [
|
||||
ZFS_LINUX_TEST_SRC([make_request_fn_void], [
|
||||
#include <linux/blkdev.h>
|
||||
static void make_request(struct request_queue *q,
|
||||
struct bio *bio) { return; }
|
||||
],[
|
||||
blk_queue_make_request(NULL, &make_request);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([make_request_fn_blk_qc_t], [
|
||||
#include <linux/blkdev.h>
|
||||
static blk_qc_t make_request(struct request_queue *q,
|
||||
@ -197,36 +189,20 @@ AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # Linux 3.2 API Change
|
||||
dnl # make_request_fn returns void.
|
||||
dnl # Linux 4.4 API Change
|
||||
dnl # make_request_fn returns blk_qc_t.
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether make_request_fn() returns void])
|
||||
ZFS_LINUX_TEST_RESULT([make_request_fn_void], [
|
||||
[whether make_request_fn() returns blk_qc_t])
|
||||
ZFS_LINUX_TEST_RESULT([make_request_fn_blk_qc_t], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(MAKE_REQUEST_FN_RET, void,
|
||||
AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
|
||||
[make_request_fn() return type])
|
||||
AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_VOID, 1,
|
||||
[Noting that make_request_fn() returns void])
|
||||
AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
|
||||
[Noting that make_request_fn() ]
|
||||
[returns blk_qc_t])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # Linux 4.4 API Change
|
||||
dnl # make_request_fn returns blk_qc_t.
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether make_request_fn() returns blk_qc_t])
|
||||
ZFS_LINUX_TEST_RESULT([make_request_fn_blk_qc_t], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
|
||||
[make_request_fn() return type])
|
||||
AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
|
||||
[Noting that make_request_fn() ]
|
||||
[returns blk_qc_t])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([make_request_fn])
|
||||
])
|
||||
ZFS_LINUX_TEST_ERROR([make_request_fn])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
@ -68,6 +68,8 @@ AC_DEFUN([ZFS_AC_KERNEL_MKDIR], [
|
||||
AC_DEFINE(HAVE_IOPS_MKDIR_IDMAP, 1,
|
||||
[iops->mkdir() takes struct mnt_idmap*])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 5.12 API change
|
||||
dnl # The struct user_namespace arg was added as the first argument to
|
||||
@ -80,15 +82,6 @@ AC_DEFUN([ZFS_AC_KERNEL_MKDIR], [
|
||||
[iops->mkdir() takes struct user_namespace*])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether iops->mkdir() takes umode_t])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_mkdir], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_MKDIR_UMODE_T, 1,
|
||||
[iops->mkdir() takes umode_t])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([mkdir()])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
24
sys/contrib/openzfs/config/kernel-mm-page-flags.m4
Normal file
24
sys/contrib/openzfs/config/kernel-mm-page-flags.m4
Normal file
@ -0,0 +1,24 @@
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_MM_PAGE_FLAG_ERROR], [
|
||||
ZFS_LINUX_TEST_SRC([mm_page_flag_error], [
|
||||
#include <linux/page-flags.h>
|
||||
|
||||
static enum pageflags
|
||||
test_flag __attribute__((unused)) = PG_error;
|
||||
])
|
||||
])
|
||||
AC_DEFUN([ZFS_AC_KERNEL_MM_PAGE_FLAG_ERROR], [
|
||||
AC_MSG_CHECKING([whether PG_error flag is available])
|
||||
ZFS_LINUX_TEST_RESULT([mm_page_flag_error], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_MM_PAGE_FLAG_ERROR, 1, [PG_error flag is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_MM_PAGE_FLAGS], [
|
||||
ZFS_AC_KERNEL_SRC_MM_PAGE_FLAG_ERROR
|
||||
])
|
||||
AC_DEFUN([ZFS_AC_KERNEL_MM_PAGE_FLAGS], [
|
||||
ZFS_AC_KERNEL_MM_PAGE_FLAG_ERROR
|
||||
])
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user