函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\ramfs\file-nommu.c Create Date:2022-07-29 11:11:54
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:ramfs_nommu_get_unmapped_area

函数原型:static unsigned long ramfs_nommu_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags)

返回类型:unsigned long

参数:

类型参数名称
struct file *file
unsigned longaddr
unsigned longlen
unsigned longpgoff
unsigned longflags
206  inode等于file_inode(file)
207  pages等于NULL
211  lpages等于lenPAGE_SIZE减1右移PAGE_SHIFT determines the page size
212  isize等于NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they
214  ret等于负ENOSYS
215  maxpages等于isizePAGE_SIZE减1右移PAGE_SHIFT determines the page size
216  如果pgoff大于等于maxpages则转到:out
219  如果maxpagespgoff小于lpages则转到:out
223  pages等于分配数组内存并置零
224  如果非pages则转到:out_free
227  nr等于find_get_pages(i_mapping, & pgoff, lpages, pages)
228  如果nr不等于lpages则转到:out_free_pages
232  ptr等于pages
233  page等于ptr自加
234  page自加
235 loop大于1循环如果ptr自加不等于page自加则
237  转到:out_free_pages
240  ret等于page_address(pages[0])
242  out_free_pages :
243  ptr等于pages
244 loop大于0循环Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
246  out_free :
247  释放内存
248  out :
249  返回:ret