diff options
author | Keith M Wesolowski <wesolows@foobazco.org> | 2013-08-27 00:59:04 +0000 |
---|---|---|
committer | Keith M Wesolowski <wesolows@foobazco.org> | 2013-08-27 00:59:04 +0000 |
commit | 7bf5a6f485b8d8bb5c024482e916542997c5d6b6 (patch) | |
tree | f0a0bf8503f8174fd9b500feff8547cab885132d /usr/src/lib/libbe/common/be_snapshot.c | |
parent | d907c5084d3f67c85c5551ee093457940f8aec17 (diff) | |
download | illumos-joyent-7bf5a6f485b8d8bb5c024482e916542997c5d6b6.tar.gz |
back out merge: incompatible ZFS throttling mechanisms
Diffstat (limited to 'usr/src/lib/libbe/common/be_snapshot.c')
-rw-r--r-- | usr/src/lib/libbe/common/be_snapshot.c | 64 |
1 files changed, 21 insertions, 43 deletions
diff --git a/usr/src/lib/libbe/common/be_snapshot.c b/usr/src/lib/libbe/common/be_snapshot.c index d63528d05e..2cb011ea5a 100644 --- a/usr/src/lib/libbe/common/be_snapshot.c +++ b/usr/src/lib/libbe/common/be_snapshot.c @@ -24,7 +24,7 @@ */ /* - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. */ /* @@ -323,15 +323,6 @@ be_rollback(nvlist_t *be_attrs) sizeof (obe_root_ds)); bt.obe_root_ds = obe_root_ds; - if (getzoneid() != GLOBAL_ZONEID) { - if (!be_zone_compare_uuids(bt.obe_root_ds)) { - be_print_err(gettext("be_rollback: rolling back zone " - "root dataset from non-active global BE is not " - "supported\n")); - return (BE_ERR_NOTSUP); - } - } - /* Get handle to BE's root dataset */ if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, ZFS_TYPE_DATASET)) == NULL) { be_print_err(gettext("be_rollback: " @@ -438,16 +429,6 @@ _be_create_snapshot(char *be_name, char **snap_name, char *policy) sizeof (root_ds)); bt.obe_root_ds = root_ds; - if (getzoneid() != GLOBAL_ZONEID) { - if (!be_zone_compare_uuids(bt.obe_root_ds)) { - be_print_err(gettext("be_create_snapshot: creating " - "snapshot for the zone root dataset from " - "non-active global BE is not " - "supported\n")); - return (BE_ERR_NOTSUP); - } - } - /* If BE policy not specified, use the default policy */ if (bt.policy == NULL) { bt.policy = be_default_policy(); @@ -501,30 +482,27 @@ _be_create_snapshot(char *be_name, char **snap_name, char *policy) * cleanup policy there. Otherwise don't set one - this snapshot * will always inherit the cleanup policy from its parent. */ - if (getzoneid() == GLOBAL_ZONEID) { - if (pool_version >= SPA_VERSION_SNAP_PROPS) { - if (nvlist_alloc(&ss_props, NV_UNIQUE_NAME, 0) != 0) { - be_print_err(gettext("be_create_snapshot: " - "internal error: out of memory\n")); - return (BE_ERR_NOMEM); - } - if (nvlist_add_string(ss_props, BE_POLICY_PROPERTY, - bt.policy) != 0) { - be_print_err(gettext("be_create_snapshot: " - "internal error: out of memory\n")); - nvlist_free(ss_props); - return (BE_ERR_NOMEM); - } - } else if (policy != NULL) { - /* - * If an explicit cleanup policy was requested - * by the caller and we don't support it, error out. - */ - be_print_err(gettext("be_create_snapshot: cannot set " - "cleanup policy: ZFS pool version is %d\n"), - pool_version); - return (BE_ERR_NOTSUP); + if (pool_version >= SPA_VERSION_SNAP_PROPS) { + if (nvlist_alloc(&ss_props, NV_UNIQUE_NAME, 0) != 0) { + be_print_err(gettext("be_create_snapshot: internal " + "error: out of memory\n")); + return (BE_ERR_NOMEM); } + if (nvlist_add_string(ss_props, BE_POLICY_PROPERTY, bt.policy) + != 0) { + be_print_err(gettext("be_create_snapshot: internal " + "error: out of memory\n")); + nvlist_free(ss_props); + return (BE_ERR_NOMEM); + } + } else if (policy != NULL) { + /* + * If an explicit cleanup policy was requested + * by the caller and we don't support it, error out. + */ + be_print_err(gettext("be_create_snapshot: cannot set " + "cleanup policy: ZFS pool version is %d\n"), pool_version); + return (BE_ERR_NOTSUP); } /* Create the snapshots recursively */ |