Function report |
Source Code:mm\userfaultfd.c |
Create Date:2022-07-28 16:34:07 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:__mcopy_atomic
Proto:static __always_inline ssize_t __mcopy_atomic(struct mm_struct *dst_mm, unsigned long dst_start, unsigned long src_start, unsigned long len, bool zeropage, bool *mmap_changing)
Type:ssize_t
Parameter:
Type | Parameter | Name |
---|---|---|
struct mm_struct * | dst_mm | |
unsigned long | dst_start | |
unsigned long | src_start | |
unsigned long | len | |
bool | zeropage | |
bool * | mmap_changing |
471 | copied = 0 |
472 | page = NULL |
473 | retry : |
474 | lock for reading |
482 | If mmap_changing && READ_ONCE( * mmap_changing) Then Go to out_unlock |
490 | dst_vma = find_dst_vma(dst_mm, dst_start, len) |
491 | If Not dst_vma Then Go to out_unlock |
499 | If WARN_ON_ONCE(vma_is_anonymous(dst_vma) && Flags, see mm.h. & VM_SHARED) Then Go to out_unlock |
506 | If is_vm_hugetlb_page(dst_vma) Then Return __mcopy_atomic processing for HUGETLB vmas. Note that this routine is* called with mmap_sem held, it will release mmap_sem before returning. |
510 | If Not vma_is_anonymous(dst_vma) && Not vma_is_shmem(dst_vma) Then Go to out_unlock |
519 | If Not (Flags, see mm.h. & VM_SHARED) && Value for the false possibility is greater at compile time(anon_vma_prepare(dst_vma)) Then Go to out_unlock |
528 | dst_pmd = mm_alloc_pmd(dst_mm, dst_addr) |
534 | dst_pmdval = pmd_read_atomic(dst_pmd) |
555 | BUG_ON(pmd_trans_huge( * dst_pmd)) |
559 | cond_resched() |
561 | If Value for the false possibility is greater at compile time(err == - ENOENT) Then |
567 | page_kaddr = kmap(page) |
568 | err = copy_from_user(page_kaddr, (constvoid__user * )src_addr, PAGE_SIZE) |
576 | Go to retry |
580 | If Not err Then |
585 | If fatal_signal_pending(current process) Then err = -EINTR |
588 | If err Then Break |
592 | out_unlock : |
594 | out : |
595 | If page Then Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page. |
Name | Describe |
---|---|
mcopy_atomic | |
mfill_zeropage |
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 |