HomeFreeBSD

zfs_rename: restructure to have cleaner fallbacks

Description

zfs_rename: restructure to have cleaner fallbacks

This is in preparation for RENAME_EXCHANGE and RENAME_WHITEOUT support
for ZoL, but the changes here allow for far nicer fallbacks than the
previous implementation (the source and target are re-linked in case of
the final link failing).

In addition, a small cleanup was done for the "target exists but is a
different type" codepath so that it's more understandable.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Closes #12209
Closes #14070

Details

Provenance
Aleksa Sarai <cyphar@cyphar.com>Authored on Apr 26 2019, 1:23 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Oct 28 2022, 4:48 PM
Parents
rG7b3ba2965437: debug: add VERIFY_{IMPLY,EQUIV} variants
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGe015d6cc0b60: zfs_rename: restructure to have cleaner fallbacks (authored by Aleksa Sarai <cyphar@cyphar.com>).Oct 28 2022, 4:48 PM