Lines Matching defs:bt

249 	be_transaction_data_t	bt = { 0 };
260 BE_ATTR_ORIG_BE_NAME, DATA_TYPE_STRING, &bt.obe_name, NULL) != 0) {
267 if (bt.obe_name == NULL) {
268 if ((ret = be_find_current_be(&bt)) != BE_SUCCESS) {
273 if (!be_valid_be_name(bt.obe_name)) {
275 "invalid BE name %s\n"), bt.obe_name);
281 if (nvlist_lookup_string(be_attrs, BE_ATTR_SNAP_NAME, &bt.obe_snap_name)
289 if ((zret = zpool_iter(g_zfs, be_find_zpool_callback, &bt)) == 0) {
291 "failed to find zpool for BE (%s)\n"), bt.obe_name);
301 be_make_root_ds(bt.obe_zpool, bt.obe_name, obe_root_ds,
303 bt.obe_root_ds = obe_root_ds;
306 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, ZFS_TYPE_DATASET)) == NULL) {
309 bt.obe_root_ds, libzfs_error_description(g_zfs));
318 if ((ret = be_rollback_check_callback(zhp, bt.obe_snap_name)) != 0) {
324 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, ZFS_TYPE_DATASET)) == NULL) {
327 bt.obe_root_ds, libzfs_error_description(g_zfs));
336 if ((ret = be_rollback_callback(zhp, bt.obe_snap_name)) != 0) {
339 "failed to rollback BE %s to %s\n"), bt.obe_name,
340 bt.obe_snap_name);
373 be_transaction_data_t bt = { 0 };
383 /* Set parameters in bt structure */
384 bt.obe_name = be_name;
385 bt.obe_snap_name = *snap_name;
386 bt.policy = policy;
389 if (bt.obe_name == NULL) {
390 if ((ret = be_find_current_be(&bt)) != BE_SUCCESS) {
396 if ((zret = zpool_iter(g_zfs, be_find_zpool_callback, &bt)) == 0) {
398 "find zpool for BE (%s)\n"), bt.obe_name);
407 be_make_root_ds(bt.obe_zpool, bt.obe_name, root_ds,
409 bt.obe_root_ds = root_ds;
412 if (bt.policy == NULL) {
413 bt.policy = be_default_policy();
416 if (!valid_be_policy(bt.policy)) {
418 "invalid BE policy type (%s)\n"), bt.policy);
427 if (bt.obe_snap_name == NULL) {
429 if ((bt.obe_snap_name = be_auto_snap_name())
439 (void) snprintf(ss, sizeof (ss), "%s@%s", bt.obe_root_ds,
440 bt.obe_snap_name);
443 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, ZFS_TYPE_DATASET))
447 bt.obe_root_ds, libzfs_error_description(g_zfs));
470 if (nvlist_add_string(ss_props, BE_POLICY_PROPERTY, bt.policy)
507 free(bt.obe_snap_name);
508 if ((bt.obe_snap_name =
519 bt.obe_root_ds, bt.obe_snap_name);
548 free(bt.obe_snap_name);
549 bt.obe_snap_name = NULL;
559 if (autoname && bt.obe_snap_name) {
560 *snap_name = bt.obe_snap_name;
587 be_transaction_data_t bt = { 0 };
600 /* Set parameters in bt structure */
601 bt.obe_name = be_name;
602 bt.obe_snap_name = snap_name;
605 if (bt.obe_name == NULL) {
606 if ((err = be_find_current_be(&bt)) != BE_SUCCESS) {
612 if ((ret = zpool_iter(g_zfs, be_find_zpool_callback, &bt)) == 0) {
614 "failed to find zpool for BE (%s)\n"), bt.obe_name);
623 be_make_root_ds(bt.obe_zpool, bt.obe_name, root_ds,
625 bt.obe_root_ds = root_ds;
627 zhp = zfs_open(g_zfs, bt.obe_root_ds, ZFS_TYPE_DATASET);
634 bt.obe_root_ds, libzfs_error_description(g_zfs));
640 (void) snprintf(ss, sizeof (ss), "%s@%s", bt.obe_name,
641 bt.obe_snap_name);
654 if (zfs_destroy_snaps(zhp, bt.obe_snap_name, B_FALSE) != 0) {