Spdk/test/unit/lib
Maciej Szwed 622127d7e1 blobstore: Make possible to remove snapshot if there is only one clone
Starting with this patch it is possible to remove a
snapshot if there is only a one clone created from it.

In such case snapshot can be removed without any data
copying. This is achieved with following steps (case
with only one clone):
1. Open snapshot (Snapshot1) that shall be removed
2. Check if the Snapshot1 has no more than 1 clone (Clone1)
3. Remove Clone1 entry from Snapshot1
4. If the Snapshot1 has a parent snapshot (Snapshot2):
 4a. Add Clone1 entry to the Snapshot2 clones list
 4b. Remove Snapshot1 entry from Snapshot2 clones list
5. Open Clone1 blob
6. Freeze I/O operations on Clone1
7. Temporarily override md_ro flag for Snapshot1 and Clone1
   for MD modification
8. Merge Snapshot1 and Clone1 clusters maps into Clone1
   clusters map
9a. If Snapshot2 is present switch parent ID and backing
    bs_dev on Clone1
9b. If Snapshot2 is not present set parent ID to
    SPDK_BLOBID_INVALID and backing bs_dev to zeroes_dev
10. Sync MD on Clone1
11. Sync MD on Snapshot1
12. Restore MD flags for Clone1 and Snapshot1
13. Unfreeze I/O on Clone1
14. Close Clone1 blob
15. Remove Snapshot1

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I800724b981af894e01e1912d0077c5b34a2ae634
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445576
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-18 13:19:32 +00:00
..
bdev blobstore: Make possible to remove snapshot if there is only one clone 2019-06-18 13:19:32 +00:00
blob blobstore: Make possible to remove snapshot if there is only one clone 2019-06-18 13:19:32 +00:00
blobfs UT/blobfs: add asynchronous Write/Read unit tests 2019-06-17 06:37:54 +00:00
event event: No longer require event in spdk_subsystem_fini 2019-03-08 03:21:45 +00:00
ftl lib/ftl: Read partially lba map during relocation 2019-06-11 06:21:46 +00:00
ioat test/unit: remove duplicate mk/spdk.common.mk includes 2019-02-11 09:30:27 +00:00
iscsi iscsi: Fix UT failure due to uninitialized value detected by valgrind 2019-06-18 06:55:44 +00:00
json json: add utilities function enabling itaration over JSON object 2018-10-18 16:07:37 +00:00
jsonrpc jsonrpc: fix received JSON buffer overwrite 2019-01-10 14:31:37 +00:00
log log: passing user-defined log 2019-06-18 03:56:50 +00:00
lvol lvol: Fix for lvol failed deletion flow 2019-04-02 19:23:22 +00:00
notify lib/notify: rename spdk_notify_get_events to spdk_notify_foreach_event 2019-05-07 06:11:27 +00:00
nvme unit/nvme: add wait for completion unit test 2019-06-07 18:31:47 +00:00
nvmf nvmf: Fix connect command SQ size validation for IO queues 2019-06-18 11:39:29 +00:00
reduce ut/reduce: use compress algorithm 2019-04-02 21:40:21 +00:00
scsi scsi: Add data offset to DIF context separately from start block address 2019-06-11 18:53:58 +00:00
sock sock: Add spdk_sock_readv(sock, iov, iovcnt) 2019-03-08 01:21:26 +00:00
thread thread: Add a mechanism to exit a lightweight thread 2019-05-22 04:23:17 +00:00
util dif: Change data_len of spdk_dif_set_md_interleave_iovs to be remaining length 2019-06-18 04:25:33 +00:00
vhost vhost: abstract vring call mechanism as it is transport-specific 2019-06-03 20:14:08 +00:00
json_mock.c subsystem: add per module configuration dump 2018-03-23 02:47:40 -04:00
Makefile bdev/nvme: always enable FTL 2019-05-02 08:41:56 +00:00