Lines Matching defs:snapshot
139 struct spdk_blob_list *snapshot = NULL;
142 TAILQ_FOREACH(snapshot, &bs->snapshots, link) {
756 struct spdk_blob *snapshot, *snapshot2;
777 /* Create snapshot from blob */
790 snapshot = g_blob;
791 CU_ASSERT(snapshot->data_ro == true);
792 CU_ASSERT(snapshot->md_ro == true);
793 CU_ASSERT(spdk_blob_get_num_clusters(snapshot) == 10);
794 CU_ASSERT(spdk_blob_get_num_allocated_clusters(snapshot) == 10);
802 /* Try to create snapshot from clone with xattrs */
823 /* Confirm that blob is backed by snapshot2 and snapshot2 is backed by snapshot */
824 CU_ASSERT(snapshot->back_bs_dev == NULL);
832 CU_ASSERT(blob_bs_dev->blob == snapshot);
852 /* Confirm that blob is clone of snapshot2, and snapshot2 is clone of snapshot */
863 /* Try to create snapshot from snapshot */
876 /* Delete snapshot2 and confirm that it is no longer on snapshot clone list */
883 ut_blob_close_and_delete(bs, snapshot);
905 /* Test freeze I/O during snapshot */
941 /* Verify snapshot */
965 struct spdk_blob *blob, *snapshot, *clone;
981 /* Create snapshot */
992 snapshot = g_blob;
993 CU_ASSERT(snapshot->data_ro == true);
994 CU_ASSERT(snapshot->md_ro == true);
995 CU_ASSERT(spdk_blob_get_num_clusters(snapshot) == 10);
997 spdk_blob_close(snapshot, blob_op_complete, NULL);
1001 /* Create clone from snapshot with xattrs */
1083 struct spdk_blob *blob, *snapshot;
1131 snapshot = g_blob;
1132 CU_ASSERT(snapshot->data_ro == true);
1133 CU_ASSERT(snapshot->md_ro == true);
1134 CU_ASSERT(spdk_blob_get_num_clusters(snapshot) == 10);
1136 spdk_blob_close(snapshot, blob_op_complete, NULL);
1161 /* Now, it should be possible to delete snapshot */
2555 struct spdk_blob *blob, *snapshot;
2568 /* Create snapshot */
2579 snapshot = g_blob;
2582 snapshot->md_ro = false;
2583 rc = blob_set_xattr(snapshot, SNAPSHOT_PENDING_REMOVAL, &blobid, sizeof(spdk_blob_id), true);
2585 snapshot->md_ro = true;
2587 spdk_blob_close(snapshot, blob_op_complete, NULL);
2603 snapshot = g_blob;
2606 rc = spdk_blob_get_xattr_value(snapshot, SNAPSHOT_PENDING_REMOVAL, &value, &value_len);
2610 snapshot->md_ro = false;
2611 rc = blob_set_xattr(snapshot, SNAPSHOT_PENDING_REMOVAL, &blobid, sizeof(spdk_blob_id), true);
2613 snapshot->md_ro = true;
2628 spdk_blob_close(snapshot, blob_op_complete, NULL);
2714 struct spdk_blob *blob, *snapshot;
2742 /* Create snapshot */
2753 snapshot = g_blob;
2755 spdk_blob_close(snapshot, blob_op_complete, NULL);
2804 /* Check the blob and the snapshot are still available */
2819 snapshot = g_blob;
2821 spdk_blob_close(snapshot, blob_op_complete, NULL);
4762 struct spdk_blob *blob, *snapshot;
4951 /* Create a snapshot */
4964 snapshot = g_blob;
4990 ut_blob_close_and_delete(bs, snapshot);
5288 struct spdk_blob *blob, *snapshot;
5334 /* Create snapshot from blob */
5345 snapshot = g_blob;
5346 CU_ASSERT(snapshot->data_ro == true);
5347 CU_ASSERT(snapshot->md_ro == true);
5349 CU_ASSERT(spdk_blob_get_num_clusters(snapshot) == 5);
5385 /* Data on snapshot should not change after write to clone */
5387 spdk_blob_io_read(snapshot, channel, payload_read, 4, 10, blob_op_complete, NULL);
5393 ut_blob_close_and_delete(bs, snapshot);
5406 struct spdk_blob *blob, *snapshot;
5431 /* Create snapshot from blob */
5442 snapshot = g_blob;
5443 CU_ASSERT(snapshot->data_ro == true);
5444 CU_ASSERT(snapshot->md_ro == true);
5445 CU_ASSERT(spdk_blob_get_num_clusters(snapshot) == 5);
5488 ut_blob_close_and_delete(bs, snapshot);
5497 * snapshot |xxxxxxxxx|xxxxxxxxx|xxxxxxxxx|xxxxxxxxx| - |
5511 * on snapshot2 and snapshot removed . . .
5516 * snapshot |xxxxxxxxx|xxxxxxxxx|xxxxxxxxx|xxxxxxxxx| - |
5522 * on snapshot2 removed and on snapshot still exists. Snapshot2
5523 * should remain a clone of snapshot.
5529 struct spdk_blob *blob, *snapshot, *snapshot2;
5595 /* 2) Create snapshot from blob (first level) */
5606 snapshot = g_blob;
5607 CU_ASSERT(snapshot->data_ro == true);
5608 CU_ASSERT(snapshot->md_ro == true);
5610 CU_ASSERT(spdk_blob_get_num_clusters(snapshot) == 5);
5614 * Last cluster shouldn't be written, to be sure that snapshot nor clone
5645 /* 3) Create second levels snapshot from blob */
5693 spdk_blob_close(snapshot, blob_op_complete, NULL);
5697 /* Check snapshot-clone relations */
5768 /* Try to delete base snapshot */
5773 /* Reopen blob after snapshot deletion */
5810 * snapshot
5825 struct spdk_blob *blob, *snapshot, *snapshot2, *clone, *clone2;
5854 /* blob should not have underlying snapshot nor clones */
5863 /* 2. Create snapshot */
5875 snapshot = g_blob;
5877 CU_ASSERT(spdk_blob_is_read_only(snapshot));
5878 CU_ASSERT(spdk_blob_is_snapshot(snapshot));
5879 CU_ASSERT(!spdk_blob_is_clone(snapshot));
5880 CU_ASSERT(snapshot->parent_id == SPDK_BLOBID_INVALID);
5883 /* Check if original blob is converted to the clone of snapshot */
5898 /* 3. Create clone from snapshot */
5924 /* Check if clone is on the snapshot's list */
5932 /* 4. Create snapshot of the clone */
5953 * is a child of snapshot */
6023 spdk_blob_close(snapshot, blob_op_complete, NULL);
6031 /* Try to delete snapshot with more than 1 clone */
6053 /* snapshot */
6205 /* 3. Create another snapshot */
6234 /* 4. Create clone from snapshot */
6251 /* Check if clone is on the snapshot's list */
6259 /* 5. Create snapshot of the clone */
6287 /* 6. Create another snapshot of the clone */
6315 /* 7. Remove snapshot 4 */
6319 /* Check if relations are back to state from before creating snapshot 4 */
6329 /* 8. Create second clone of snapshot 3 and try to remove snapshot 3 */
6341 /* 9. Open snapshot 3 again and try to remove it while clone 3 is closed */
6361 /* 10. Remove snapshot 1 */
6363 /* Check snapshot 1 and snapshot 2 allocated clusters */
6369 /* Check if relations are back to state from before creating snapshot 4 (before step 6) */
6373 /* Check that snapshot 2 has the clusters that were allocated to snapshot 1 */
6598 * If md of snapshot 2 was updated, it should be possible to delete it */
6687 struct spdk_blob *blob, *snapshot;
6721 /* Create snapshot */
6736 /* Do not shut down cleanly. Assumption is that after snapshot deletion
6756 snapshot = g_blob;
6763 rc = spdk_blob_get_xattr_value(snapshot, SNAPSHOT_PENDING_REMOVAL, &value, &value_len);
6765 SPDK_CU_ASSERT_FATAL(spdk_blob_is_thin_provisioned(snapshot) == false);
6767 CU_ASSERT(spdk_blob_get_num_allocated_clusters(snapshot) == 10);
6769 spdk_blob_close(snapshot, blob_op_complete, NULL);
6777 * This UT should test until snapshot is deleted and delete call succeeds. */
6801 struct spdk_blob *blob, *snapshot;
6839 /* Create snapshot */
6847 /* Do not shut down cleanly. Assumption is that after create snapshot
6868 snapshot = g_blob;
6870 SPDK_CU_ASSERT_FATAL(spdk_blob_is_thin_provisioned(snapshot) == false);
6872 CU_ASSERT(spdk_blob_get_num_allocated_clusters(snapshot) == 10);
6879 rc = spdk_blob_get_xattr_value(snapshot, SNAPSHOT_IN_PROGRESS, &value, &value_len);
6882 spdk_blob_close(snapshot, blob_op_complete, NULL);
7536 struct spdk_blob *blob, *snapshot, *clone;
7608 /* Create snapshot */
7620 snapshot = g_blob;
7635 test_io_read(dev, snapshot, channel);
7639 test_iov_read(dev, snapshot, channel, false);
7643 test_iov_read(dev, snapshot, channel, true);
7665 spdk_blob_close(snapshot, blob_op_complete, NULL);
7786 struct spdk_blob *blob, *snapshot;
7800 /* Create snapshot and try to remove blob in the same time:
7801 * - snapshot should be created successfully
7822 snapshot = g_blob;
7839 /* Clone snapshot and try to remove snapshot in the same time:
7840 * - snapshot should be cloned successfully
7889 ut_blob_close_and_delete(bs, snapshot);
8019 /* Create first snapshot */
8050 /* Now decouple the second snapshot forcing it to copy the written clusters */
8055 /* Verify that the snapshot has been decoupled and that the clusters have been copied */
8316 /* Create and open a snapshot of eclone1 */
8894 * When a snapshot is created, the blob that is being snapped becomes
8895 * the leaf node (a clone of the snapshot) and the newly created
8896 * snapshot sits between the snapped blob and the external snapshot.
8967 * Create a snapshot of the blob. The snapshot becomes the esnap clone.
8985 * Delete the snapshot. The original blob becomes the esnap clone.
8993 * Create the snapshot again, then delete the original blob. The
8994 * snapshot should survive as the esnap clone.
9017 * Clone the snapshot. The snapshot continues to be the esnap clone.
9035 * Delete the snapshot. The clone becomes the esnap clone.
9156 /* Replace the external snapshot */
9185 /* Replace the external snapshot */
9281 /* Resize a blob which is a clone created from snapshot. Verify read/writes to
9309 /* Create snapshot */
9335 /* Create another snapshot after resizing the clone */
9342 /* Open the snapshot blobs */
9583 /* Make a snapshot over blob */
9748 /* Call set_parent with a blob and its parent snapshot */
9764 /* Call set_parent with a non snapshot parent */
9769 /* Call set_parent with blob and snapshot of different size */
9774 /* Call set_parent correctly with a snapshot's clone blob */
9786 /* Create another normal blob with size equal to esnap size and make a snapshot */
9924 /* Call set_parent correctly with a snapshot's clone blob */