Function report |
Source Code:fs\userfaultfd.c |
Create Date:2022-07-28 20:20:36 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:userfaultfd_unregister
Proto:static int userfaultfd_unregister(struct userfaultfd_ctx *ctx, unsigned long arg)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct userfaultfd_ctx * | ctx | |
| unsigned long | arg |
| 1528 | If copy_from_user( & uffdio_unregister, buf, size of uffdio_unregister ) Then Go to out |
| 1531 | ret = validate_range(mm, & start, len) |
| 1540 | If Not mmget_not_zero(mm) Then Go to out |
| 1543 | lock for writing |
| 1547 | If Not vma Then Go to out_unlock |
| 1552 | If Our start address within vm_mm. >= end Then Go to out_unlock |
| 1559 | If is_vm_hugetlb_page(vma) Then |
| 1560 | vma_hpagesize = Return the size of the pages allocated when backing a VMA. In the majority* cases this will be same size as used by the page table entries. |
| 1562 | If start & vma_hpagesize - 1 Then Go to out_unlock |
| 1569 | found = false |
| 1571 | When cur && Our start address within vm_mm. < end cycle |
| 1572 | cond_resched() |
| 1574 | BUG_ON(!!ctx ^ !!(Flags, see mm.h. & (missing pages tracking | wrprotect pages tracking ))) |
| 1584 | If Not vma_can_userfault(cur) Then Go to out_unlock |
| 1587 | found = true |
| 1591 | If Our start address within vm_mm. < start Then prev = vma |
| 1594 | ret = 0 |
| 1595 | Do |
| 1596 | cond_resched() |
| 1598 | BUG_ON(!vma_can_userfault(vma)) |
| 1607 | WARN_ON(!(Flags, see mm.h. & VM_MAYWRITE)) |
| 1609 | If Our start address within vm_mm. > start Then start = Our start address within vm_mm. |
| 1611 | vma_end = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(end, The first byte after our end addresswithin vm_mm. ) |
| 1613 | If userfaultfd_missing(vma) Then |
| 1626 | new_flags = Flags, see mm.h. & ~(missing pages tracking | wrprotect pages tracking ) |
| 1627 | prev = Given a mapping request (addr,end,vm_flags,file,pgoff), figure out* whether that can be merged with its predecessor or its successor |
| 1631 | If prev Then |
| 1635 | If Our start address within vm_mm. < start Then |
| 1636 | ret = Split a vma into two pieces at address 'addr', a new vma is allocated* either for the first part or the tail. |
| 1637 | If ret Then Break |
| 1640 | If The first byte after our end addresswithin vm_mm. > end Then |
| 1641 | ret = Split a vma into two pieces at address 'addr', a new vma is allocated* either for the first part or the tail. |
| 1642 | If ret Then Break |
| 1645 | next : |
| 1651 | Flags, see mm.h. = new_flags |
| 1654 | skip : |
| 1658 | When vma && Our start address within vm_mm. < end cycle |
| 1659 | out_unlock : |
| 1660 | lease a write lock |
| 1662 | out : |
| 1663 | Return ret |
| Name | Describe |
|---|---|
| userfaultfd_ioctl |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |