Skip to contentSkip to conversation

master - lvmetad: remove client side altdev code

PATCH David Teigland 1 participant 1 message May 6, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=67da017fd2502138d0cc469f3aea320440353156
Commit:        67da017fd2502138d0cc469f3aea320440353156
Parent:        3d2fbfe243550b7801165f393d27e35044c1a56d
Author:        David Teigland <[email protected]>
AuthorDate:    Fri Jan 29 15:36:55 2016 -0600
Committer:     David Teigland <[email protected]>
CommitterDate: Fri May 6 09:00:00 2016 -0500

lvmetad: remove client side altdev code

This is no longer used since lvmetad no longer keeps track of alternate devices for duplicate PVs, but is simply disabled when duplicates appear.

---
 lib/cache/lvmcache.c |   42 ------------------------------------------
 lib/cache/lvmcache.h |    2 --
 lib/cache/lvmetad.c  |   43 ++-----------------------------------------
 3 files changed, 2 insertions(+), 85 deletions(-)
lib/cache/lvmcache.c +0 -42
index 8ac113f..4e89371 100644
@@ -72,7 +72,6 @@ struct lvmcache_vginfo {
 	unsigned vg_use_count;	/* Counter of vg reusage */
 	unsigned precommitted;	/* Is vgmetadata live or precommitted? */
 	unsigned cached_vg_invalidated;	/* Signal to regenerate cached_vg */
-	unsigned preferred_duplicates; /* preferred duplicate pvs have been set */
 };
 
 static struct dm_hash_table *_pvid_hash = NULL;
@@ -122,47 +121,6 @@ int lvmcache_init(void)
 	return 1;
 }
 
-/*
- * Once PV info has been populated in lvmcache and
- * lvmcache has chosen preferred duplicate devices,
- * set this flag so that lvmcache will not try to
- * compare and choose preferred duplicate devices
- * again (which may result in different preferred
- * devices.)  PV info can be populated in lvmcache
- * multiple times, each time causing lvmcache to
- * compare the duplicate devices, so we need to
- * record that the comparison/preferences have
- * already been done, so the preferrences from the
- * first time through are not changed.
- *
- * This is something of a hack to work around the
- * fact that the code isn't really designed to
- * handle duplicate PVs, and the fact that lvmetad
- * has its own way of picking a preferred duplicate
- * and lvmcache has another way based on having
- * more information than lvmetad does.
- *
- * If we come up with a better overall method to
- * handle duplicate PVs, then this can probably be
- * removed.
- *
- * FIXME: if we want to make lvmetad work with clvmd,
- * then this may need to be changed to set
- * preferred_duplicates back to 0.
- */
-
-void lvmcache_set_preferred_duplicates(const char *vgid)
-{
-	struct lvmcache_vginfo *vginfo;
-
-	if (!(vginfo = lvmcache_vginfo_from_vgid(vgid))) {
-		stack;
-		return;
-	}
-
-	vginfo->preferred_duplicates = 1;
-}
-
 void lvmcache_seed_infos_from_lvmetad(struct cmd_context *cmd)
 {
 	if (!lvmetad_used() || _has_scanned)
lib/cache/lvmcache.h +0 -2
index 0ebbe07..f62607f 100644
@@ -198,8 +198,6 @@ void lvmcache_replace_dev(struct cmd_context *cmd, struct physical_volume *pv,
 
 int lvmcache_found_duplicate_pvs(void);
 
-void lvmcache_set_preferred_duplicates(const char *vgid);
-
 int lvmcache_contains_lock_type_sanlock(struct cmd_context *cmd);
 
 void lvmcache_get_max_name_lengths(struct cmd_context *cmd,
lib/cache/lvmetad.c +2 -41

61 lines not on this page · raw message