函数逻辑报告 |
Source Code:mm\mremap.c |
Create Date:2022-07-27 16:22:36 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:Expand (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.
函数原型:SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, unsigned long, new_len, unsigned long, flags, unsigned long, new_addr)
返回类型:
参数:无
602 | charged等于0 |
603 | bool locked = false |
604 | bool downgraded = false |
605 | uf等于NULL_VM_UFFD_CTX |
606 | LIST_HEAD(uf_unmap_early) |
611 | 如果flags按位与MREMAP_FIXED按位或MREMAP_MAYMOVE的值的反则返回:ret |
614 | 如果flags按位与MREMAP_FIXED且非flags按位与MREMAP_MAYMOVE的值则返回:ret |
617 | 如果offset_in_page(addr)则返回:ret |
631 | 如果lock for writing则返回:负EINTR |
634 | 如果flags按位与MREMAP_FIXED则 |
637 | 转到:out |
649 |
retval等于Munmap is split into 2 main parts -- this part which finds* what needs doing, and the areas themselves, which do the* work. This now handles partial unmappings.* Jeremy Fitzhardinge |
655 | 否则如果retval恒等于1则downgraded = true |
658 | 转到:out |
665 | 如果是错误则 |
674 | 如果vma_expandable(vma, new_len - old_len)则 |
677 | 如果vma_adjust(vma, Our start address within vm_mm. , addr + new_len, Offset (within vm_file) in PAGE_SIZEunits , NULL)则 |
683 | vm_stat_account(mm, Flags, see mm.h. , pages) |
684 | 如果Flags, see mm.h. 按位与VM_LOCKED则 |
690 | 转到:out |
699 | 如果flags按位与MREMAP_MAYMOVE则 |
700 | map_flags等于0 |
701 | 如果Flags, see mm.h. 按位与VM_MAYSHARE则map_flags或等于Share changes |
708 | 如果IS_ERR_VALUE(new_addr)则 |
716 | out : |
717 | 如果offset_in_page(ret)则 |
718 | vm_unacct_memory(charged) |
719 | locked等于0 |
721 | 如果downgraded则lease a read lock |
723 | 否则lease a write lock |
728 | mremap_userfaultfd_complete( & uf, addr, new_addr, old_len) |
729 | userfaultfd_unmap_complete(mm, & uf_unmap) |
730 | 返回:ret |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |