函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\mremap.c Create Date:2022-07-27 16:22:14
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:vma_to_resize

函数原型:static struct vm_area_struct *vma_to_resize(unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long *p)

返回类型:struct vm_area_struct

参数:

类型参数名称
unsigned longaddr
unsigned longold_len
unsigned longnew_len
unsigned long *p
436  mm等于mm
437  vma等于Look up the first VMA which satisfies addr < vm_end, NULL if none.
440  如果非vmaOur start address within vm_mm. 大于addr则返回:错误号
451  如果非old_len且非Flags, see mm.h. 按位与VM_SHARED按位或VM_MAYSHARE的值的值则
452  pr_warn_once("%s (%d): attempted to duplicate a private mapping with mremap. This is not supported.\n", comm, pid)
453  返回:错误号
456  如果is_vm_hugetlb_page(vma)则返回:错误号
460  如果old_len大于The first byte after our end addresswithin vm_mm. addr则返回:错误号
463  如果new_len恒等于old_len则返回:vma
467  pgoff等于addrOur start address within vm_mm. 右移PAGE_SHIFT determines the page size
468  pgoff加等于Offset (within vm_file) in PAGE_SIZEunits
469  如果pgoffnew_len右移PAGE_SHIFT determines the page size 位的值小于pgoff则返回:错误号
472  如果Flags, see mm.h. 按位与Cannot expand with mremap() 按位或Page-ranges managed without "struct page", just pure PFN 的值则返回:错误号
475  如果Flags, see mm.h. 按位与VM_LOCKED
477  locked等于 Pages that have PG_mlocked set 左移PAGE_SHIFT determines the page size
478  lock_limit等于rlimit(RLIMIT_MEMLOCK)
479  locked加等于new_lenold_len
480  如果locked大于lock_limit且非操作权限检查则返回:错误号
484  如果非Return true if the calling process may expand its vm space by the passed* number of pages则返回:错误号
488  如果Flags, see mm.h. 按位与Is a VM accounted object
489  charged等于new_lenold_len右移PAGE_SHIFT determines the page size
490  如果security_vm_enough_memory_mm(mm, charged)则返回:错误号
492  p等于charged
495  返回:vma
调用者
名称描述
mremap_to
SYSCALL_DEFINE5Expand (or shrink) an existing mapping, potentially moving it at the* same time (controlled by the MREMAP_MAYMOVE flag and available VM space)* MREMAP_FIXED option added 5-Dec-1999 by Benjamin LaHaise* This option implies MREMAP_MAYMOVE.