Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:bpf_map_mmap

Proto:static int bpf_map_mmap(struct file *filp, struct vm_area_struct *vma)

Type:int

Parameter:

TypeParameterName
struct file *filp
struct vm_area_struct *vma
478  map = needed for tty driver, and maybe others
481  If Not map_mmap || map_value_has_spin_lock(map) Then Return -Operation is not supported
484  If Not (Flags, see mm.h. & VM_SHARED) Then Return -EINVAL
487  mutex_lock( & freeze_mutex)
489  If Flags, see mm.h. & VM_WRITE && write-once; write-protected by freeze_mutex Then
490  err = -EPERM
491  Go to out
495  Function pointers to deal with this struct. = bpf_map_default_vmops
496  was vm_pte (shared mem) = map
498  err = map_mmap(map, vma)
499  If err Then Go to out
502  bpf_map_inc_with_uref(map)
504  If Flags, see mm.h. & VM_WRITE Then writable mmap cnt; protected by freeze_mutex ++
506  out :
507  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.
508  Return err