Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\lockref.c Create Date:2022-07-28 06:19:11
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:lockref_put_not_zero - Decrements count unless count <= 1 before decrement*@lockref: pointer to lockref structure* Return: 1 if count updated successfully or 0 if count would become zero

Proto:int lockref_put_not_zero(struct lockref *lockref)

Type:int

Parameter:

TypeParameterName
struct lockref *lockref
95  Note that the "cmpxchg()" reloads the "old" value for the* failure case.(count--;If count <= 1 Then Return 0;, Return 1;)
103  spin_lock( & lock)
104  retval = 0
105  If count > 1 Then
106  count--
107  retval = 1
109  spin_unlock( & lock)
110  Return retval