Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:rhashtable_lookup_one

Proto:static void *rhashtable_lookup_one(struct rhashtable *ht, struct rhash_lock_head **bkt, struct bucket_table *tbl, unsigned int hash, const void *key, struct rhash_head *obj)

Type:void

Parameter:

TypeParameterName
struct rhashtable *ht
struct rhash_lock_head **bkt
struct bucket_table *tbl
unsigned inthash
const void *key
struct rhash_head *obj
483  struct rhashtable_compare_arg arg = {ht = ht, key = key, }
487  struct rhash_head __rcu * * pprev = NULL
491  elasticity = Maximum chain length before rehash* The maximum (not average) chain length grows with the size of the hash* table, at a rate of (log N)/(log log N)
496  elasticity--
497  If Not key || If obj_cmpfn Then obj_cmpfn( & arg, rht_obj(ht, head)) Else rhashtable_compare( & arg, rht_obj(ht, head)) Then
501  pprev = next
502  Continue
505  If Not rhlist Then Return rht_obj(ht, head)
508  list = container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(obj, structrhlist_head, rhead)
509  plist = container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(head, structrhlist_head, rhead)
511  RCU_INIT_POINTER() - initialize an RCU protected pointer*@p: The pointer to be initialized.*@v: The value to initialized the pointer to.* Initialize an RCU-protected pointer in special cases where readers(next, plist)
512  head = rht_dereference_bucket(next, tbl, hash)
513  RCU_INIT_POINTER() - initialize an RCU protected pointer*@p: The pointer to be initialized.*@v: The value to initialized the pointer to.* Initialize an RCU-protected pointer in special cases where readers(next, head)
514  If pprev Then cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization( * pprev, obj)
516  Else rht_assign_locked(bkt, obj)
520  Return NULL
523  If elasticity <= 0 Then Return ERR_PTR( - EAGAIN)
526  Return ERR_PTR( - ENOENT)
Caller
NameDescribe
rhashtable_try_insert