mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
snapshot: move virtsnap code from tool to lib
Move code for removal dependency from tool's remove.c into lib's manipulation code. Same code then works with lvm2app.
This commit is contained in:
parent
6b35c70e8b
commit
81504ba70c
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.104
|
Version 2.02.104
|
||||||
===================================
|
===================================
|
||||||
|
Move code to remove virtual snapshot from tools to lib for lvm2app.
|
||||||
Fix possible race during daemon worker thread creation (lvmetad).
|
Fix possible race during daemon worker thread creation (lvmetad).
|
||||||
Fix possible deadlock while clearing lvmetad cache for full rescan.
|
Fix possible deadlock while clearing lvmetad cache for full rescan.
|
||||||
Fix possible race while creating/destroying memory pools.
|
Fix possible race while creating/destroying memory pools.
|
||||||
|
@ -4685,6 +4685,7 @@ int lv_remove_with_dependencies(struct cmd_context *cmd, struct logical_volume *
|
|||||||
struct dm_list *snh, *snht;
|
struct dm_list *snh, *snht;
|
||||||
struct lv_list *lvl;
|
struct lv_list *lvl;
|
||||||
struct lvinfo info;
|
struct lvinfo info;
|
||||||
|
struct logical_volume *origin;
|
||||||
int is_last_pool;
|
int is_last_pool;
|
||||||
|
|
||||||
if (lv_is_cow(lv)) {
|
if (lv_is_cow(lv)) {
|
||||||
@ -4713,7 +4714,10 @@ int lv_remove_with_dependencies(struct cmd_context *cmd, struct logical_volume *
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if (!level && lv_is_virtual_origin(origin = origin_from_cow(lv)))
|
||||||
|
/* If this is a sparse device, remove its origin too. */
|
||||||
|
/* Stacking is not supported */
|
||||||
|
lv = origin;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lv_is_origin(lv)) {
|
if (lv_is_origin(lv)) {
|
||||||
|
@ -18,14 +18,6 @@
|
|||||||
static int lvremove_single(struct cmd_context *cmd, struct logical_volume *lv,
|
static int lvremove_single(struct cmd_context *cmd, struct logical_volume *lv,
|
||||||
void *handle __attribute__((unused)))
|
void *handle __attribute__((unused)))
|
||||||
{
|
{
|
||||||
struct logical_volume *origin;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If this is a sparse device, remove its origin too.
|
|
||||||
*/
|
|
||||||
if (lv_is_cow(lv) && lv_is_virtual_origin(origin = origin_from_cow(lv)))
|
|
||||||
lv = origin;
|
|
||||||
|
|
||||||
if (!lv_remove_with_dependencies(cmd, lv, (force_t) arg_count(cmd, force_ARG), 0))
|
if (!lv_remove_with_dependencies(cmd, lv, (force_t) arg_count(cmd, force_ARG), 0))
|
||||||
return_ECMD_FAILED;
|
return_ECMD_FAILED;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user