Function report |
Source Code:mm\swapfile.c |
Create Date:2022-07-28 15:18:18 |
| Last Modify:2020-03-17 22:19:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:unuse_pte_range
Proto:static int unuse_pte_range(struct vm_area_struct *vma, pmd_t *pmd, unsigned long addr, unsigned long end, unsigned int type, bool frontswap, unsigned long *fs_pages_to_unuse)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct vm_area_struct * | vma | |
| pmd_t * | pmd | |
| unsigned long | addr | |
| unsigned long | end | |
| unsigned int | type | |
| bool | frontswap | |
| unsigned long * | fs_pages_to_unuse |
| 1919 | ret = 0 |
| 1923 | pte = pte_offset_map(pmd, addr) |
| 1924 | Do |
| 1927 | If Not heck whether a pte points to a swap entry Then Continue |
| 1930 | entry = Convert the arch-dependent pte representation of a swp_entry_t into an* arch-independent swp_entry_t. |
| 1931 | If Extract the `type' field from a swp_entry_t. The swp_entry_t is in* arch-independent format != type Then Continue |
| 1934 | offset = Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format |
| 1935 | If frontswap && Not frontswap_test(si, offset) Then Continue |
| 1940 | Target VMA = vma |
| 1941 | Faulting virtual address = addr |
| 1944 | If Not page Then |
| 1945 | If swap_map == 0 || swap_map == Note pageblock is bad, in first swap_map Then Go to try_next |
| 1947 | Return -ENOMEM |
| 1953 | If ret < 0 Then |
| 1956 | Go to out |
| 1963 | If fs_pages_to_unuse && Not --fs_pages_to_unuse Then |
| 1964 | ret = Return code to denote that requested number of* frontswap pages are unused(moved to page cache).* Used in in shmem_unuse and try_to_unuse. |
| 1965 | Go to out |
| 1967 | try_next : |
| 1968 | pte = pte_offset_map(pmd, addr) |
| 1972 | ret = 0 |
| 1973 | out : |
| 1974 | Return ret |
| Name | Describe |
|---|---|
| unuse_pmd_range |
| 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 |