函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\mlock.c Create Date:2022-07-27 16:13:24
Last Modify:2022-05-23 14:12:58 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:apply_vma_lock_flags

函数原型:static int apply_vma_lock_flags(unsigned long start, size_t len, vm_flags_t flags)

返回类型:int

参数:

类型参数名称
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等于startlen
593  如果end小于start则返回:负EINVAL
595  如果end恒等于start则返回:0
597  vma等于Look up the first VMA which satisfies addr < vm_end, NULL if none.
598  如果非vmaOur start address within vm_mm. 大于start则返回:负ENOMEM
601  prev等于linked list of VM areas per task, sorted by address
602  如果start大于Our start address within vm_mm. prev等于vma
605  循环
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  如果tmp大于endtmp等于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  如果error退出
617  nstart等于tmp
618  如果nstart小于The first byte after our end addresswithin vm_mm. nstart等于The first byte after our end addresswithin vm_mm.
620  如果nstart大于等于end退出
623  vma等于linked list of VM areas per task, sorted by address
624  如果非vmaOur start address within vm_mm. 不等于nstart
625  error等于负ENOMEM
626  退出
629  返回:error
调用者
名称描述
do_mlock
SYSCALL_DEFINE2