]> sourceware.org Git - lvm2.git/commitdiff
Remove unnecessary full_scan parameter from get_vgids and get_vgnames calls.
authorAlasdair Kergon <agk@redhat.com>
Tue, 16 Mar 2010 16:57:03 +0000 (16:57 +0000)
committerAlasdair Kergon <agk@redhat.com>
Tue, 16 Mar 2010 16:57:03 +0000 (16:57 +0000)
WHATS_NEW
lib/cache/lvmcache.c
lib/cache/lvmcache.h
lib/metadata/metadata-exported.h
lib/metadata/metadata.c
liblvm/lvm_vg.c
tools/toollib.c
tools/vgrename.c

index 76b3b7bea06cdcb096d37465aa415a49006d25ef..44278deae5e98ee707d46b31ee0e6fdcbb3c4e44 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 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().
index 35ee05b7ec351838a6b4ef3a217ef2bd6655d983..7f59aa6361f8ef094114914fa5d8822753c33a33 100644 (file)
@@ -623,13 +623,13 @@ struct volume_group *lvmcache_get_vg(const char *vgid, unsigned precommitted)
        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");
@@ -650,13 +650,13 @@ struct dm_list *lvmcache_get_vgids(struct cmd_context *cmd, int full_scan,
        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");
index 2c14b6c79a7fcf79808498d4a88e838f6e477711..37193a90f8a1016b4a7de7c6897ca88fe175f42e 100644 (file)
@@ -98,16 +98,14 @@ int vgs_locked(void);
 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,
index a89a47d5d71174d76f887977c73c8a4d36278339..2f1405fc657bb7fee103a198d2a616f5f5d48de1 100644 (file)
@@ -398,11 +398,8 @@ int unlink_lv_from_vg(struct logical_volume *lv);
 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,
index bef70931dc63ca53b34e1d8d6a2b274c0975731e..11376ef1a7fc9c05c21a00f007fda87bd037beb6 100644 (file)
@@ -2967,7 +2967,8 @@ static struct volume_group *_vg_read_by_vgid(struct cmd_context *cmd,
         *       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;
        }
@@ -3103,16 +3104,14 @@ bad:
 }
 
 /* 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)
@@ -3138,7 +3137,7 @@ 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;
        }
index ec829e87ac5294e5a41cabea4cc92984b4f03455..334e90669763a9c0e97f67d3896c04b54996189a 100644 (file)
@@ -351,12 +351,12 @@ char *lvm_vg_get_name(const vg_t vg)
 
 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);
 }
 
 /*
index a975fa33c2755db81f6d4681e920ae02a571b5a6..0d3fe0aef06cfa4c9b47e82b91ca3cefa1fdda7f 100644 (file)
@@ -275,7 +275,7 @@ int process_each_lv(struct cmd_context *cmd, int argc, char **argv,
 
        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;
                }
@@ -518,7 +518,7 @@ int process_each_vg(struct cmd_context *cmd, int argc, char **argv,
 
        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;
                }
@@ -723,7 +723,7 @@ int process_each_pv(struct cmd_context *cmd, int argc, char **argv,
                        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);
index a63a6266ad57908de81865dbf9531a21bc15a182..799dcb24a7e075c94648f21ba72c68f9b7d6ec5c 100644 (file)
@@ -87,7 +87,7 @@ static int vg_rename_path(struct cmd_context *cmd, const char *old_vg_path,
        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;
        }
This page took 0.051395 seconds and 5 git commands to generate.