]> git.proxmox.com Git - mirror_zfs.git/commit
Simplify and document OpenZFS library dependencies
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 7 Oct 2021 17:31:26 +0000 (10:31 -0700)
committerGitHub <noreply@github.com>
Thu, 7 Oct 2021 17:31:26 +0000 (11:31 -0600)
commit514498fef6977e4d1d6dc676710567384d6f6b39
treedea185662b7c79bc5937dae3adad3bc31bd7fecc
parent48df24d4ce7bbf14fedc10c5f33396d6cb42f5db
Simplify and document OpenZFS library dependencies

For those not already familiar with the code base it can be a
challenge to understand how the libraries are laid out.  This
has sometimes resulted in functionality being added in the
wrong place.  To help avoid that in the future this commit
documents the high-level dependencies for easy reference in
lib/Makefile.am.  It also simplifies a few things.

- Switched libzpool dependency on libzfs_core to libzutil.
  This change makes it clear libzpool should never depend
  on the ioctl() functionality provided by libzfs_core.

- Moved zfs_ioctl_fd() from libzutil to libzfs_core and
  renamed it lzc_ioctl_fd().  Normal access to the kmods
  should all be funneled through the libzfs_core library.
  The sole exception is the pool_active() which was updated
  to not use lzc_ioctl_fd() to remove the libzfs_core
  dependency.

- Removed libzfs_core dependency on libzutil.

- Removed the lib/libzfs/os/freebsd/libzfs_ioctl_compat.c
  source file which was all dead code.

- Removed libzfs_core dependency from mkbusy and ctime
  test utilities.  It was only needed for some trivial
  wrapper functions and that code is easy to replicate
  to shed the unneeded dependency.

Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Don Brady <don.brady@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #12602
23 files changed:
include/libzfs_core.h
include/libzutil.h
include/os/freebsd/zfs/sys/zfs_ioctl_compat.h
lib/Makefile.am
lib/libzfs/Makefile.am
lib/libzfs/libzfs.abi
lib/libzfs/os/freebsd/libzfs_compat.c
lib/libzfs/os/freebsd/libzfs_ioctl_compat.c [deleted file]
lib/libzfs_core/Makefile.am
lib/libzfs_core/libzfs_core.abi
lib/libzfs_core/libzfs_core.c
lib/libzfs_core/os/freebsd/libzfs_core_ioctl.c [new file with mode: 0644]
lib/libzfs_core/os/linux/libzfs_core_ioctl.c [new file with mode: 0644]
lib/libzpool/Makefile.am
lib/libzpool/util.c
lib/libzutil/Makefile.am
lib/libzutil/os/freebsd/zutil_compat.c [deleted file]
lib/libzutil/os/linux/zutil_compat.c [deleted file]
tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c
tests/zfs-tests/cmd/mkbusy/Makefile.am
tests/zfs-tests/cmd/mkbusy/mkbusy.c
tests/zfs-tests/tests/functional/ctime/Makefile.am
tests/zfs-tests/tests/functional/ctime/ctime.c