Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:test_rhashtable_max

Proto:static int __init test_rhashtable_max(struct test_obj *array, unsigned int entries)

Type:int

Parameter:

TypeParameterName
struct test_obj *array
unsigned intentries
451  insert_retries = 0
454  max_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(entries / 8)
455  err = hashtable_init - initialize a new hash table*@ht: hash table to be initialized*@params: configuration parameters* Initializes a new hash table based on the provided configuration* parameters
456  If err Then Return err
459  When i < max_elems cycle
460  obj = array[i]
462  id = i * 2
463  err = insert_retry( & ht, obj, test_rht_params)
464  If err > 0 Then insert_retries += err
466  Else if err Then Return err
470  err = insert_retry( & ht, & array[max_elems], test_rht_params)
471  If err == -E2BIG Then
472  err = 0
473  Else
474  pr_info("insert element %u should have failed with %d, got %d\n", max_elems, - E2BIG, err)
476  If err == 0 Then err = -1
480  rhashtable_destroy( & ht)
482  Return err
Caller
NameDescribe
test_rht_init