函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\msync.c Create Date:2022-07-27 16:22:57
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:MS_SYNC syncs the entire file - including mappings

函数原型:SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags)

返回类型:

参数:

35  mm等于mm
37  unmapped_error等于0
38  error等于负EINVAL
40  start等于Architectures that support memory tagging (assigning tags to memory regions,* embedding these tags into addresses that point to these memory regions, and* checking that the memory and the pointer tags match on memory accesses)(start)
42  如果flags按位与sync memory asynchronously 按位或validate the caches 按位或synchronous memory sync 的值的反则转到:out
44  如果offset_in_page(start)则转到:out
46  如果flags按位与sync memory asynchronously flags按位与synchronous memory sync 则转到:out
48  error等于负ENOMEM
49  len等于lenPAGE_MASK的反按位与PAGE_MASK
50  end等于startlen
51  如果end小于start则转到:out
53  error等于0
54  如果end恒等于start则转到:out
60  lock for reading
61  vma等于Look up the first VMA which satisfies addr < vm_end, NULL if none.
62  循环
67  error等于负ENOMEM
68  如果非vma则转到:out_unlock
73  如果start大于等于end则转到:out_unlock
75  unmapped_error等于负ENOMEM
78  如果flags按位与validate the caches Flags, see mm.h. 按位与VM_LOCKED
80  error等于负EBUSY
81  转到:out_unlock
83  file等于File we map to (can be NULL).
84  fstart等于startOur start address within vm_mm. Offset (within vm_file) in PAGE_SIZEunits 左移PAGE_SHIFT determines the page size 位的值
86  fend等于fstart两数取小(end, The first byte after our end addresswithin vm_mm. )减start减1
87  start等于The first byte after our end addresswithin vm_mm.
88  如果flags按位与synchronous memory sync fileFlags, see mm.h. 按位与VM_SHARED
90  get_file(file)
93  fput(file)
94  如果errorstart大于等于end则转到:out
98  否则
99  如果start大于等于end
100  error等于0
101  转到:out_unlock
106  out_unlock :
107  lease a read lock
108  out :
109  返回:如果error否则unmapped_error