numam-spdk/lib
Maciej Szwed 3c22b8e41b 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>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445576 (master)

(cherry picked from commit 622127d7e1)
Change-Id: I800724b981af894e01e1912d0077c5b34a2ae634
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458464
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-19 10:24:59 +00:00
..
bdev blobstore: Make possible to remove snapshot if there is only one clone 2019-06-19 10:24:59 +00:00
blob blobstore: Make possible to remove snapshot if there is only one clone 2019-06-19 10:24:59 +00:00
blobfs blobfs: fix the semphore usage issue in spdk_file_read 2019-06-19 09:26:37 +00:00
conf string: spdk_strtol to delegate additional error checking 2019-01-29 00:10:57 +00:00
copy ioat: allocate device struct using regular calloc 2019-04-09 06:30:42 +00:00
env_dpdk env/dpdk: detach pci devices from EAL interrupt thread 2019-04-18 22:49:30 +00:00
event nvmf: add srq opts to get_nvmf_transports method. 2019-06-16 08:46:05 +00:00
ftl lib/ftl:fix scanbuild error in ftl_anm.c 2019-06-16 14:44:50 +00:00
ioat ioat: allocate device struct using regular calloc 2019-04-09 06:30:42 +00:00
iscsi iscsi: fix hang on high QD large reads 2019-06-16 14:44:50 +00:00
json json_util: add debug logs to spdk_json_decode_object function 2019-01-10 14:31:37 +00:00
jsonrpc jsonrpc: Use spdk_json_write_named_* APIs throughout 2019-02-04 07:08:04 +00:00
log app, log: clarify how to enable log flags 2019-03-29 02:35:48 +00:00
lvol lvol: Fix for lvol failed deletion flow 2019-04-02 19:23:22 +00:00
nbd nbd: optional nbd_device in start_nbd_disk 2019-04-04 08:35:50 +00:00
net net: Use spdk_json_write_named_* APIs throughout 2019-02-04 07:08:04 +00:00
notify notify: add notification library 2019-03-29 21:15:14 +00:00
nvme nvme: zero request->submit_tick in allocation 2019-06-18 19:00:37 +00:00
nvmf nvmf: fix assert in spdk_nvmf_tcp_req_fill_iovs 2019-06-18 19:00:37 +00:00
reduce reduce: account for compressed buffers 2019-04-02 21:40:21 +00:00
rocksdb rocksdb: use C++ constructor/destructor for thread_ctx 2019-04-25 20:04:04 +00:00
rpc rpc: fix segfault on get_spdk_version request with extra params 2019-06-18 19:02:49 +00:00
scsi lib/scsi: Make spdk_scsi_dev_destruct asynchronous 2019-04-22 18:22:59 +00:00
sock sock: fix a uninitialized-variable error 2019-06-16 08:46:05 +00:00
thread thread: fix deadlock in spdk_for_each_thread error handling 2019-06-16 08:46:05 +00:00
trace lib/trace: add trace_record tool 2019-01-30 06:36:25 +00:00
ut_mock thread: Eliminate use of pthread_self and thread_ids 2019-01-15 16:53:12 +00:00
util lib/util/cpuset: add negate and xor 2019-04-09 17:40:24 +00:00
vhost rte_vhost: fix compilation against dpdk master 2019-06-18 19:00:37 +00:00
virtio virtio: zero-out virtqueue structures at init 2019-04-22 16:49:39 +00:00
Makefile notify: add notification library 2019-03-29 21:15:14 +00:00