函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:file_mmap_ok

函数原型:static inline bool file_mmap_ok(struct file *file, struct inode *inode, unsigned long pgoff, unsigned long len)

返回类型:bool

参数:

类型参数名称
struct file *file
struct inode *inode
unsigned longpgoff
unsigned longlen
1354  maxsize等于file_mmap_size_max(file, inode)
1356  如果maxsizelen大于maxsize则返回:false
1358  maxsize减等于len
1359  如果pgoff大于maxsize右移PAGE_SHIFT determines the page size 位则返回:false
1361  返回:true
调用者
名称描述
do_mmapThe caller must hold down_write(¤t->mm->mmap_sem).