函数逻辑报告

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_not_zero - add a value to a refcount unless it is 0*@i: the value to add to the refcount*@r: the refcount* Will saturate at REFCOUNT_SATURATED and WARN.* Provides no memory ordering, it is assumed the caller has guaranteed the

函数原型:static inline __must_check bool refcount_add_not_zero(int i, refcount_t *r)

返回类型:bool

参数:

类型参数名称
inti
refcount_t *r
157  old等于_read - get a refcount's value*@r: the refcount* Return: the refcount's value
159  循环
160  如果非old退出
162  当非atomic_try_cmpxchg_relaxed( & refs, & old, old + i)循环
164  如果此条件成立可能性小(为编译器优化)(old < 0 || old + i < 0)则refcount_warn_saturate(r, REFCOUNT_ADD_NOT_ZERO_OVF)
167  返回:old
调用者
名称描述
refcount_inc_not_zero_inc_not_zero - increment a refcount unless it is 0*@r: the refcount to increment* Similar to atomic_inc_not_zero(), but will saturate at REFCOUNT_SATURATED* and WARN.* Provides no memory ordering, it is assumed the caller has guaranteed the