函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:include\linux\refcount.h Create Date:2022-07-27 06:40:40
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:_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

函数原型:static inline void refcount_add(int i, refcount_t *r)

返回类型:void

参数:

类型参数名称
inti
refcount_t *r
188  old等于atomic_fetch_add_relaxed(i, & refs)
190  如果此条件成立可能性小(为编译器优化)(!old)则refcount_warn_saturate(r, REFCOUNT_ADD_UAF)
192  否则如果此条件成立可能性小(为编译器优化)(old < 0 || old + i < 0)则refcount_warn_saturate(r, REFCOUNT_ADD_OVF)
调用者
名称描述
mem_cgroup_id_get_many
refcount_inc_inc - increment a refcount*@r: the refcount to increment* Similar to atomic_inc(), but will saturate at REFCOUNT_SATURATED and WARN