View | Details | Raw Unified | Return to bug 249579 | Differences between
and this patch

Collapse All | Expand All

(-)cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c (-1 / +8 lines)
Lines 468-473 Link Here
468
typedef struct iter_dependents_arg {
468
typedef struct iter_dependents_arg {
469
	boolean_t first;
469
	boolean_t first;
470
	boolean_t allowrecursion;
470
	boolean_t allowrecursion;
471
	boolean_t in_children;
471
	iter_stack_frame_t *stack;
472
	iter_stack_frame_t *stack;
472
	zfs_iter_f func;
473
	zfs_iter_f func;
473
	void *data;
474
	void *data;
Lines 479-488 Link Here
479
	iter_dependents_arg_t *ida = arg;
480
	iter_dependents_arg_t *ida = arg;
480
	int err = 0;
481
	int err = 0;
481
	boolean_t first = ida->first;
482
	boolean_t first = ida->first;
483
	boolean_t was_in_children;
482
	ida->first = B_FALSE;
484
	ida->first = B_FALSE;
483
485
484
	if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT) {
486
	if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT) {
485
		err = zfs_iter_clones(zhp, iter_dependents_cb, ida);
487
		if (ida->in_children)
488
			err = zfs_iter_clones(zhp, iter_dependents_cb, ida);
486
	} else if (zhp->zfs_type != ZFS_TYPE_BOOKMARK) {
489
	} else if (zhp->zfs_type != ZFS_TYPE_BOOKMARK) {
487
		iter_stack_frame_t isf;
490
		iter_stack_frame_t isf;
488
		iter_stack_frame_t *f;
491
		iter_stack_frame_t *f;
Lines 516-522 Link Here
516
		isf.zhp = zhp;
519
		isf.zhp = zhp;
517
		isf.next = ida->stack;
520
		isf.next = ida->stack;
518
		ida->stack = &isf;
521
		ida->stack = &isf;
522
		was_in_children = ida->in_children;
523
		ida->in_children = B_TRUE;
519
		err = zfs_iter_filesystems(zhp, iter_dependents_cb, ida);
524
		err = zfs_iter_filesystems(zhp, iter_dependents_cb, ida);
525
		ida->in_children = was_in_children;
520
		if (err == 0) {
526
		if (err == 0) {
521
			err = zfs_iter_snapshots(zhp, B_FALSE,
527
			err = zfs_iter_snapshots(zhp, B_FALSE,
522
			    iter_dependents_cb, ida, 0, 0);
528
			    iter_dependents_cb, ida, 0, 0);
Lines 542-546 Link Here
542
	ida.func = func;
548
	ida.func = func;
543
	ida.data = data;
549
	ida.data = data;
544
	ida.first = B_TRUE;
550
	ida.first = B_TRUE;
551
	ida.in_children = B_FALSE;
545
	return (iter_dependents_cb(zfs_handle_dup(zhp), &ida));
552
	return (iter_dependents_cb(zfs_handle_dup(zhp), &ida));
546
}
553
}

Return to bug 249579