函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:do_mlock

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

返回类型:int

参数:

类型参数名称
unsigned longstart
size_tlen
vm_flags_tflags
675  error等于负ENOMEM
677  start等于Architectures that support memory tagging (assigning tags to memory regions,* embedding these tags into addresses that point to these memory regions, and* checking that the memory and the pointer tags match on memory accesses)(start)
679  如果非can_do_mlock()则返回:负EPERM
682  len等于 align the pointer to the (next) page boundary (len + (offset_in_page(start)))
683  start与等于PAGE_MASK
685  lock_limit等于rlimit(RLIMIT_MEMLOCK)
686  lock_limit右移等于PAGE_SHIFT determines the page size
687  locked等于len右移PAGE_SHIFT determines the page size
689  如果lock for writing则返回:负EINTR
692  locked加等于locked_vm
693  如果locked大于lock_limit且非操作权限检查
700  locked减等于Go through vma areas and sum size of mlocked* vma pages, as return value.* Note deferred memory locking case(mlock2(,,MLOCK_ONFAULT)* is also counted.* Return value: previously mlocked page counts
705  如果locked小于等于lock_limit操作权限检查error等于apply_vma_lock_flags(start, len, flags)
708  lease a write lock
709  如果error则返回:error
712  error等于__mm_populate - populate and/or mlock pages within a range of address space.* This is used to implement mlock() and the MAP_POPULATE / MAP_LOCKED mmap* flags. VMAs must be already marked with the desired vm_flags, and* mmap_sem must not be held.
713  如果error则返回:vert get_user_pages() return value to posix mlock() error
715  返回:0
调用者
名称描述
SYSCALL_DEFINE2
SYSCALL_DEFINE3