Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:test_rht_lookup

Proto:static int __init test_rht_lookup(struct rhashtable *ht, struct test_obj *array, unsigned int entries)

Type:int

Parameter:

TypeParameterName
struct rhashtable *ht
struct test_obj *array
unsigned intentries
142  When i < entries cycle
144  expected = Not (i % 2)
145  struct test_obj_val key = {id = i, }
149  If id == TEST_INSERT_FAIL Then expected = false
152  obj = hashtable_lookup_fast - search hash table, without RCU read lock*@ht: hash table*@key: the pointer to the key*@params: hash table parameters* Computes the hash value for the key and traverses the bucket chain looking* for a entry with an identical key
154  If expected && Not obj Then
155  pr_warn("Test failed: Could not find key %u\n", id)
156  Return -ENOENT
157  Else if Not expected && obj Then
158  pr_warn("Test failed: Unexpected entry found for key %u\n", id)
160  Return -EEXIST
161  Else if expected && obj Then
162  If id != i Then
163  pr_warn("Test failed: Lookup value mismatch %u!=%u\n", id, i)
165  Return -EINVAL
169  cond_resched_rcu()
172  Return 0
Caller
NameDescribe
test_rhashtable