Version 2.02.63 -
================================
+ Remove unnecessary full_scan parameter from get_vgids and get_vgnames calls.
Look up missing PVs by uuid not dev_name in _pvs_single to avoid invalid stat.
Make find_pv_in_vg_by_uuid() return same type as related functions.
Introduce is_missing_pv().
return vg;
}
-struct dm_list *lvmcache_get_vgids(struct cmd_context *cmd, int full_scan,
- int include_internal)
+struct dm_list *lvmcache_get_vgids(struct cmd_context *cmd,
+ int include_internal)
{
struct dm_list *vgids;
struct lvmcache_vginfo *vginfo;
- lvmcache_label_scan(cmd, full_scan);
+ lvmcache_label_scan(cmd, 0);
if (!(vgids = str_list_create(cmd->mem))) {
log_error("vgids list allocation failed");
return vgids;
}
-struct dm_list *lvmcache_get_vgnames(struct cmd_context *cmd, int full_scan,
- int include_internal)
+struct dm_list *lvmcache_get_vgnames(struct cmd_context *cmd,
+ int include_internal)
{
struct dm_list *vgnames;
struct lvmcache_vginfo *vginfo;
- lvmcache_label_scan(cmd, full_scan);
+ lvmcache_label_scan(cmd, 0);
if (!(vgnames = str_list_create(cmd->mem))) {
log_errno(ENOMEM, "vgnames list allocation failed");
int vgname_is_locked(const char *vgname);
/* Returns list of struct str_lists containing pool-allocated copy of vgnames */
-/* Set full_scan to 1 to reread every filtered device label. If include_internal
- * is not set, return only proper vg names. */
-struct dm_list *lvmcache_get_vgnames(struct cmd_context *cmd, int full_scan,
- int include_internal);
+/* If include_internal is not set, return only proper vg names. */
+struct dm_list *lvmcache_get_vgnames(struct cmd_context *cmd,
+ int include_internal);
/* Returns list of struct str_lists containing pool-allocated copy of vgids */
-/* Set full_scan to 1 to reread every filtered device label. If include_internal
- * is not set, return only proper vg ids. */
-struct dm_list *lvmcache_get_vgids(struct cmd_context *cmd, int full_scan,
- int include_internal);
+/* If include_internal is not set, return only proper vg ids. */
+struct dm_list *lvmcache_get_vgids(struct cmd_context *cmd,
+ int include_internal);
/* Returns list of struct str_lists containing pool-allocated copy of pvids */
struct dm_list *lvmcache_get_pvids(struct cmd_context *cmd, const char *vgname,
void lv_set_visible(struct logical_volume *lv);
void lv_set_hidden(struct logical_volume *lv);
-/* Set full_scan to 1 to re-read every (filtered) device label */
-struct dm_list *get_vgnames(struct cmd_context *cmd, int full_scan,
- int include_internal);
-struct dm_list *get_vgids(struct cmd_context *cmd, int full_scan,
- int include_internal);
+struct dm_list *get_vgnames(struct cmd_context *cmd, int include_internal);
+struct dm_list *get_vgids(struct cmd_context *cmd, int include_internal);
int scan_vgs_for_pvs(struct cmd_context *cmd);
int pv_write(struct cmd_context *cmd, struct physical_volume *pv,
* allowed to do a full scan here any more. */
// The slow way - full scan required to cope with vgrename
- if (!(vgnames = get_vgnames(cmd, 2, 0))) {
+ lvmcache_label_scan(cmd, 2);
+ if (!(vgnames = get_vgnames(cmd, 0))) {
log_error("vg_read_by_vgid: get_vgnames failed");
goto out;
}
}
/* May return empty list */
-struct dm_list *get_vgnames(struct cmd_context *cmd, int full_scan,
- int include_internal)
+struct dm_list *get_vgnames(struct cmd_context *cmd, int include_internal)
{
- return lvmcache_get_vgnames(cmd, full_scan, include_internal);
+ return lvmcache_get_vgnames(cmd, include_internal);
}
-struct dm_list *get_vgids(struct cmd_context *cmd, int full_scan,
- int include_internal)
+struct dm_list *get_vgids(struct cmd_context *cmd, int include_internal)
{
- return lvmcache_get_vgids(cmd, full_scan, include_internal);
+ return lvmcache_get_vgids(cmd, include_internal);
}
static int _get_pvs(struct cmd_context *cmd, struct dm_list **pvslist)
}
/* Get list of VGs */
- if (!(vgids = get_vgids(cmd, 0, 1))) {
+ if (!(vgids = get_vgids(cmd, 1))) {
log_error("get_pvs: get_vgids failed");
return 0;
}
struct dm_list *lvm_list_vg_names(lvm_t libh)
{
- return get_vgnames((struct cmd_context *)libh, 0, 0);
+ return get_vgnames((struct cmd_context *)libh, 0);
}
struct dm_list *lvm_list_vg_uuids(lvm_t libh)
{
- return get_vgids((struct cmd_context *)libh, 0, 0);
+ return get_vgids((struct cmd_context *)libh, 0);
}
/*
if (!argc || !dm_list_empty(&tags)) {
log_verbose("Finding all logical volumes");
- if (!(vgnames = get_vgnames(cmd, 0, 0)) || dm_list_empty(vgnames)) {
+ if (!(vgnames = get_vgnames(cmd, 0)) || dm_list_empty(vgnames)) {
log_error("No volume groups found");
return ret_max;
}
if (!argc || !dm_list_empty(&tags)) {
log_verbose("Finding all volume groups");
- if (!(vgids = get_vgids(cmd, 0, 0)) || dm_list_empty(vgids)) {
+ if (!(vgids = get_vgids(cmd, 0)) || dm_list_empty(vgids)) {
log_error("No volume groups found");
return ret_max;
}
if (sigint_caught())
goto out;
}
- if (!dm_list_empty(&tags) && (vgnames = get_vgnames(cmd, 0, 1)) &&
+ if (!dm_list_empty(&tags) && (vgnames = get_vgnames(cmd, 1)) &&
!dm_list_empty(vgnames)) {
dm_list_iterate_items(sll, vgnames) {
vg = vg_read(cmd, sll->str, NULL, flags);
log_verbose("Checking for existing volume group \"%s\"", vg_name_old);
/* Avoid duplicates */
- if (!(vgids = get_vgids(cmd, 0, 0)) || dm_list_empty(vgids)) {
+ if (!(vgids = get_vgids(cmd, 0)) || dm_list_empty(vgids)) {
log_error("No complete volume groups found");
return 0;
}