函数逻辑报告

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

函数名称:_sub_and_test - subtract from a refcount and test if it is 0*@i: amount to subtract from the refcount*@r: the refcount* Similar to atomic_dec_and_test(), but it will WARN, return false and* ultimately leak on underflow and will fail to decrement when

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

返回类型:bool

参数:

类型参数名称
inti
refcount_t *r
253  old等于atomic_fetch_sub_release(i, & refs)
255  如果old恒等于i
256  smp_acquire__after_ctrl_dep() - Provide ACQUIRE ordering after a control dependency* A control dependency provides a LOAD->STORE order, the additional RMB* provides LOAD->LOAD order, together they provide LOAD->{LOAD,STORE} order,* aka. (load)-ACQUIRE.()
257  返回:true
260  如果此条件成立可能性小(为编译器优化)(old < 0 || old - i < 0)则refcount_warn_saturate(r, REFCOUNT_SUB_UAF)
263  返回:false
调用者
名称描述
mem_cgroup_id_put_many
__io_double_put_req
io_double_put_req
io_wq_managerManager thread. Tasked with creating new workers, if we need them.
refcount_dec_and_test_dec_and_test - decrement a refcount and test if it is 0*@r: the refcount* Similar to atomic_dec_and_test(), it will WARN on underflow and fail to* decrement when saturated at REFCOUNT_SATURATED