]> git.proxmox.com Git - mirror_zfs.git/commit
libzfs: add v2 iterator interfaces
authorRob N <rob.norris@klarasystems.com>
Mon, 10 Apr 2023 18:53:02 +0000 (04:53 +1000)
committerGitHub <noreply@github.com>
Mon, 10 Apr 2023 18:53:02 +0000 (11:53 -0700)
commitbaca06c258e07522165cb8e33ff2c0224ad0da57
tree29e79b53588481635d4d1e37995a9ee22be852dd
parentff73574cd83580e4dd5905a43695bd5d0f4911b3
libzfs: add v2 iterator interfaces

f6a0dac84 modified the zfs_iter_* functions to take a new "flags"
parameter, and introduced a variety of flags to ask the kernel to limit
the results in various ways, reducing the amount of work the caller
needed to do to filter out things they didn't need.

Unfortunately this change broke the ABI for existing clients (read:
older versions of the `zfs` program), and was reverted 399b98198.

dc95911d2 reintroduced the original patch, with the understanding that a
backwards-compatible fix would be made before the 2.2 release branch was
tagged. This commit is that fix.

This introduces zfs_iter_*_v2 functions that have the new flags
argument, and reverts the existing functions to not have the flags
parameter, as they were before. The old functions are now reimplemented
in terms of the new, with flags set to 0.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Wilson <george.wilson@delphix.com>
Original-patch-by: George Wilson <george.wilson@delphix.com>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Sponsored-by: Klara, Inc.
Closes #14597
12 files changed:
cmd/zfs/zfs_iter.c
cmd/zfs/zfs_main.c
cmd/zpool/zpool_main.c
contrib/pam_zfs_key/pam_zfs_key.c
include/libzfs.h
lib/libzfs/libzfs.abi
lib/libzfs/libzfs_changelist.c
lib/libzfs/libzfs_crypto.c
lib/libzfs/libzfs_dataset.c
lib/libzfs/libzfs_iter.c
lib/libzfs/libzfs_mount.c
lib/libzfs/libzfs_sendrecv.c