ztest.c (842727c2f41f01b380de4f5e787d905702870f23) | ztest.c (ae46e4c775f2becc5343ff90b60a95acb79735f9) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 1463 unchanged lines hidden (view full) --- 1472 error = dmu_objset_open(name, DMU_OST_OTHER, basemode, &os); 1473 if (error != ENOENT) 1474 fatal(1, "dmu_objset_open(%s) found destroyed dataset %p", 1475 name, os); 1476 1477 /* 1478 * Verify that we can create a new dataset. 1479 */ | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 1463 unchanged lines hidden (view full) --- 1472 error = dmu_objset_open(name, DMU_OST_OTHER, basemode, &os); 1473 if (error != ENOENT) 1474 fatal(1, "dmu_objset_open(%s) found destroyed dataset %p", 1475 name, os); 1476 1477 /* 1478 * Verify that we can create a new dataset. 1479 */ |
1480 error = dmu_objset_create(name, DMU_OST_OTHER, NULL, 0, | 1480 error = dmu_objset_create(name, DMU_OST_OTHER, 0, |
1481 ztest_create_cb, NULL); 1482 if (error) { 1483 if (error == ENOSPC) { 1484 ztest_record_enospc("dmu_objset_create"); 1485 (void) rw_unlock(&ztest_shared->zs_name_lock); 1486 return; 1487 } 1488 fatal(0, "dmu_objset_create(%s) = %d", name, error); --- 39 unchanged lines hidden (view full) --- 1528 zil_resume(zilog); 1529 } 1530 } 1531 } 1532 1533 /* 1534 * Verify that we cannot create an existing dataset. 1535 */ | 1481 ztest_create_cb, NULL); 1482 if (error) { 1483 if (error == ENOSPC) { 1484 ztest_record_enospc("dmu_objset_create"); 1485 (void) rw_unlock(&ztest_shared->zs_name_lock); 1486 return; 1487 } 1488 fatal(0, "dmu_objset_create(%s) = %d", name, error); --- 39 unchanged lines hidden (view full) --- 1528 zil_resume(zilog); 1529 } 1530 } 1531 } 1532 1533 /* 1534 * Verify that we cannot create an existing dataset. 1535 */ |
1536 error = dmu_objset_create(name, DMU_OST_OTHER, NULL, 0, NULL, NULL); | 1536 error = dmu_objset_create(name, DMU_OST_OTHER, 0, NULL, NULL); |
1537 if (error != EEXIST) 1538 fatal(0, "created existing dataset, error = %d", error); 1539 1540 /* 1541 * Verify that multiple dataset holds are allowed, but only when 1542 * the new access mode is compatible with the base mode. 1543 */ 1544 if (basemode == DS_MODE_OWNER) { --- 125 unchanged lines hidden (view full) --- 1670 fatal(0, "dmu_take_snapshot(%s) = %d", snap1name, error); 1671 } 1672 1673 error = dmu_objset_open(snap1name, DMU_OST_OTHER, 1674 DS_MODE_USER | DS_MODE_READONLY, &clone); 1675 if (error) 1676 fatal(0, "dmu_open_snapshot(%s) = %d", snap1name, error); 1677 | 1537 if (error != EEXIST) 1538 fatal(0, "created existing dataset, error = %d", error); 1539 1540 /* 1541 * Verify that multiple dataset holds are allowed, but only when 1542 * the new access mode is compatible with the base mode. 1543 */ 1544 if (basemode == DS_MODE_OWNER) { --- 125 unchanged lines hidden (view full) --- 1670 fatal(0, "dmu_take_snapshot(%s) = %d", snap1name, error); 1671 } 1672 1673 error = dmu_objset_open(snap1name, DMU_OST_OTHER, 1674 DS_MODE_USER | DS_MODE_READONLY, &clone); 1675 if (error) 1676 fatal(0, "dmu_open_snapshot(%s) = %d", snap1name, error); 1677 |
1678 error = dmu_objset_create(clone1name, DMU_OST_OTHER, clone, 0, 1679 NULL, NULL); | 1678 error = dmu_objset_clone(clone1name, dmu_objset_ds(clone), 0); |
1680 dmu_objset_close(clone); 1681 if (error) { 1682 if (error == ENOSPC) { 1683 ztest_record_enospc("dmu_objset_create"); 1684 goto out; 1685 } 1686 fatal(0, "dmu_objset_create(%s) = %d", clone1name, error); 1687 } --- 18 unchanged lines hidden (view full) --- 1706 fatal(0, "dmu_open_snapshot(%s) = %d", snap3name, error); 1707 } 1708 1709 error = dmu_objset_open(snap3name, DMU_OST_OTHER, 1710 DS_MODE_USER | DS_MODE_READONLY, &clone); 1711 if (error) 1712 fatal(0, "dmu_open_snapshot(%s) = %d", snap3name, error); 1713 | 1679 dmu_objset_close(clone); 1680 if (error) { 1681 if (error == ENOSPC) { 1682 ztest_record_enospc("dmu_objset_create"); 1683 goto out; 1684 } 1685 fatal(0, "dmu_objset_create(%s) = %d", clone1name, error); 1686 } --- 18 unchanged lines hidden (view full) --- 1705 fatal(0, "dmu_open_snapshot(%s) = %d", snap3name, error); 1706 } 1707 1708 error = dmu_objset_open(snap3name, DMU_OST_OTHER, 1709 DS_MODE_USER | DS_MODE_READONLY, &clone); 1710 if (error) 1711 fatal(0, "dmu_open_snapshot(%s) = %d", snap3name, error); 1712 |
1714 error = dmu_objset_create(clone2name, DMU_OST_OTHER, clone, 0, 1715 NULL, NULL); | 1713 error = dmu_objset_clone(clone2name, dmu_objset_ds(clone), 0); |
1716 dmu_objset_close(clone); 1717 if (error) { 1718 if (error == ENOSPC) { 1719 ztest_record_enospc("dmu_objset_create"); 1720 goto out; 1721 } 1722 fatal(0, "dmu_objset_create(%s) = %d", clone2name, error); 1723 } --- 2067 unchanged lines hidden (view full) --- 3791 za[t].za_start = za[0].za_start; 3792 za[t].za_stop = za[0].za_stop; 3793 za[t].za_kill = za[0].za_kill; 3794 3795 if (t < zopt_datasets) { 3796 int test_future = FALSE; 3797 (void) rw_rdlock(&ztest_shared->zs_name_lock); 3798 (void) snprintf(name, 100, "%s/%s_%d", pool, pool, d); | 1714 dmu_objset_close(clone); 1715 if (error) { 1716 if (error == ENOSPC) { 1717 ztest_record_enospc("dmu_objset_create"); 1718 goto out; 1719 } 1720 fatal(0, "dmu_objset_create(%s) = %d", clone2name, error); 1721 } --- 2067 unchanged lines hidden (view full) --- 3789 za[t].za_start = za[0].za_start; 3790 za[t].za_stop = za[0].za_stop; 3791 za[t].za_kill = za[0].za_kill; 3792 3793 if (t < zopt_datasets) { 3794 int test_future = FALSE; 3795 (void) rw_rdlock(&ztest_shared->zs_name_lock); 3796 (void) snprintf(name, 100, "%s/%s_%d", pool, pool, d); |
3799 error = dmu_objset_create(name, DMU_OST_OTHER, NULL, 0, | 3797 error = dmu_objset_create(name, DMU_OST_OTHER, 0, |
3800 ztest_create_cb, NULL); 3801 if (error == EEXIST) { 3802 test_future = TRUE; 3803 } else if (error == ENOSPC) { 3804 zs->zs_enospc_count++; 3805 (void) rw_unlock(&ztest_shared->zs_name_lock); 3806 break; 3807 } else if (error != 0) { --- 324 unchanged lines hidden --- | 3798 ztest_create_cb, NULL); 3799 if (error == EEXIST) { 3800 test_future = TRUE; 3801 } else if (error == ENOSPC) { 3802 zs->zs_enospc_count++; 3803 (void) rw_unlock(&ztest_shared->zs_name_lock); 3804 break; 3805 } else if (error != 0) { --- 324 unchanged lines hidden --- |