Lines Matching defs:bt
253 be_transaction_data_t bt = { 0 };
265 if ((ret = be_find_current_be(&bt)) != BE_SUCCESS) {
281 bt.obe_name = obe_name;
283 if (!be_valid_be_name(bt.obe_name)) {
285 "invalid BE name %s\n"), bt.obe_name);
291 if (nvlist_lookup_string(be_attrs, BE_ATTR_SNAP_NAME, &bt.obe_snap_name)
299 if ((zphp = zpool_open(g_zfs, bt.obe_zpool)) == NULL) {
301 "open rpool (%s): %s\n"), bt.obe_zpool,
305 zret = be_find_zpool_callback(zphp, &bt);
308 if ((zret = zpool_iter(g_zfs, be_find_zpool_callback, &bt)) ==
311 "failed to find zpool for BE (%s)\n"), bt.obe_name);
322 be_make_root_ds(bt.obe_zpool, bt.obe_name, obe_root_ds,
324 bt.obe_root_ds = obe_root_ds;
327 if (!be_zone_compare_uuids(bt.obe_root_ds)) {
336 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, ZFS_TYPE_DATASET)) == NULL) {
339 bt.obe_root_ds, libzfs_error_description(g_zfs));
348 if ((ret = be_rollback_check_callback(zhp, bt.obe_snap_name)) != 0) {
354 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, ZFS_TYPE_DATASET)) == NULL) {
357 bt.obe_root_ds, libzfs_error_description(g_zfs));
366 if ((ret = be_rollback_callback(zhp, bt.obe_snap_name)) != 0) {
369 "failed to rollback BE %s to %s\n"), bt.obe_name,
370 bt.obe_snap_name);
403 be_transaction_data_t bt = { 0 };
413 /* Set parameters in bt structure */
414 bt.obe_name = be_name;
415 bt.obe_snap_name = *snap_name;
416 bt.policy = policy;
419 if (bt.obe_name == NULL) {
420 if ((ret = be_find_current_be(&bt)) != BE_SUCCESS) {
426 if ((zret = zpool_iter(g_zfs, be_find_zpool_callback, &bt)) == 0) {
428 "find zpool for BE (%s)\n"), bt.obe_name);
437 be_make_root_ds(bt.obe_zpool, bt.obe_name, root_ds,
439 bt.obe_root_ds = root_ds;
442 if (!be_zone_compare_uuids(bt.obe_root_ds)) {
452 if (bt.policy == NULL) {
453 bt.policy = be_default_policy();
456 if (!valid_be_policy(bt.policy)) {
458 "invalid BE policy type (%s)\n"), bt.policy);
467 if (bt.obe_snap_name == NULL) {
469 if ((bt.obe_snap_name = be_auto_snap_name())
479 (void) snprintf(ss, sizeof (ss), "%s@%s", bt.obe_root_ds,
480 bt.obe_snap_name);
483 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, ZFS_TYPE_DATASET))
487 bt.obe_root_ds, libzfs_error_description(g_zfs));
512 bt.policy) != 0) {
550 free(bt.obe_snap_name);
551 if ((bt.obe_snap_name =
562 bt.obe_root_ds, bt.obe_snap_name);
591 free(bt.obe_snap_name);
592 bt.obe_snap_name = NULL;
602 if (autoname && bt.obe_snap_name) {
603 *snap_name = bt.obe_snap_name;
629 be_transaction_data_t bt = { 0 };
642 /* Set parameters in bt structure */
643 bt.obe_name = be_name;
644 bt.obe_snap_name = snap_name;
647 if (bt.obe_name == NULL) {
648 if ((err = be_find_current_be(&bt)) != BE_SUCCESS) {
654 if ((ret = zpool_iter(g_zfs, be_find_zpool_callback, &bt)) == 0) {
656 "failed to find zpool for BE (%s)\n"), bt.obe_name);
665 be_make_root_ds(bt.obe_zpool, bt.obe_name, root_ds,
667 bt.obe_root_ds = root_ds;
669 zhp = zfs_open(g_zfs, bt.obe_root_ds, ZFS_TYPE_DATASET);
676 bt.obe_root_ds, libzfs_error_description(g_zfs));
682 (void) snprintf(ss, sizeof (ss), "%s@%s", bt.obe_name,
683 bt.obe_snap_name);
696 if (zfs_destroy_snaps(zhp, bt.obe_snap_name, B_FALSE) != 0) {