1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-30 17:18:21 +03:00

hash: increase some default hash table size

Size of these hashes was quite small, so raise the size of
hashed entries to reduce amount of hash collistion.
Select some unique/unused number for hash_create below 8192.
This commit is contained in:
Zdenek Kabelac 2024-05-26 00:33:16 +02:00
parent 93115ef91d
commit bbe1b93ed9
2 changed files with 2 additions and 2 deletions

View File

@ -1311,7 +1311,7 @@ int dev_cache_init(struct cmd_context *cmd)
if (!(_cache.mem = dm_pool_create("dev_cache", 10 * 1024)))
return_0;
if (!(_cache.names = dm_hash_create(1020)) ||
if (!(_cache.names = dm_hash_create(8190)) ||
!(_cache.vgid_index = dm_hash_create(30)) ||
!(_cache.lvid_index = dm_hash_create(29))) {
dm_pool_destroy(_cache.mem);

View File

@ -58,7 +58,7 @@ static int _init_hash(struct pfilter *pf)
if (pf->devices)
dm_hash_destroy(pf->devices);
if (!(pf->devices = dm_hash_create(511)))
if (!(pf->devices = dm_hash_create(8191)))
return_0;
return 1;