mirror_zfs/tests/zfs-tests/cmd
Alexander Motin fa697b94e6
FreeBSD: Add posix_fadvise(POSIX_FADV_WILLNEED) support
As commit 320f0c6 did for Linux, connect POSIX_FADV_WILLNEED
up to dmu_prefetch() on FreeBSD.

While there, fix portability problems in tests/functional/fadvise.

1.  Instead of relying on the numerical values of POSIX_FADV_XXX macros,
    accept macro names as arguments to the file_fadvise program.  (The
    numbers happen to match on Linux and FreeBSD, but future systems may
    vary and it seems a little strange/raw to count on that.)

2.  For implementation reasons, SEQUENTIAL doesn't reach ZFS via FreeBSD
    VFS currently (perhaps something that should be investigated in
    FreeBSD).  Since on Linux we're treating SEQUENTIAL and WILLNEED the
    same, it doesn't really matter which one we use, so switch the test
    over to WILLNEED exercise the new prefetch code on both OSes the
    same way.

Reviewed-by: Mateusz Guzik <mjg@FreeBSD.org>
Reviewed-by: Fedor Uporov <fuporov.vstack@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Thomas Munro <tmunro@FreeBSD.org>
Co-authored-by: Alexander Motin <mav@FreeBSD.org>
Closes #17379
2025-05-29 09:34:07 -04:00
..
checksum SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
file FreeBSD: Add posix_fadvise(POSIX_FADV_WILLNEED) support 2025-05-29 09:34:07 -04:00
linux_dos_attributes SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
.gitignore Linux/vnops: implement STATX_DIOALIGN 2025-03-13 13:15:14 -04:00
badsend.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
btree_test.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
chg_usr_exec.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
clone_mmap_cached.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
clone_mmap_write.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
clonefile.c Multiple printf() size fixes (#17199) 2025-04-01 15:27:03 -07:00
cp_files.c tests: move C test helpers into test cmd 2022-04-01 18:01:39 -07:00
crypto_test.c ZTS: ICP encryption tests 2025-02-25 17:29:57 -08:00
ctime.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
devname2devid.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dir_rd_update.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dosmode_readonly_write.c FreeBSD: Reduce divergence from in-tree sources 2023-10-09 13:27:18 -07:00
draid.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
ereports.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
get_diff.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
getversion.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
idmap_util.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
libzfs_input_check.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
Makefile.am FreeBSD: Add posix_fadvise(POSIX_FADV_WILLNEED) support 2025-05-29 09:34:07 -04:00
manipulate_user_buffer.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
mkbusy.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
mkfile.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
mkfiles.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
mktree.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
mmap_exec.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
mmap_libaio.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
mmap_seek.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
mmap_sync.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
mmapwrite.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
nvlist_to_lua.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
readmmap.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
rename_dir.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
renameat2.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
rm_lnkcnt_zero_file.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
send_doall.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
statx.c tests: fix S_IFMT undeclared at statx.c 2025-05-02 17:49:25 -04:00
stride_dd.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
suid_write_to_file.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
threadsappend.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
truncate_test.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
user_ns_exec.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
xattrtest.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zed_fd_spill-zedlet.c Miscellaneous ZTS fixes 2022-09-29 08:56:42 -07:00
zfs_diff-socket.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00