Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\futex.c Create Date:2022-07-28 10:53:39
Last Modify:2020-03-17 15:28:32 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Validate that the existing waiter has a pi_state and sanity check* the pi_state against the user space value. If correct, attach to* it.

Proto:static int attach_to_pi_state(unsigned int __user *uaddr, unsigned int uval, struct futex_pi_state *pi_state, struct futex_pi_state **ps)

Type:int

Parameter:

TypeParameterName
unsigned int __user *uaddr
unsigned intuval
struct futex_pi_state *pi_state
struct futex_pi_state **ps
1065  pid = uval & The rest of the robust-futex field is for the TID:
1072  If Value for the false possibility is greater at compile time(!pi_state) Then Return -EINVAL
1087  WARN_ON(!_read - get a refcount's value*@r: the refcount* Return: the refcount's value)
1093  raw_spin_lock_irq( & wait_lock)
1101  If get_futex_value_locked( & uval2, uaddr) Then Go to out_efault
1104  If uval != uval2 Then Go to out_eagain
1110  If uval & The kernel signals via this bit that a thread holding a futex* has exited without unlocking the futex. The kernel also does* a FUTEX_WAKE on such futexes, after setting the bit, to wake* up any possible waiters: Then
1116  If Not owner Then
1121  If pid Then Go to out_einval
1126  Go to out_attach
1137  If Not pid Then Go to out_attach
1139  Else
1144  If Not owner Then Go to out_einval
1153  If pid != task_pid_vnr(owner) Then Go to out_einval
1156  out_attach :
1157  get_pi_state(pi_state)
1158  raw_spin_unlock_irq( & wait_lock)
1159  ps = pi_state
1160  Return 0
1162  out_einval :
1163  ret = -EINVAL
1164  Go to out_error
1166  out_eagain :
1167  ret = -EAGAIN
1168  Go to out_error
1170  out_efault :
1171  ret = -EFAULT
1172  Go to out_error
1174  out_error :
1175  raw_spin_unlock_irq( & wait_lock)
1176  Return ret
Caller
NameDescribe
lookup_pi_state
futex_lock_pi_atomicex_lock_pi_atomic() - Atomic work required to acquire a pi aware futex*@uaddr: the pi futex user address*@hb: the pi futex hash bucket*@key: the futex key associated with uaddr and hb*@ps: the pi_state pointer where we store the result of the* lookup