Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\mlock.c Create Date:2022-07-28 14:45:45
Last Modify:2022-05-23 14:12:58 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:apply_vma_lock_flags

Proto:static int apply_vma_lock_flags(unsigned long start, size_t len, vm_flags_t flags)

Type:int

Parameter:

TypeParameterName
unsigned longstart
size_tlen
vm_flags_tflags
590  VM_BUG_ON(offset_in_page(start))
591  VM_BUG_ON(len != align the pointer to the (next) page boundary (len))
592  end = start + len
593  If end < start Then Return -EINVAL
595  If end == start Then Return 0
597  vma = Look up the first VMA which satisfies addr < vm_end, NULL if none.
598  If Not vma || Our start address within vm_mm. > start Then Return -ENOMEM
601  prev = linked list of VM areas per task, sorted by address
602  If start > Our start address within vm_mm. Then prev = vma
605  cycle
606  newflags = Flags, see mm.h. & This mask is used to clear all the VMA flags used by mlock
608  newflags |= flags
611  tmp = The first byte after our end addresswithin vm_mm.
612  If tmp > end Then tmp = end
614  error = mlock_fixup - handle mlock[all]/munlock[all] requests.* Filters out "special" vmas -- VM_LOCKED never gets set for these, and* munlock is a no-op. However, for some special vmas, we go ahead and* populate the ptes.
615  If error Then Break
617  nstart = tmp
618  If nstart < The first byte after our end addresswithin vm_mm. Then nstart = The first byte after our end addresswithin vm_mm.
620  If nstart >= end Then Break
623  vma = linked list of VM areas per task, sorted by address
625  error = -ENOMEM
626  Break
629  Return error
Caller
NameDescribe
do_mlock
SYSCALL_DEFINE2