]> sourceware.org Git - lvm2.git/commitdiff
vg: remove unused hostnames hash table 1465773143
authorDavid Teigland <teigland@redhat.com>
Mon, 23 Sep 2024 20:04:53 +0000 (15:04 -0500)
committerDavid Teigland <teigland@redhat.com>
Mon, 23 Sep 2024 20:04:53 +0000 (15:04 -0500)
The hash table of lv creation hostnames was not used for anything,
so remove it.

lib/metadata/lv.c
lib/metadata/vg.c
lib/metadata/vg.h

index 36301b9a3007f46587443b3528f6773fcf7626ac..a240ed3ba5991e04b941f3d04238c01096c00a9e 100644 (file)
@@ -1558,8 +1558,6 @@ bad:
 int lv_set_creation(struct logical_volume *lv,
                    const char *hostname, uint64_t timestamp)
 {
-       const char *hn;
-
        if (!hostname) {
                if (!_utsinit) {
                        if (uname(&_utsname)) {
@@ -1573,17 +1571,7 @@ int lv_set_creation(struct logical_volume *lv,
                hostname = _utsname.nodename;
        }
 
-       if (!(hn = dm_hash_lookup(lv->vg->hostnames, hostname))) {
-               if (!(hn = dm_pool_strdup(lv->vg->vgmem, hostname))) {
-                       log_error("Failed to duplicate hostname");
-                       return 0;
-               }
-
-               if (!dm_hash_insert(lv->vg->hostnames, hostname, (void*)hn))
-                       return_0;
-       }
-
-       lv->hostname = hn;
+       lv->hostname = dm_pool_strdup(lv->vg->vgmem, hostname);
        lv->timestamp = timestamp ? : (uint64_t) time(NULL);
 
        return 1;
index adc954babe675df244c4ed8e8a32a47ef591bae2..8e7fb41a626499d494c51c1e1954bae4843da949 100644 (file)
@@ -46,12 +46,6 @@ struct volume_group *alloc_vg(const char *pool_name, struct cmd_context *cmd,
        vg->vgmem = vgmem;
        vg->alloc = ALLOC_NORMAL;
 
-       if (!(vg->hostnames = dm_hash_create(14))) {
-               log_error("Failed to allocate VG hostname hashtable.");
-               dm_pool_destroy(vgmem);
-               return NULL;
-       }
-
        dm_list_init(&vg->pvs);
        dm_list_init(&vg->pv_write_list);
        dm_list_init(&vg->lvs);
@@ -81,7 +75,6 @@ static void _free_vg(struct volume_group *vg)
 
        if (vg->committed_cft)
                config_destroy(vg->committed_cft);
-       dm_hash_destroy(vg->hostnames);
        dm_pool_destroy(vg->vgmem);
 }
 
index ae79e6162bd9bd2cdff14cfe05e2a8bc2e0febc0..d4ba535d9e3b8b078c6ae7d023c6fd48fcfb8a09 100644 (file)
@@ -129,7 +129,6 @@ struct volume_group {
 
        uint32_t mda_copies; /* target number of mdas for this VG */
 
-       struct dm_hash_table *hostnames; /* map of creation hostnames */
        struct logical_volume *pool_metadata_spare_lv; /* one per VG */
        struct logical_volume *sanlock_lv; /* one per VG */
        struct dm_list msg_list;
This page took 0.035667 seconds and 5 git commands to generate.