1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

activation: extend _cached_info

Add layer string to support check of layered devices.
This commit is contained in:
Zdenek Kabelac 2013-02-18 00:08:38 +01:00
parent 6a995bac43
commit 78b23f3595
2 changed files with 9 additions and 6 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.99 - Version 2.02.99 -
=================================== ===================================
Extend _cached_info() to accept layer string.
Allow identical table reload for RAID to restore transiently failed PVs. Allow identical table reload for RAID to restore transiently failed PVs.
vgimport '--force' now allows users to import VGs with missing PVs. vgimport '--force' now allows users to import VGs with missing PVs.
Fix PV alignment to incorporate alignment offset if the PV has zero MDAs. Fix PV alignment to incorporate alignment offset if the PV has zero MDAs.

View File

@ -481,14 +481,15 @@ int dev_manager_info(struct dm_pool *mem, const struct logical_volume *lv,
} }
static const struct dm_info *_cached_info(struct dm_pool *mem, static const struct dm_info *_cached_info(struct dm_pool *mem,
struct dm_tree *dtree,
const struct logical_volume *lv, const struct logical_volume *lv,
struct dm_tree *dtree) const char *layer)
{ {
const char *dlid; const char *dlid;
struct dm_tree_node *dnode; struct dm_tree_node *dnode;
const struct dm_info *dinfo; const struct dm_info *dinfo;
if (!(dlid = build_dm_uuid(mem, lv->lvid.s, NULL))) { if (!(dlid = build_dm_uuid(mem, lv->lvid.s, layer))) {
log_error("dlid build failed for %s", lv->name); log_error("dlid build failed for %s", lv->name);
return NULL; return NULL;
} }
@ -2169,10 +2170,11 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
* - open_count is always retrieved (as of dm-ioctl 4.7.0) * - open_count is always retrieved (as of dm-ioctl 4.7.0)
* so just use the tree's existing nodes' info * so just use the tree's existing nodes' info
*/ */
if (((dinfo = _cached_info(dm->mem, lv, if (((dinfo = _cached_info(dm->mem, dtree, lv, NULL)) &&
dtree)) && dinfo->open_count) || dinfo->open_count) ||
((dinfo = _cached_info(dm->mem, find_merging_cow(lv)->cow, ((dinfo = _cached_info(dm->mem, dtree,
dtree)) && dinfo->open_count)) { find_merging_cow(lv)->cow, NULL)) &&
dinfo->open_count)) {
/* FIXME Is there anything simpler to check for instead? */ /* FIXME Is there anything simpler to check for instead? */
if (!lv_has_target_type(dm->mem, lv, NULL, "snapshot-merge")) if (!lv_has_target_type(dm->mem, lv, NULL, "snapshot-merge"))
laopts->no_merging = 1; laopts->no_merging = 1;