mirror_zfs/include/os/freebsd/zfs/sys
Aleksa Sarai dbf6108b4d zfs_rename: support RENAME_* flags
Implement support for Linux's RENAME_* flags (for renameat2). Aside from
being quite useful for userspace (providing race-free ways to exchange
paths and implement mv --no-clobber), they are used by overlayfs and are
thus required in order to use overlayfs-on-ZFS.

In order for us to represent the new renameat2(2) flags in the ZIL, we
create two new transaction types for the two flags which need
transactional-level support (RENAME_EXCHANGE and RENAME_WHITEOUT).
RENAME_NOREPLACE does not need any ZIL support because we know that if
the operation succeeded before creating the ZIL entry, there was no file
to be clobbered and thus it can be treated as a regular TX_RENAME.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Pavel Snajdr <snajpa@snajpa.net>
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Closes #12209
Closes #14070
2022-10-28 09:49:20 -07:00
..
arc_os.h FreeBSD: fix static module build broken in 7bb707ffa 2022-09-19 17:21:45 -07:00
freebsd_crypto.h module: icp: fold away all key formats except CRYPTO_KEY_RAW 2022-02-15 16:25:07 -08:00
freebsd_event.h FreeBSD: add knlist_init_sx() for exclusive locks 2022-09-06 09:48:57 -07:00
sha2.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
vdev_os.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zfs_bootenv_os.h zfs label bootenv should store data as nvlist 2020-09-15 15:42:27 -07:00
zfs_context_os.h Cleanup: Use OpenSolaris functions to call scheduler 2022-09-12 09:55:37 -07:00
zfs_ctldir.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zfs_dir.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zfs_ioctl_compat.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zfs_vfsops_os.h Retire ZFS_TEARDOWN_TRY_ENTER_READ 2022-09-20 15:34:41 -07:00
zfs_vnops_os.h zfs_rename: support RENAME_* flags 2022-10-28 09:49:20 -07:00
zfs_znode_impl.h zfs_enter rework 2022-09-16 13:36:47 -07:00
zpl.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00