Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:build_map_info

Proto:static struct map_info *build_map_info(struct address_space *mapping, loff_t offset, bool is_register)

Type:struct map_info

Parameter:

TypeParameterName
struct address_space *mapping
loff_toffset
boolis_register
978  pgoff = offset >> PAGE_SHIFT determines the page size
980  struct map_info * curr = NULL
981  struct map_info * prev = NULL
983  more = 0
985  again :
986  i_mmap_lock_read(mapping)
988  If Not valid_vma: Verify if the specified vma is an executable vma* Relax restrictions while unregistering: vm_flags might have* changed after breakpoint was inserted Then Continue
991  If Not prev && Not more Then
996  prev = Allocation memory
998  If prev Then next = NULL
1001  If Not prev Then
1002  more++
1003  Continue
1006  If Not mmget_not_zero(The address space we belong to. ) Then Continue
1009  info = prev
1010  prev = next
1011  next = curr
1012  curr = info
1014  mm = The address space we belong to.
1015  vaddr = offset_to_vaddr(vma, offset)
1017  i_mmap_unlock_read(mapping)
1019  If Not more Then Go to out
1022  prev = curr
1023  When curr cycle
1024  Decrement the use count and release all resources for an mm.
1025  curr = next
1028  Do
1029  info = Allocation memory
1030  If Not info Then
1031  curr = ERR_PTR( - ENOMEM)
1032  Go to out
1034  next = prev
1035  prev = info
1036  When --more cycle
1038  Go to again
1039  out :
1040  When prev cycle
1041  prev = free_map_info(prev)
1042  Return curr
Caller
NameDescribe
register_for_each_vma