int lv_set_creation(struct logical_volume *lv,
const char *hostname, uint64_t timestamp)
{
- const char *hn;
-
if (!hostname) {
if (!_utsinit) {
if (uname(&_utsname)) {
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;
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);
if (vg->committed_cft)
config_destroy(vg->committed_cft);
- dm_hash_destroy(vg->hostnames);
dm_pool_destroy(vg->vgmem);
}
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;