Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:lockref_put_or_lock - decrements count unless count <= 1 before decrement*@lockref: pointer to lockref structure* Return: 1 if count updated successfully or 0 if count <= 1 and lock taken

Proto:int lockref_put_or_lock(struct lockref *lockref)

Type:int

Parameter:

TypeParameterName
struct lockref *lockref
166  Note that the "cmpxchg()" reloads the "old" value for the* failure case.(count--;If count <= 1 Then Break;, Return 1;)
174  spin_lock( & lock)
175  If count <= 1 Then Return 0
177  count--
178  spin_unlock( & lock)
179  Return 1