Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\mmap.c Create Date:2022-07-28 14:49:58
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Emulation of deprecated remap_file_pages() syscall.

Proto:SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, unsigned long, prot, unsigned long, pgoff, unsigned long, flags)

Type:

Parameter:Nothing

2873  mm = mm
2875  populate = 0
2876  ret = -EINVAL
2879  pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.rst.\n", comm, pid)
2882  If prot Then Return ret
2884  start = start & PAGE_MASK
2885  size = size & PAGE_MASK
2887  If start + size <= start Then Return ret
2891  If pgoff + (size >> PAGE_SHIFT determines the page size ) < pgoff Then Return ret
2894  If lock for writing Then Return -EINTR
2897  vma = Look up the first VMA which satisfies addr < vm_end, NULL if none.
2899  If Not vma || Not (Flags, see mm.h. & VM_SHARED) Then Go to out
2902  If start < Our start address within vm_mm. Then Go to out
2905  If start + size > The first byte after our end addresswithin vm_mm. Then
2908  When next cycle
2916  If Flags, see mm.h. != Flags, see mm.h. Then Go to out
2923  If Not next Then Go to out
2927  prot |= If Flags, see mm.h. & currently active flags Then page can be read Else 0
2928  prot |= If Flags, see mm.h. & VM_WRITE Then page can be written Else 0
2929  prot |= If Flags, see mm.h. & VM_EXEC Then page can be executed Else 0
2931  flags &= do not block on IO
2932  flags |= Share changes | Interpret addr exactly | populate (prefault) pagetables
2933  If Flags, see mm.h. & VM_LOCKED Then
2935  flags |= pages are locked
2952  file = get_file(File we map to (can be NULL). )
2953  ret = do_mmap_pgoff(File we map to (can be NULL). , start, size, prot, flags, pgoff, & populate, NULL)
2955  fput(file)
2956  out :
2957  lease a write lock
2958  If populate Then mm_populate(ret, populate)
2960  If Not IS_ERR_VALUE(ret) Then ret = 0
2962  Return ret