Skip to contentSkip to conversation

Rename get_vgs() to get_vgnames() and clarify related error messages.

PATCH New Dave Wysochanski 1 participant 1 message Feb 2, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Rename get_vgs() to get_vgnames() and clarify related error messages.

get_vgs() really returns a list of vgnames. In the future we will use get_vgs() to return a list of vg structures, similar to get_pvs().

---
 lib/metadata/metadata-exported.h |    2 +-
 lib/metadata/metadata.c          |    8 ++++----
 tools/toollib.c                  |    4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
lib/metadata/metadata-exported.h +1 -1
index e785383..a1c45ce 100644
@@ -370,7 +370,7 @@ struct physical_volume *pv_read(struct cmd_context *cmd, const char *pv_name,
 struct dm_list *get_pvs(struct cmd_context *cmd);
 
 /* Set full_scan to 1 to re-read every (filtered) device label */
-struct dm_list *get_vgs(struct cmd_context *cmd, int full_scan);
+struct dm_list *get_vgnames(struct cmd_context *cmd, int full_scan);
 struct dm_list *get_vgids(struct cmd_context *cmd, int full_scan);
 int scan_vgs_for_pvs(struct cmd_context *cmd);
 
lib/metadata/metadata.c +4 -4
index 0130bd3..a2b5f2f 100644
@@ -2039,8 +2039,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_vgs(cmd, 2))) {
-		log_error("vg_read_by_vgid: get_vgs failed");
+	if (!(vgnames = get_vgnames(cmd, 2))) {
+		log_error("vg_read_by_vgid: get_vgnames failed");
 		return NULL;
 	}
 
@@ -2167,7 +2167,7 @@ static struct physical_volume *_pv_read(struct cmd_context *cmd,
 }
 
 /* May return empty list */
-struct dm_list *get_vgs(struct cmd_context *cmd, int full_scan)
+struct dm_list *get_vgnames(struct cmd_context *cmd, int full_scan)
 {
 	return lvmcache_get_vgnames(cmd, full_scan);
 }
@@ -2201,7 +2201,7 @@ static int _get_pvs(struct cmd_context *cmd, struct dm_list **pvslist)
 
 	/* Get list of VGs */
 	if (!(vgids = get_vgids(cmd, 0))) {
-		log_error("get_pvs: get_vgs failed");
+		log_error("get_pvs: get_vgids failed");
 		return 0;
 	}
 
tools/toollib.c +2 -2
index 84d5108..d8b32a5 100644
@@ -273,7 +273,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_vgs(cmd, 0)) || dm_list_empty(vgnames)) {
+		if (!(vgnames = get_vgnames(cmd, 0)) || dm_list_empty(vgnames)) {
 			log_error("No volume groups found");
 			return ret_max;
 		}
@@ -713,7 +713,7 @@ int process_each_pv(struct cmd_context *cmd, int argc, char **argv,
 			if (sigint_caught())
 				return ret_max;
 		}
-		if (!dm_list_empty(&tags) && (vgnames = get_vgs(cmd, 0)) &&
+		if (!dm_list_empty(&tags) && (vgnames = get_vgnames(cmd, 0)) &&
 			   !dm_list_empty(vgnames)) {
 			dm_list_iterate_items(sll, vgnames) {
 				if (!lock_vol(cmd, sll->str, lock_type)) {
Signature · 1 line
1.5.5.1