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_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

Proto:static inline __must_check bool refcount_add_not_zero(int i, refcount_t *r)

Type:bool

Parameter:

TypeParameterName
inti
refcount_t *r
157  old = _read - get a refcount's value*@r: the refcount* Return: the refcount's value
159  Do
160  If Not old Then Break
162  When Not atomic_try_cmpxchg_relaxed( & refs, & old, old + i) cycle
164  If Value for the false possibility is greater at compile time(old < 0 || old + i < 0) Then refcount_warn_saturate(r, REFCOUNT_ADD_NOT_ZERO_OVF)
167  Return old