summaryrefslogtreecommitdiff
path: root/usr/src/lib/libzfs/common/libzfs_dataset.c
diff options
context:
space:
mode:
authorEric Schrock <Eric.Schrock@delphix.com>2012-04-27 11:14:46 -0700
committerEric Schrock <Eric.Schrock@delphix.com>2012-04-27 11:14:46 -0700
commit6a9cb0ea17f11529b1bb8ca31944abd37736b99e (patch)
treec0efe885d4921bc461e7da8edb7e825c38ad5c34 /usr/src/lib/libzfs/common/libzfs_dataset.c
parent7d7551bcfe5ded1738ddbe3268520996a32023b4 (diff)
downloadillumos-joyent-6a9cb0ea17f11529b1bb8ca31944abd37736b99e.tar.gz
2635 'zfs rename -f' to perform force unmount
Reviewed by: Matt Ahrens <matt@delphix.com> Reviewed by: George Wilson <George.Wilson@delphix.com> Reviewed by: Bill Pijewski <wdp@joyent.com> Reviewed by: Richard Elling <richard.elling@richardelling.com> Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/lib/libzfs/common/libzfs_dataset.c')
-rw-r--r--usr/src/lib/libzfs/common/libzfs_dataset.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr/src/lib/libzfs/common/libzfs_dataset.c b/usr/src/lib/libzfs/common/libzfs_dataset.c
index 86b24bb7e1..43d71a465e 100644
--- a/usr/src/lib/libzfs/common/libzfs_dataset.c
+++ b/usr/src/lib/libzfs/common/libzfs_dataset.c
@@ -3546,7 +3546,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 };
@@ -3658,7 +3659,8 @@ zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive)
}
} 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)) {