Blame SOURCES/0005-hints-remove-the-cmd-hints-list.patch

b6fb8c
From 00ebabfe6e1ebfceffcef335d44a6156a1c15418 Mon Sep 17 00:00:00 2001
b6fb8c
From: David Teigland <teigland@redhat.com>
b6fb8c
Date: Mon, 1 Nov 2021 16:01:09 -0500
b6fb8c
Subject: [PATCH 05/23] hints: remove the cmd hints list
b6fb8c
b6fb8c
which is no longer used after commit
b6fb8c
"toollib: remove all devices list from process_each_pv"
b6fb8c
---
b6fb8c
 lib/commands/toolcontext.c | 2 --
b6fb8c
 lib/commands/toolcontext.h | 1 -
b6fb8c
 lib/label/hints.c          | 1 -
b6fb8c
 lib/label/label.c          | 8 ++------
b6fb8c
 4 files changed, 2 insertions(+), 10 deletions(-)
b6fb8c
b6fb8c
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
b6fb8c
index 105aecd5d..1b7170de1 100644
b6fb8c
--- a/lib/commands/toolcontext.c
b6fb8c
+++ b/lib/commands/toolcontext.c
b6fb8c
@@ -1605,7 +1605,6 @@ struct cmd_context *create_config_context(void)
b6fb8c
 
b6fb8c
 	dm_list_init(&cmd->config_files);
b6fb8c
 	dm_list_init(&cmd->tags);
b6fb8c
-	dm_list_init(&cmd->hints);
b6fb8c
 
b6fb8c
 	if (!_init_lvm_conf(cmd))
b6fb8c
 		goto_out;
b6fb8c
@@ -1670,7 +1669,6 @@ struct cmd_context *create_toolcontext(unsigned is_clvmd,
b6fb8c
 	dm_list_init(&cmd->formats);
b6fb8c
 	dm_list_init(&cmd->segtypes);
b6fb8c
 	dm_list_init(&cmd->tags);
b6fb8c
-	dm_list_init(&cmd->hints);
b6fb8c
 	dm_list_init(&cmd->config_files);
b6fb8c
 	label_init();
b6fb8c
 
b6fb8c
diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h
b6fb8c
index 701b7a739..356c79f8a 100644
b6fb8c
--- a/lib/commands/toolcontext.h
b6fb8c
+++ b/lib/commands/toolcontext.h
b6fb8c
@@ -206,7 +206,6 @@ struct cmd_context {
b6fb8c
 	 * Devices and filtering.
b6fb8c
 	 */
b6fb8c
 	struct dev_filter *filter;
b6fb8c
-	struct dm_list hints;
b6fb8c
 	struct dm_list use_devices;		/* struct dev_use for each entry in devices file */
b6fb8c
 	const char *md_component_checks;
b6fb8c
 	const char *search_for_devnames;	/* config file setting */
b6fb8c
diff --git a/lib/label/hints.c b/lib/label/hints.c
b6fb8c
index 3dba9f8ec..e444a0c82 100644
b6fb8c
--- a/lib/label/hints.c
b6fb8c
+++ b/lib/label/hints.c
b6fb8c
@@ -365,7 +365,6 @@ static void _unlock_hints(struct cmd_context *cmd)
b6fb8c
 
b6fb8c
 void hints_exit(struct cmd_context *cmd)
b6fb8c
 {
b6fb8c
-	free_hints(&cmd->hints);
b6fb8c
 	if (_hints_fd == -1)
b6fb8c
 		return;
b6fb8c
 	_unlock_hints(cmd);
b6fb8c
diff --git a/lib/label/label.c b/lib/label/label.c
b6fb8c
index 3cd912270..479a5037a 100644
b6fb8c
--- a/lib/label/label.c
b6fb8c
+++ b/lib/label/label.c
b6fb8c
@@ -1207,8 +1207,6 @@ int label_scan(struct cmd_context *cmd)
b6fb8c
 			 (unsigned long long)want_size_kb);
b6fb8c
 	}
b6fb8c
 
b6fb8c
-	dm_list_init(&cmd->hints);
b6fb8c
-
b6fb8c
 	/*
b6fb8c
 	 * If we're using hints to limit which devs we scanned, verify
b6fb8c
 	 * that those hints were valid, and if not we need to scan the
b6fb8c
@@ -1220,18 +1218,16 @@ int label_scan(struct cmd_context *cmd)
b6fb8c
 			_scan_list(cmd, cmd->filter, &all_devs, 0, NULL);
b6fb8c
 			/* scan_devs are the devs that have been scanned */
b6fb8c
 			dm_list_splice(&scan_devs, &all_devs);
b6fb8c
-			free_hints(&hints_list);
b6fb8c
 			using_hints = 0;
b6fb8c
 			create_hints = 0;
b6fb8c
 			/* invalid hints means a new dev probably appeared and
b6fb8c
 			   we should search for any missing pvids again. */
b6fb8c
 			unlink_searched_devnames(cmd);
b6fb8c
-		} else {
b6fb8c
-			/* The hints may be used by another device iteration. */
b6fb8c
-			dm_list_splice(&cmd->hints, &hints_list);
b6fb8c
 		}
b6fb8c
 	}
b6fb8c
 
b6fb8c
+	free_hints(&hints_list);
b6fb8c
+
b6fb8c
 	/*
b6fb8c
 	 * Check if the devices_file content is up to date and
b6fb8c
 	 * if not update it.
b6fb8c
-- 
b6fb8c
2.31.1
b6fb8c