Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Internal function, please use rhashtable_remove_fast() instead

Proto:static inline int __rhashtable_remove_fast_one(struct rhashtable *ht, struct bucket_table *tbl, struct rhash_head *obj, const struct rhashtable_params params, bool rhlist)

Type:int

Parameter:

TypeParameterName
struct rhashtable *ht
struct bucket_table *tbl
struct rhash_head *obj
const struct rhashtable_paramsparams
boolrhlist
999  __rcu * pprev
1002  err = -ENOENT
1004  hash = rht_head_hashfn(ht, tbl, obj, params)
1005  bkt = rht_bucket_var(tbl, hash)
1006  If Not bkt Then Return -ENOENT
1008  pprev = NULL
1009  We lock a bucket by setting BIT(0) in the pointer - this is always* zero in real pointers. The NULLS mark is never stored in the bucket,* rather we store NULL if the bucket is empty.* bit_spin_locks do not handle contention well, but the whole point
1014  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.(he, structrhlist_head, rhead)
1016  If he != obj Then
1017  __rcu * lpprev
1019  pprev = next
1021  If Not rhlist Then Continue
1024  Do
1025  lpprev = next
1028  When list && obj != rhead cycle
1030  If Not list Then Continue
1033  list = rht_dereference_bucket(next, tbl, hash)
1034  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( * lpprev, list)
1035  err = 0
1036  Break
1039  obj = rht_dereference_bucket(next, tbl, hash)
1040  err = 1
1042  If rhlist Then
1043  list = rht_dereference_bucket(next, tbl, hash)
1044  If list Then
1046  obj = rhead
1047  err = 0
1051  If pprev Then
1052  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)
1053  rht_unlock(tbl, bkt)
1054  Else
1055  rht_assign_unlock(tbl, bkt, obj)
1057  Go to unlocked
1060  rht_unlock(tbl, bkt)
1061  unlocked :
1062  If err > 0 Then
1063  atomic_dec( & nelems)
1064  If Value for the false possibility is greater at compile time(automatic_shrinking && ht_shrink_below_30 - returns true if nelems < 0.3 * table-size*@ht: hash table*@tbl: current table) Then schedule_work - put work task in global workqueue*@work: job to be done* Returns %false if @work was already on the kernel-global workqueue and* %true otherwise
1067  err = 0
1070  Return err