mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
text_import: use radix tree to find lv_names
Replace dm_hash usage with radix_tree to quickly find LV name with a vg and also index PV name with set of available PVs. This PV index is only needed during the import, but instead of passing 'radix_tree *' everywhere, just keep this with a VG struct as well and once the parsing is finished, release radix_tree. This also makes it easier to replace this stucture in future if needed.
This commit is contained in:
parent
0733d0dd7d
commit
a66a09696f
@ -202,8 +202,7 @@ static int _settings_text_export(const struct lv_segment *seg,
|
||||
}
|
||||
|
||||
static int _cache_pool_text_import(struct lv_segment *seg,
|
||||
const struct dm_config_node *sn,
|
||||
struct dm_hash_table *pv_hash __attribute__((unused)))
|
||||
const struct dm_config_node *sn)
|
||||
{
|
||||
struct logical_volume *data_lv, *meta_lv;
|
||||
const char *str = NULL;
|
||||
@ -438,8 +437,7 @@ static const struct segtype_handler _cache_pool_ops = {
|
||||
};
|
||||
|
||||
static int _cache_text_import(struct lv_segment *seg,
|
||||
const struct dm_config_node *sn,
|
||||
struct dm_hash_table *pv_hash __attribute__((unused)))
|
||||
const struct dm_config_node *sn)
|
||||
{
|
||||
struct logical_volume *pool_lv, *origin_lv;
|
||||
const char *name;
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "lib/format_text/text_import.h"
|
||||
#include "lib/config/defaults.h"
|
||||
#include "lib/datastruct/str_list.h"
|
||||
#include "base/data-struct/radix-tree.h"
|
||||
|
||||
typedef int (*section_fn) (struct cmd_context *cmd,
|
||||
struct format_type *fmt,
|
||||
@ -34,9 +35,7 @@ typedef int (*section_fn) (struct cmd_context *cmd,
|
||||
struct volume_group *vg,
|
||||
struct lvmcache_vgsummary *vgsummary,
|
||||
const struct dm_config_node *pvn,
|
||||
const struct dm_config_node *vgn,
|
||||
struct dm_hash_table *pv_hash,
|
||||
struct dm_hash_table *lv_hash);
|
||||
const struct dm_config_node *vgn);
|
||||
|
||||
#define _read_int32(root, path, result) \
|
||||
dm_config_get_uint32(root, path, (uint32_t *) (result))
|
||||
@ -180,9 +179,7 @@ static int _read_pv(struct cmd_context *cmd,
|
||||
struct volume_group *vg,
|
||||
struct lvmcache_vgsummary *vgsummary,
|
||||
const struct dm_config_node *pvn,
|
||||
const struct dm_config_node *vgn __attribute__((unused)),
|
||||
struct dm_hash_table *pv_hash,
|
||||
struct dm_hash_table *lv_hash __attribute__((unused)))
|
||||
const struct dm_config_node *vgn __attribute__((unused)))
|
||||
{
|
||||
struct physical_volume *pv;
|
||||
struct pv_list *pvl;
|
||||
@ -200,7 +197,7 @@ static int _read_pv(struct cmd_context *cmd,
|
||||
* Add the pv to the pv hash for quick lookup when we read
|
||||
* the lv segments.
|
||||
*/
|
||||
if (!dm_hash_insert(pv_hash, pvn->key, pv))
|
||||
if (!radix_tree_insert_ptr(vg->pv_names, pvn->key, strlen(pvn->key), pv))
|
||||
return_0;
|
||||
|
||||
if (!(pvn = pvn->child)) {
|
||||
@ -310,9 +307,7 @@ static int _read_pvsummary(struct cmd_context *cmd,
|
||||
struct volume_group *vg,
|
||||
struct lvmcache_vgsummary *vgsummary,
|
||||
const struct dm_config_node *pvn,
|
||||
const struct dm_config_node *vgn __attribute__((unused)),
|
||||
struct dm_hash_table *pv_hash __attribute__((unused)),
|
||||
struct dm_hash_table *lv_hash __attribute__((unused)))
|
||||
const struct dm_config_node *vgn __attribute__((unused)))
|
||||
{
|
||||
struct physical_volume *pv;
|
||||
struct pv_list *pvl;
|
||||
@ -375,8 +370,7 @@ static int _read_segment(struct cmd_context *cmd,
|
||||
struct format_type *fmt,
|
||||
struct format_instance *fid,
|
||||
struct dm_pool *mem,
|
||||
struct logical_volume *lv, const struct dm_config_node *sn,
|
||||
struct dm_hash_table *pv_hash)
|
||||
struct logical_volume *lv, const struct dm_config_node *sn)
|
||||
{
|
||||
uint32_t area_count = 0u;
|
||||
struct lv_segment *seg;
|
||||
@ -449,7 +443,7 @@ static int _read_segment(struct cmd_context *cmd,
|
||||
}
|
||||
|
||||
if (seg->segtype->ops->text_import &&
|
||||
!seg->segtype->ops->text_import(seg, sn_child, pv_hash))
|
||||
!seg->segtype->ops->text_import(seg, sn_child))
|
||||
return_0;
|
||||
|
||||
/* Optional tags */
|
||||
@ -484,7 +478,7 @@ static int _read_segment(struct cmd_context *cmd,
|
||||
}
|
||||
|
||||
int text_import_areas(struct lv_segment *seg, const struct dm_config_node *sn,
|
||||
const struct dm_config_value *cv, struct dm_hash_table *pv_hash,
|
||||
const struct dm_config_value *cv,
|
||||
uint64_t status)
|
||||
{
|
||||
unsigned int s;
|
||||
@ -516,7 +510,7 @@ int text_import_areas(struct lv_segment *seg, const struct dm_config_node *sn,
|
||||
}
|
||||
|
||||
/* FIXME Cope if LV not yet read in */
|
||||
if ((pv = dm_hash_lookup(pv_hash, cv->v.str))) {
|
||||
if ((pv = find_pv_by_pv_name(seg->lv->vg, cv->v.str))) {
|
||||
if (!set_lv_segment_area_pv(seg, s, pv, (uint32_t) cv->next->v.i))
|
||||
return_0;
|
||||
} else if ((lv1 = find_lv(seg->lv->vg, cv->v.str))) {
|
||||
@ -550,8 +544,7 @@ static int _read_segments(struct cmd_context *cmd,
|
||||
struct format_type *fmt,
|
||||
struct format_instance *fid,
|
||||
struct dm_pool *mem,
|
||||
struct logical_volume *lv, const struct dm_config_node *lvn,
|
||||
struct dm_hash_table *pv_hash)
|
||||
struct logical_volume *lv, const struct dm_config_node *lvn)
|
||||
{
|
||||
const struct dm_config_node *sn;
|
||||
int count = 0, seg_count;
|
||||
@ -562,7 +555,7 @@ static int _read_segments(struct cmd_context *cmd,
|
||||
* All sub-sections are assumed to be segments.
|
||||
*/
|
||||
if (!sn->v) {
|
||||
if (!_read_segment(cmd, fmt, fid, mem, lv, sn, pv_hash))
|
||||
if (!_read_segment(cmd, fmt, fid, mem, lv, sn))
|
||||
return_0;
|
||||
|
||||
count++;
|
||||
@ -608,9 +601,7 @@ static int _read_lvnames(struct cmd_context *cmd,
|
||||
struct volume_group *vg,
|
||||
struct lvmcache_vgsummary *vgsummary,
|
||||
const struct dm_config_node *lvn,
|
||||
const struct dm_config_node *vgn __attribute__((unused)),
|
||||
struct dm_hash_table *pv_hash __attribute__((unused)),
|
||||
struct dm_hash_table *lv_hash)
|
||||
const struct dm_config_node *vgn __attribute__((unused)))
|
||||
{
|
||||
struct logical_volume *lv;
|
||||
const char *str;
|
||||
@ -621,10 +612,10 @@ static int _read_lvnames(struct cmd_context *cmd,
|
||||
if (!(lv = alloc_lv(mem)))
|
||||
return_0;
|
||||
|
||||
if (!link_lv_to_vg(vg, lv))
|
||||
if (!(lv->name = dm_pool_strdup(mem, lvn->key)))
|
||||
return_0;
|
||||
|
||||
if (!(lv->name = dm_pool_strdup(mem, lvn->key)))
|
||||
if (!link_lv_to_vg(vg, lv))
|
||||
return_0;
|
||||
|
||||
log_debug_metadata("Importing logical volume %s.", display_lvname(lv));
|
||||
@ -732,9 +723,6 @@ static int _read_lvnames(struct cmd_context *cmd,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!dm_hash_insert(lv_hash, lv->name, lv))
|
||||
return_0;
|
||||
|
||||
if (timestamp && !lv_set_creation(lv, hostname, timestamp))
|
||||
return_0;
|
||||
|
||||
@ -767,9 +755,7 @@ static int _read_historical_lvnames(struct cmd_context *cmd,
|
||||
struct volume_group *vg,
|
||||
struct lvmcache_vgsummary *vgsummary,
|
||||
const struct dm_config_node *hlvn,
|
||||
const struct dm_config_node *vgn __attribute__((unused)),
|
||||
struct dm_hash_table *pv_hash __attribute__((unused)),
|
||||
struct dm_hash_table *lv_hash __attribute__((unused)))
|
||||
const struct dm_config_node *vgn __attribute__((unused)))
|
||||
{
|
||||
struct generic_logical_volume *glv;
|
||||
struct glv_list *glvl;
|
||||
@ -840,9 +826,7 @@ static int _read_historical_lvnames_interconnections(struct cmd_context *cmd,
|
||||
struct volume_group *vg,
|
||||
struct lvmcache_vgsummary *vgsummary,
|
||||
const struct dm_config_node *hlvn,
|
||||
const struct dm_config_node *vgn __attribute__((unused)),
|
||||
struct dm_hash_table *pv_hash __attribute__((unused)),
|
||||
struct dm_hash_table *lv_hash __attribute__((unused)))
|
||||
const struct dm_config_node *vgn __attribute__((unused)))
|
||||
{
|
||||
const char *historical_lv_name, *origin_name = NULL;
|
||||
struct generic_logical_volume *glv, *origin_glv, *descendant_glv;
|
||||
@ -954,13 +938,11 @@ static int _read_lvsegs(struct cmd_context *cmd,
|
||||
struct volume_group *vg,
|
||||
struct lvmcache_vgsummary *vgsummary,
|
||||
const struct dm_config_node *lvn,
|
||||
const struct dm_config_node *vgn __attribute__((unused)),
|
||||
struct dm_hash_table *pv_hash,
|
||||
struct dm_hash_table *lv_hash)
|
||||
const struct dm_config_node *vgn __attribute__((unused)))
|
||||
{
|
||||
struct logical_volume *lv;
|
||||
|
||||
if (!(lv = dm_hash_lookup(lv_hash, lvn->key))) {
|
||||
if (!(lv = find_lv(vg, lvn->key))) {
|
||||
log_error("Lost logical volume reference %s", lvn->key);
|
||||
return 0;
|
||||
}
|
||||
@ -979,7 +961,7 @@ static int _read_lvsegs(struct cmd_context *cmd,
|
||||
|
||||
memcpy(&lv->lvid.id[0], &lv->vg->id, sizeof(lv->lvid.id[0]));
|
||||
|
||||
if (!_read_segments(cmd, fmt, fid, mem, lv, lvn, pv_hash))
|
||||
if (!_read_segments(cmd, fmt, fid, mem, lv, lvn))
|
||||
return_0;
|
||||
|
||||
lv->size = (uint64_t) lv->le_count * (uint64_t) vg->extent_size;
|
||||
@ -1020,8 +1002,6 @@ static int _read_sections(struct cmd_context *cmd,
|
||||
struct volume_group *vg,
|
||||
struct lvmcache_vgsummary *vgsummary,
|
||||
const struct dm_config_node *vgn,
|
||||
struct dm_hash_table *pv_hash,
|
||||
struct dm_hash_table *lv_hash,
|
||||
int optional)
|
||||
{
|
||||
const struct dm_config_node *n;
|
||||
@ -1036,7 +1016,7 @@ static int _read_sections(struct cmd_context *cmd,
|
||||
}
|
||||
|
||||
for (n = n->child; n; n = n->sib) {
|
||||
if (!fn(cmd, (struct format_type *)fmt, fid, mem, vg, vgsummary, n, vgn, pv_hash, lv_hash))
|
||||
if (!fn(cmd, (struct format_type *)fmt, fid, mem, vg, vgsummary, n, vgn))
|
||||
return_0;
|
||||
}
|
||||
|
||||
@ -1053,7 +1033,6 @@ static struct volume_group *_read_vg(struct cmd_context *cmd,
|
||||
const struct dm_config_value *cv;
|
||||
const char *str, *format_str, *system_id;
|
||||
struct volume_group *vg;
|
||||
struct dm_hash_table *pv_hash = NULL, *lv_hash = NULL;
|
||||
uint64_t vgstatus;
|
||||
|
||||
/* skip any top-level values */
|
||||
@ -1071,20 +1050,20 @@ static struct volume_group *_read_vg(struct cmd_context *cmd,
|
||||
mem = vg->vgmem;
|
||||
|
||||
/*
|
||||
* The pv hash memorizes the pv section names -> pv
|
||||
* The pv_names memorizes the pv section names -> pv
|
||||
* structures.
|
||||
*/
|
||||
if (!(pv_hash = dm_hash_create(59))) {
|
||||
log_error("Couldn't create pv hash table.");
|
||||
if (!(vg->pv_names = radix_tree_create(NULL, NULL))) {
|
||||
log_error("Couldn't create pv_names radix tree.");
|
||||
goto bad;
|
||||
}
|
||||
|
||||
/*
|
||||
* The lv hash memorizes the lv section names -> lv
|
||||
* The lv_names radix_tree memorizes the lv section names -> lv
|
||||
* structures.
|
||||
*/
|
||||
if (!(lv_hash = dm_hash_create(1023))) {
|
||||
log_error("Couldn't create lv hash table.");
|
||||
if (!(vg->lv_names = radix_tree_create(NULL, NULL))) {
|
||||
log_error("Couldn't create lv_names radix tree.");
|
||||
goto bad;
|
||||
}
|
||||
|
||||
@ -1203,7 +1182,7 @@ static struct volume_group *_read_vg(struct cmd_context *cmd,
|
||||
}
|
||||
|
||||
if (!_read_sections(cmd, fmt, fid, mem, "physical_volumes", _read_pv, vg, NULL,
|
||||
vgn, pv_hash, lv_hash, 0)) {
|
||||
vgn, 0)) {
|
||||
log_error("Couldn't find all physical volumes for volume "
|
||||
"group %s.", vg->name);
|
||||
goto bad;
|
||||
@ -1217,28 +1196,28 @@ static struct volume_group *_read_vg(struct cmd_context *cmd,
|
||||
}
|
||||
|
||||
if (!_read_sections(cmd, fmt, fid, mem, "logical_volumes", _read_lvnames, vg, NULL,
|
||||
vgn, pv_hash, lv_hash, 1)) {
|
||||
vgn, 1)) {
|
||||
log_error("Couldn't read all logical volume names for volume "
|
||||
"group %s.", vg->name);
|
||||
goto bad;
|
||||
}
|
||||
|
||||
if (!_read_sections(cmd, fmt, fid, mem, "historical_logical_volumes", _read_historical_lvnames, vg, NULL,
|
||||
vgn, pv_hash, lv_hash, 1)) {
|
||||
vgn, 1)) {
|
||||
log_error("Couldn't read all historical logical volumes for volume "
|
||||
"group %s.", vg->name);
|
||||
goto bad;
|
||||
}
|
||||
|
||||
if (!_read_sections(cmd, fmt, fid, mem, "logical_volumes", _read_lvsegs, vg, NULL,
|
||||
vgn, pv_hash, lv_hash, 1)) {
|
||||
vgn, 1)) {
|
||||
log_error("Couldn't read all logical volumes for "
|
||||
"volume group %s.", vg->name);
|
||||
goto bad;
|
||||
}
|
||||
|
||||
if (!_read_sections(cmd, fmt, fid, mem, "historical_logical_volumes", _read_historical_lvnames_interconnections,
|
||||
vg, NULL, vgn, pv_hash, lv_hash, 1)) {
|
||||
vg, NULL, vgn, 1)) {
|
||||
log_error("Couldn't read all removed logical volume interconnections "
|
||||
"for volume group %s.", vg->name);
|
||||
goto bad;
|
||||
@ -1250,24 +1229,20 @@ static struct volume_group *_read_vg(struct cmd_context *cmd,
|
||||
goto bad;
|
||||
}
|
||||
|
||||
dm_hash_destroy(pv_hash);
|
||||
dm_hash_destroy(lv_hash);
|
||||
|
||||
if (fid)
|
||||
vg_set_fid(vg, fid);
|
||||
|
||||
if (vg->pv_names) {
|
||||
radix_tree_destroy(vg->pv_names);
|
||||
vg->pv_names = NULL; /* PV names are no longer valid outside of _read_vg() */
|
||||
}
|
||||
|
||||
/*
|
||||
* Finished.
|
||||
*/
|
||||
return vg;
|
||||
|
||||
bad:
|
||||
if (pv_hash)
|
||||
dm_hash_destroy(pv_hash);
|
||||
|
||||
if (lv_hash)
|
||||
dm_hash_destroy(lv_hash);
|
||||
|
||||
release_vg(vg);
|
||||
return NULL;
|
||||
}
|
||||
@ -1351,7 +1326,7 @@ static int _read_vgsummary(const struct format_type *fmt, const struct dm_config
|
||||
}
|
||||
|
||||
if (!_read_sections(fmt->cmd, NULL, NULL, mem, "physical_volumes", _read_pvsummary, NULL, vgsummary,
|
||||
vgn, NULL, NULL, 0)) {
|
||||
vgn, 0)) {
|
||||
log_debug("Couldn't read pv summaries");
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,6 @@ struct lv_segment;
|
||||
struct dm_config_node;
|
||||
|
||||
int text_import_areas(struct lv_segment *seg, const struct dm_config_node *sn,
|
||||
const struct dm_config_value *cv, struct dm_hash_table *pv_hash,
|
||||
uint64_t status);
|
||||
const struct dm_config_value *cv, uint64_t status);
|
||||
|
||||
#endif
|
||||
|
@ -36,8 +36,7 @@ static void _integrity_display(const struct lv_segment *seg)
|
||||
}
|
||||
|
||||
static int _integrity_text_import(struct lv_segment *seg,
|
||||
const struct dm_config_node *sn,
|
||||
struct dm_hash_table *pv_hash __attribute__((unused)))
|
||||
const struct dm_config_node *sn)
|
||||
{
|
||||
struct integrity_settings *set;
|
||||
struct logical_volume *origin_lv = NULL;
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "lib/label/label.h"
|
||||
#include "lib/misc/lvm-signal.h"
|
||||
#include "lib/device/filesystem.h"
|
||||
#include "base/data-struct/radix-tree.h"
|
||||
|
||||
#ifdef HAVE_BLKZEROOUT
|
||||
#include <sys/ioctl.h>
|
||||
@ -7310,9 +7311,6 @@ struct logical_volume *lv_create_empty(const char *name,
|
||||
char dname[NAME_LEN];
|
||||
int historical;
|
||||
|
||||
if (vg_max_lv_reached(vg))
|
||||
stack;
|
||||
|
||||
if (strstr(name, "%d") &&
|
||||
!(name = generate_lv_name(vg, name, dname, sizeof(dname)))) {
|
||||
log_error("Failed to generate unique name for the new "
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "lib/config/defaults.h"
|
||||
#include "lib/locking/lvmlockd.h"
|
||||
#include "lib/notify/lvmnotify.h"
|
||||
#include "base/data-struct/radix-tree.h"
|
||||
|
||||
#include <time.h>
|
||||
#include <math.h>
|
||||
@ -1670,8 +1671,7 @@ struct logical_volume *find_lv_in_vg_by_lvid(const struct volume_group *vg,
|
||||
struct logical_volume *find_lv(const struct volume_group *vg,
|
||||
const char *lv_name)
|
||||
{
|
||||
struct lv_list *lvl = find_lv_in_vg(vg, lv_name);
|
||||
return lvl ? lvl->lv : NULL;
|
||||
return radix_tree_lookup_ptr(vg->lv_names, lv_name, strlen(lv_name));
|
||||
}
|
||||
|
||||
struct generic_logical_volume *find_historical_glv(const struct volume_group *vg,
|
||||
@ -1733,6 +1733,16 @@ struct physical_volume *find_pv(struct volume_group *vg, struct device *dev)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct physical_volume *find_pv_by_pv_name(struct volume_group *vg, const char *pv_name)
|
||||
{
|
||||
if (!vg->pv_names) {
|
||||
log_error(INTERNAL_ERROR "Cannot find pv name %s outside of _read_vg()", pv_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return radix_tree_lookup_ptr(vg->pv_names, pv_name, strlen(pv_name));
|
||||
}
|
||||
|
||||
/* Find segment at a given logical extent in an LV */
|
||||
struct lv_segment *find_seg_by_le(const struct logical_volume *lv, uint32_t le)
|
||||
{
|
||||
|
@ -395,6 +395,7 @@ struct logical_volume *find_lv_in_vg_by_lvid(const struct volume_group *vg,
|
||||
|
||||
/* FIXME Merge these functions with ones above */
|
||||
struct physical_volume *find_pv(struct volume_group *vg, struct device *dev);
|
||||
struct physical_volume *find_pv_by_pv_name(struct volume_group *vg, const char *pv_name);
|
||||
|
||||
struct pv_list *find_pv_in_pv_list(const struct dm_list *pl,
|
||||
const struct physical_volume *pv);
|
||||
|
@ -254,8 +254,7 @@ struct segtype_handler {
|
||||
int (*text_import_area_count) (const struct dm_config_node * sn,
|
||||
uint32_t *area_count);
|
||||
int (*text_import) (struct lv_segment * seg,
|
||||
const struct dm_config_node * sn,
|
||||
struct dm_hash_table * pv_hash);
|
||||
const struct dm_config_node * sn);
|
||||
int (*merge_segments) (struct lv_segment * seg1,
|
||||
struct lv_segment * seg2);
|
||||
int (*add_target_line) (struct dev_manager *dm, struct dm_pool *mem,
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "lib/activate/activate.h"
|
||||
#include "lib/commands/toolcontext.h"
|
||||
#include "lib/format_text/archiver.h"
|
||||
#include "base/data-struct/radix-tree.h"
|
||||
|
||||
struct volume_group *alloc_vg(const char *pool_name, struct cmd_context *cmd,
|
||||
const char *vg_name)
|
||||
@ -75,6 +76,13 @@ static void _free_vg(struct volume_group *vg)
|
||||
|
||||
if (vg->committed_cft)
|
||||
config_destroy(vg->committed_cft);
|
||||
|
||||
if (vg->lv_names)
|
||||
radix_tree_destroy(vg->lv_names);
|
||||
|
||||
if (vg->pv_names)
|
||||
radix_tree_destroy(vg->pv_names);
|
||||
|
||||
dm_pool_destroy(vg->vgmem);
|
||||
}
|
||||
|
||||
@ -112,6 +120,11 @@ int link_lv_to_vg(struct volume_group *vg, struct logical_volume *lv)
|
||||
|
||||
lvl->lv = lv;
|
||||
lv->vg = vg;
|
||||
if (vg->lv_names &&
|
||||
!radix_tree_insert_ptr(vg->lv_names, lv->name, strlen(lv->name), lv)) {
|
||||
log_error("Cannot insert to lv_names LV %s", lv->name);
|
||||
return_0;
|
||||
}
|
||||
dm_list_add(&vg->lvs, &lvl->list);
|
||||
lv->status &= ~LV_REMOVED;
|
||||
|
||||
@ -125,6 +138,10 @@ int unlink_lv_from_vg(struct logical_volume *lv)
|
||||
if (!(lvl = find_lv_in_vg(lv->vg, lv->name)))
|
||||
return_0;
|
||||
|
||||
if (lv->vg->lv_names &&
|
||||
!radix_tree_remove(lv->vg->lv_names, lv->name, strlen(lv->name)))
|
||||
stack;
|
||||
|
||||
dm_list_move(&lv->vg->removed_lvs, &lvl->list);
|
||||
lv->status |= LV_REMOVED;
|
||||
|
||||
|
@ -62,6 +62,9 @@ struct volume_group {
|
||||
struct profile *profile;
|
||||
uint64_t status;
|
||||
|
||||
struct radix_tree *lv_names; /* maintained tree for LV names within VG */
|
||||
struct radix_tree *pv_names; /* PV names used for metadata import */
|
||||
|
||||
struct id id;
|
||||
const char *name;
|
||||
const char *old_name; /* Set during vgrename and vgcfgrestore */
|
||||
|
@ -73,8 +73,7 @@ static int _mirrored_text_import_area_count(const struct dm_config_node *sn, uin
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int _mirrored_text_import(struct lv_segment *seg, const struct dm_config_node *sn,
|
||||
struct dm_hash_table *pv_hash)
|
||||
static int _mirrored_text_import(struct lv_segment *seg, const struct dm_config_node *sn)
|
||||
{
|
||||
const struct dm_config_value *cv;
|
||||
const char *logname = NULL;
|
||||
@ -125,7 +124,7 @@ static int _mirrored_text_import(struct lv_segment *seg, const struct dm_config_
|
||||
return 0;
|
||||
}
|
||||
|
||||
return text_import_areas(seg, sn, cv, pv_hash, MIRROR_IMAGE);
|
||||
return text_import_areas(seg, sn, cv, MIRROR_IMAGE);
|
||||
}
|
||||
|
||||
static int _mirrored_text_export(const struct lv_segment *seg, struct formatter *f)
|
||||
|
@ -128,8 +128,7 @@ static int _raid_text_import_areas(struct lv_segment *seg,
|
||||
}
|
||||
|
||||
static int _raid_text_import(struct lv_segment *seg,
|
||||
const struct dm_config_node *sn,
|
||||
struct dm_hash_table *pv_hash)
|
||||
const struct dm_config_node *sn)
|
||||
{
|
||||
const struct dm_config_value *cv;
|
||||
const struct {
|
||||
|
@ -34,9 +34,7 @@ static const char *_snap_target_name(const struct lv_segment *seg,
|
||||
|
||||
return lvseg_name(seg);
|
||||
}
|
||||
|
||||
static int _snap_text_import(struct lv_segment *seg, const struct dm_config_node *sn,
|
||||
struct dm_hash_table *pv_hash __attribute__((unused)))
|
||||
static int _snap_text_import(struct lv_segment *seg, const struct dm_config_node *sn)
|
||||
{
|
||||
uint32_t chunk_size;
|
||||
struct logical_volume *org, *cow;
|
||||
|
@ -69,8 +69,7 @@ static int _striped_text_import_area_count(const struct dm_config_node *sn, uint
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int _striped_text_import(struct lv_segment *seg, const struct dm_config_node *sn,
|
||||
struct dm_hash_table *pv_hash)
|
||||
static int _striped_text_import(struct lv_segment *seg, const struct dm_config_node *sn)
|
||||
{
|
||||
const struct dm_config_value *cv;
|
||||
|
||||
@ -89,7 +88,7 @@ static int _striped_text_import(struct lv_segment *seg, const struct dm_config_n
|
||||
|
||||
seg->area_len /= seg->area_count;
|
||||
|
||||
return text_import_areas(seg, sn, cv, pv_hash, 0);
|
||||
return text_import_areas(seg, sn, cv, 0);
|
||||
}
|
||||
|
||||
static int _striped_text_export(const struct lv_segment *seg, struct formatter *f)
|
||||
|
@ -79,8 +79,7 @@ static int _thin_pool_add_message(struct lv_segment *seg,
|
||||
}
|
||||
|
||||
static int _thin_pool_text_import(struct lv_segment *seg,
|
||||
const struct dm_config_node *sn,
|
||||
struct dm_hash_table *pv_hash __attribute__((unused)))
|
||||
const struct dm_config_node *sn)
|
||||
{
|
||||
const char *lv_name;
|
||||
struct logical_volume *pool_data_lv, *pool_metadata_lv;
|
||||
@ -467,8 +466,7 @@ static void _thin_display(const struct lv_segment *seg)
|
||||
}
|
||||
|
||||
static int _thin_text_import(struct lv_segment *seg,
|
||||
const struct dm_config_node *sn,
|
||||
struct dm_hash_table *pv_hash __attribute__((unused)))
|
||||
const struct dm_config_node *sn)
|
||||
{
|
||||
const char *lv_name;
|
||||
struct logical_volume *pool_lv, *origin = NULL, *external_lv = NULL, *merge_lv = NULL;
|
||||
|
@ -19,8 +19,7 @@
|
||||
#include "lib/format_text/text_export.h"
|
||||
#include "lib/config/config.h"
|
||||
|
||||
static int _unknown_text_import(struct lv_segment *seg, const struct dm_config_node *sn,
|
||||
struct dm_hash_table *pv_hash)
|
||||
static int _unknown_text_import(struct lv_segment *seg, const struct dm_config_node *sn)
|
||||
{
|
||||
struct dm_config_node *new, *last = NULL, *head = NULL;
|
||||
const struct dm_config_node *current;
|
||||
|
@ -74,8 +74,7 @@ static void _vdo_display(const struct lv_segment *seg)
|
||||
}
|
||||
|
||||
static int _vdo_text_import(struct lv_segment *seg,
|
||||
const struct dm_config_node *n,
|
||||
struct dm_hash_table *pv_hash __attribute__((unused)))
|
||||
const struct dm_config_node *n)
|
||||
{
|
||||
struct logical_volume *vdo_pool_lv;
|
||||
const char *str;
|
||||
@ -206,8 +205,7 @@ static int _vdo_pool_text_import_area_count(const struct dm_config_node *sn __at
|
||||
}
|
||||
|
||||
static int _vdo_pool_text_import(struct lv_segment *seg,
|
||||
const struct dm_config_node *n,
|
||||
struct dm_hash_table *pv_hash __attribute__((unused)))
|
||||
const struct dm_config_node *n)
|
||||
{
|
||||
struct dm_vdo_target_params *vtp = &seg->vdo_params;
|
||||
struct logical_volume *data_lv;
|
||||
|
@ -39,8 +39,7 @@ static void _writecache_display(const struct lv_segment *seg)
|
||||
}
|
||||
|
||||
static int _writecache_text_import(struct lv_segment *seg,
|
||||
const struct dm_config_node *sn,
|
||||
struct dm_hash_table *pv_hash __attribute__((unused)))
|
||||
const struct dm_config_node *sn)
|
||||
{
|
||||
struct logical_volume *origin_lv = NULL;
|
||||
struct logical_volume *fast_lv;
|
||||
|
Loading…
Reference in New Issue
Block a user