Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\rhashtable.c Create Date:2022-07-28 06:25:03
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:hashtable_shrink - Shrink hash table while allowing concurrent lookups*@ht: the hash table to shrink* This function shrinks the hash table to fit, i

Proto:static int rhashtable_shrink(struct rhashtable *ht)

Type:int

Parameter:

TypeParameterName
struct rhashtable *ht>mutex.
380  old_tbl = rht_dereference(tbl, >mutex.)
381  nelems = atomic_read( & nelems)
382  size = 0
384  If nelems Then size = undup_pow_of_two - round the given value up to nearest power of two*@n: parameter* round the given value up to the nearest power of two* - the result is undefined when n == 0* - this can be used to initialise global variables from constant data(nelems * 3 / 2)
386  If size < min_size Then size = min_size
389  If size <= size Then Return 0
392  If rht_dereference(future_tbl, >mutex.) Then Return -EEXIST
395  Return rhashtable_rehash_alloc(>mutex., old_tbl, size)
Caller
NameDescribe
rht_deferred_worker