summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEric Schrock <[email protected]>2012-04-27 11:14:46 -0700
committerBrian Behlendorf <[email protected]>2012-08-23 10:39:43 -0700
commitdb49968e5ca7814bf833477f27c148208a835a7d (patch)
tree5f862ec545bb6063af112d9a8b491bd3c74b35f8 /lib
parente346ec25af02c6a7820e7c2a0da71b451a4be70f (diff)
Illumos #2635: 'zfs rename -f' to perform force unmount
Reviewed by: Matt Ahrens <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Bill Pijewski <[email protected]> Reviewed by: Richard Elling <[email protected]> Approved by: Richard Lowe <[email protected]> References: https://www.illumos.org/issues/2635 Ported by: Martin Matuska <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #717
Diffstat (limited to 'lib')
-rw-r--r--lib/libzfs/libzfs_dataset.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c
index 2d795d33a..f216291d2 100644
--- a/lib/libzfs/libzfs_dataset.c
+++ b/lib/libzfs/libzfs_dataset.c
@@ -3760,7 +3760,8 @@ zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, boolean_t force)
* Renames the given dataset.
*/
int
-zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive)
+zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive,
+ boolean_t force_unmount)
{
int ret;
zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
@@ -3882,7 +3883,8 @@ zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive)
goto error;
}
} else {
- if ((cl = changelist_gather(zhp, ZFS_PROP_NAME, 0, 0)) == NULL)
+ if ((cl = changelist_gather(zhp, ZFS_PROP_NAME, 0,
+ force_unmount ? MS_FORCE : 0)) == NULL)
return (-1);
if (changelist_haszonedchild(cl)) {