Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:_add - add a value to a refcount*@i: the value to add to the refcount*@r: the refcount* Similar to atomic_add(), but will saturate at REFCOUNT_SATURATED and WARN.* Provides no memory ordering, it is assumed the caller has guaranteed the

Proto:static inline void refcount_add(int i, refcount_t *r)

Type:void

Parameter:

TypeParameterName
inti
refcount_t *r
188  old = atomic_fetch_add_relaxed(i, & refs)
190  If Value for the false possibility is greater at compile time(!old) Then refcount_warn_saturate(r, REFCOUNT_ADD_UAF)
192  Else if Value for the false possibility is greater at compile time(old < 0 || old + i < 0) Then refcount_warn_saturate(r, REFCOUNT_ADD_OVF)
Caller
NameDescribe
mem_cgroup_id_get_many