Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\syscall.c Create Date:2022-07-28 12:52:54
Last Modify:2022-05-19 18:06:12 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:map_freeze

Proto:static int map_freeze(const union bpf_attr *attr)

Type:int

Parameter:

TypeParameterName
const union bpf_attr *attr
1247  err = 0 , ufd = anonymous struct used by BPF_MAP_*_ELEM commands
1251  If helper macro to check that unused fields 'union bpf_attr' are zero (BPF_MAP_FREEZE) Then Return -EINVAL
1254  f = fdget(ufd)
1255  map = error is returned, fd is released.* On success caller should complete fd access with matching fdput()
1256  If IS_ERR(map) Then Return PTR_ERR(map)
1259  mutex_lock( & freeze_mutex)
1261  If writable mmap cnt; protected by freeze_mutex Then
1262  err = -EBUSY
1263  Go to err_put
1265  If READ_ONCE( write-once; write-protected by freeze_mutex ) Then
1266  err = -EBUSY
1267  Go to err_put
1269  If Not Check operation authority Then
1270  err = -EPERM
1271  Go to err_put
1274  WRITE_ONCE( write-once; write-protected by freeze_mutex , true)
1275  err_put :
1276  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1277  fdput(f)
1278  Return err