Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:include\linux\rhashtable.h Create Date:2022-07-28 06:07:19
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_replace_fast() instead

Proto:static inline int __rhashtable_replace_fast(struct rhashtable *ht, struct bucket_table *tbl, struct rhash_head *obj_old, struct rhash_head *obj_new, const struct rhashtable_params params)

Type:int

Parameter:

TypeParameterName
struct rhashtable *ht
struct bucket_table *tbl
struct rhash_head *obj_old
struct rhash_head *obj_new
const struct rhashtable_paramsparams
1151  __rcu * pprev
1154  err = -ENOENT
1159  hash = rht_head_hashfn(ht, tbl, obj_old, params)
1160  If hash != rht_head_hashfn(ht, tbl, obj_new, params) Then Return -EINVAL
1163  bkt = rht_bucket_var(tbl, hash)
1164  If Not bkt Then Return -ENOENT
1167  pprev = NULL
1168  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
1171  If he != obj_old Then
1172  pprev = next
1173  Continue
1176  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(next, next)
1177  If pprev Then
1178  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_new)
1179  rht_unlock(tbl, bkt)
1180  Else
1181  rht_assign_unlock(tbl, bkt, obj_new)
1183  err = 0
1184  Go to unlocked
1187  rht_unlock(tbl, bkt)
1189  unlocked :
1190  Return err