path: root/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
diff options
authorMariusz Zaborski <oshogbo@FreeBSD.org>2020-04-11 17:54:35 +0000
committerMariusz Zaborski <oshogbo@FreeBSD.org>2020-04-11 17:54:35 +0000
commit23ee238fe5e3971569b3bd2ed2a2930110550466 (patch)
treed86f4ab8d193d4922ae377273be7ba1132f83c12 /cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
parenteec362ef5816b61b79a98d28830c5ff1d757b3ae (diff)
zfs: Add option for forcible unmounting dataset while receiving snapshot.
Currently when the dataset is in use we can't receive snapshots. zfs send test/1@asd | zfs recv -FM test/2 cannot unmount '/test/2': Device busy This commits add option 'M' which attempts to forcibly unmount the dataset. Thanks to this we can enforce receiving snapshots in a single step. Note that this functionality is not supported on Linux because the VFS will prevent active mounted filesystems from being unmounted, even with the force option. This is the intended VFS behavior. Discussed-with: Pawel Jakub Dawidek <pjd@FreeBSD.org> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Allan Jude <allanjude@freebsd.org> Differential Revision: https://reviews.freebsd.org/D22306 openzfs/zfs@a57d3d45d6efdff935421e2ef3f97e3dc089d93d
Notes: svn path=/head/; revision=359808
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h')
1 files changed, 3 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
index f5dbe7209db6..7d67f9463a1f 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
@@ -737,6 +737,9 @@ typedef struct recvflags {
/* do not mount file systems as they are extracted (private) */
boolean_t nomount;
+ /* force unmount while recv snapshot (private) */
+ boolean_t forceunmount;
} recvflags_t;
extern int zfs_receive(libzfs_handle_t *, const char *, nvlist_t *,